>Yc@sddklZdZhdd6adZyddkZddkZddkZddkZddk Z ddk Z ddk Z ddk Z ddk Z ddkZeeiideeiieiieidd ed ed Wnej o ZnXeid d fjoeid nyeefWnej odZdZnXeid dfjoeid d fjo dZn$eid d fjo dZneid dfjo dZndfdYZdfdYZdefdYZdefdYZ defdYZ!defdYZ"defd YZ#d!efd"YZ$d#efd$YZ%d%efd&YZ&d'efd(YZ'd)efd*YZ(d+efd,YZ)d-efd.YZ*d/efd0YZ+d1efd2YZ,d3efd4YZ-d5efd6YZ.d7efd8YZ/d9efd:YZ0d;efd<YZ1d=efd>YZ2d?efd@YZ3dAefdBYZ4dCefdDYZ5dEefdFYZ6dGefdHYZ7dIefdJYZ8dKefdLYZ9dMefdNYZ:dOefdPYZ;h'dQdR6dSdT6dUdV6dWdX6dYdZ6d[d\6d]d^6d_d`6dadb6dcdd6dedf6dgdh6didj6dkdl6dmdn6dodp6dqdr6dsdt6dudv6dwdx6dydz6d{d|6d}d~6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6dd6a<hdd6dd6dd6dd6dd6dd6Z=dZ>dZ?dZ@dZAdZBdZCddZDddZEddZFdZGdZHdZIddddZJdZKdZLdZMdZNdZOdZPedZQdZRdZSdZTdZUdZVdZdZWdZXdZYdZZe[djoy.eOeeida\e>aeYWnGej o;Zt\i]oei^i_dnei^i_tdnXt\i`oeiiat\i`oeibt\i`nedneda\dacdS(i(t generatorss0.7.0ttdefaultcCs;tii|o$|tijotii|ndS(N(tostpathtisdirtsystappend(R((s/usr/share/dstat/dstat.pytaddpaths#Ns ~/.dstat/is /plugins/s/usr/share/dstat/s/usr/local/share/dstat/is#error: Python 2.2 or later requirediiccs0d}x#|D]}||fV|d}q WdS(Nii((tsequencetindextitem((s/usr/share/dstat/dstat.pyt enumerate2s  cCs>d}g}x+|D]#}|i||f|d}qW|S(Nii(R(R R tseqlistR ((s/usr/share/dstat/dstat.pyR 8scCs%d}x|D]}||}q W|S(Ni((R tretti((s/usr/share/dstat/dstat.pytsumCs tOptionscBs5eZdZdZdZdZdZRS(c Cs||_t|_d|_d|_d|_d|_d|_t|_ t|_ t|_ d|_ d|_ d|_t|_t|_t|_t|_t|_t}g|_tiipt|_t|_t|_nhdid6djd 6dkd 6|_ynddk}|i|ddddddddddddddddddd d!d"d#g|\}}Wn4|ij o%}d$t|GHtidnXxT|D]L\}}|dljo|iid&q|dmjo|i d(|_q|dnjo|iid*q|dojo|i!||_q|dpjo|iid-q|dqjo|iid/q|drjo|iid1q|dsjo|i d(|_ q|dtjo|iid4q|dujo|iid6q|dvjoEti"d:|d;i#|i d(fIJ|i|i d(7_q|dwjo|iid=q|dxjo|i d(|_ q|dyjo|iid@q|dzjo|iidBq|d{jo|iidDq|d|jo|i d(|_q|d}jo|iidGq|d~jo|iidIq|djo|iidKq|djo"|id&d*d=d/dKg7_q|djo%|id@d6d/d*dKd&g7_q|djo t|_ q|djo t|_q|djo|id|_q|djo2hi$|i%}|i&|i|7_q|djo t|_ q|djo t|_ q|djot'tidq|djot|_t|_q|djo t|_q|djo t|_q|djo ||_q|djo ||_q|djo%|i(|i)tidq|djo|i*tidq|i+dco|ii|ddqde|GHtidqW|i o |i odfGHtidn|ipd&d*d=d/dKg|_nyXt,|djot-|d|_nt,|djot-|d|_nWndgGHtidnX|idjodhGHtidndS(Niiitsdashd[a-d]tlocalssd[b-k]ssd[v-z]ssda[a-e]tloresssd[l-u]ssda[f-o]thiress acdfghilmno:prstTvyC:D:I:M:N:S:Vtalls all-pluginstbwt blackonwhitetdebugt filesystemtfloattfulltgonutsthelptintegertlisttmodstmodulestnocolort noheaderstnoupdatesoutput=spidfile=tversiontvmstats5dstat: %s, try dstat -h for a list of all the optionss-ctcpus-Ct,s-dtdisks-Ds --filesystemtfss-gtpages-itints-Is-ltloads-mtmems-Ms--modss --moduless9WARNING: Option %s is deprecated, please use --%s insteads --s-ntnets-Ns-ptprocs-rtios-stswaps-Ss-tttimes-Ttepochs-yRs-as--alls-vs--vmstats-fs--fulls--bws--black-on-whites--debugs --all-pluginss--floats --integers--lists --nocolors --noheaderss --noupdates-os--outputs --pidfiles-hs--helps-Vs --versions--isNdstat: option %s unknown to getopt, try dstat -h for a list of all the optionssOdstat: option --float and --integer are mutual exlusive, you can only force ones>dstat: incorrect argument, try dstat -h for the correct syntaxs2dstat: delay must be an integer, greater than zero(Rshd[a-d](ssd[b-k]ssd[v-z]ssda[a-e](ssd[l-u]ssda[f-o](s-c(s-C(s-d(s-D(s --filesystem(s-g(s-i(s-I(s-l(s-m(s-Ms--modss --modules(s-n(s-N(s-p(s-r(s-s(s-S(s-t(s-T(s-y(s-as--all(s-vs--vmstat(s-fs--full(s--bws--black-on-white(s--debug(s --all-plugins(s--float(s --integer(s--list(s --nocolor(s --noheaders(s --noupdate(s-os--output(s --pidfile(s-hs--help(s-Vs --version(.targstFalseRtcounttNonetcpulistRtdelaytdisklistRRRtintlisttnetlisttswaplisttTruetcolortupdatetheadertoutputtpidfilet listpluginstpluginsRtstdouttisattytdisksettgetoptterrortstrtexitRtsplitt get_disklisttstderrtjointfromkeystkeystsortt showpluginstusageRR&t startswithtlenR-( tselfR6t allpluginsRKtoptstexctopttargRG((s/usr/share/dstat/dstat.pyt__init__Js                          #            )          " %                              cCs|id}g}x|D]}|d djotii|otii|opti|}|ddjo7tiitii||}tii|}nd||fGH|}n|d}|i |qd|GHq|i |qW|S(NR)is/dev/it/sdstat: symlink %s -> %ssdstat: %s does not exist( RORRtexiststislinktreadlinkRRtdirnametnormpathR(RZtdisksR<RR*ttarget((s/usr/share/dstat/dstat.pyRPs$!   cCsdtGHdGHdGHHdtitifGHdtidGHdtiGHHd}t|ip d }nd ti d |fGHt \}}d ||fGHHd t GHdt i GHdtidGHH|atdS(NsDstat %ss&Written by Dag Wieers s2Homepage at http://dag.wieers.com/home-made/dstat/sPlatform %s/%ss Kernel %sis Python %sRsno s#Terminal type: %s (%scolor support)tTERMs#Terminal size: %d lines, %d columnssProcessors: %ds Pagesize: %dsClock ticks per secs: %dt SC_CLK_TCK(tVERSIONRtnameRtplatformtunameR&t gettermcolorRAtgetenvt gettermsizetgetcpunrtresourcet getpagesizetsysconftopRV(RZRAtrowstcols((s/usr/share/dstat/dstat.pyR&s*    cCs dGHdS(Ns/Usage: dstat [-afv] [options..] [delay [count]]((RZ((s/usr/share/dstat/dstat.pyRWscCs dGHdS(NsVersatile tool for generating system resource statistics Dstat options: -c, --cpu enable cpu stats -C 0,3,total include cpu0, cpu3 and total -d, --disk enable disk stats -D total,hda include hda and total -g, --page enable page stats -i, --int enable interrupt stats -I 5,eth2 include int5 and interrupt used by eth2 -l, --load enable load stats -m, --mem enable memory stats -n, --net enable network stats -N eth1,total include eth1 and total -p, --proc enable process stats -r, --io enable io stats (I/O requests completed) -s, --swap enable swap stats -S swap1,total include swap1 and total -t, --time enable time/date output -T, --epoch enable time counter (seconds since epoch) -y, --sys enable system stats --aio enable aio stats --fs, --filesystem enable fs stats --ipc enable ipc stats --lock enable lock stats --raw enable raw stats --socket enable socket stats --tcp enable tcp stats --udp enable udp stats --unix enable unix stats --vm enable vm stats --plugin-name enable plugins by plugin name (see manual) --list list all available plugins -a, --all equals -cdngy (default) -f, --full automatically expand -C, -D, -I, -N and -S lists -v, --vmstat equals -pmgdsc -D total --bw, --blackonwhite change colors for white background terminal --float force float values on screen --integer force integer values on screen --nocolor disable colors (implies --noupdate) --noheaders disable repetitive headers --noupdate disable intermediate updates --output file write CSV output to file delay is the delay in seconds between each update (default: 1) count is the number of updates to display before exiting (default: unlimited) ((RZ((s/usr/share/dstat/dstat.pyRs3(t__name__t __module__R`RPR&RWR(((s/usr/share/dstat/dstat.pyRIs    tdstatcBseZdZdZdZdZdZdZdZ dZ dZ dZ dddZ dZd Zd Zd Zd Zd ZdZdZdZdZdZdZRS(tfiiicCst|io|i|_nt|io|i|_n|ip tdnt|io|i|_nt|io|i|_n|ip|i|_nh|_h|_h|_|i djo;x|iD])}d|i|<|i|<|i|t i o"|tdt dtd}q|t d }qlqlW|S( NttitleiRt-Ritframetdashtspace(tthemeRRlRRRtcenterRR RRYRvRAtchar(RZRRRRl((s/usr/share/dstat/dstat.pyRs  0  & "cCsud}t|itioxyt|iD]h\}}|td|d|i!i|itd}|dt |ijo|t d}q,q,W|Sxt|iD]\}}xyt|iD]h\}}|td|d|i!i|itd}|dt |ijo|t d}qqW|dt |ijo|tdt d}qqW|SdS( NRtsubtitleiRiRRtcolon( RRlRRR RRRRRYR(RZRRRRltj((s/usr/share/dstat/dstat.pyRs$ 0  0cCst|itio%d|iddt|idSd}xlt|iD][\}}|d|ddt|id}|dt|ijo|d}qQqQW|SdS(Nt"R)iR(RRlRRRYRR (RZRRRl((s/usr/share/dstat/dstat.pytcsvtitles% 'cCs%d}t|itio_xWt|iD]F\}}|d|d}|dt|ijo|d}q,q,W|Sxt|iD]\}}xWt|iD]F\}}|d|d}|dt|ijo|d}qqW|dt|ijo|d}qqW|SdS(NRRiR)(RRlRRR RRY(RZRRRRlR((s/usr/share/dstat/dstat.pyt csvsubtitles$   cCsM|ip tdn|ip tdn|iotStddS(sCheck if stat is applicables$No objects found, no stats availables)No objects discovered, no stats availablesUnknown problem, please reportN(RRRRR@(RZ((s/usr/share/dstat/dstat.pytchecks     cGstS(N(R@(RZtobjlist((s/usr/share/dstat/dstat.pyRscCsd}xt|iD]\}}t|i|tipt|i|tio?|t|i||i|i |i }t dt d}n4|t |i||i|i |i }t d}|dt|ijo||}qqW|S(sDisplay stat resultsRRRRi(R RRRRt TupleTypetListTypet cprintlistttypeRtscaleRRtcprintRY(RZRRRltsep((s/usr/share/dstat/dstat.pytshows 4)) cCsD||dj otdtdS||jotdtdSdS(NiRtpipetgtR(RR(RZttotlisttvislist((s/usr/share/dstat/dstat.pytshowends  cCs9d}d}x#t|iD]\}}t|i|tipt|i|tiodxt|i|D]H\}}|||}|dt|i|jo|d}qsqsWnGt|i|tio||i|}n|||i|}|dt|ijo|d}qqW|S(NcSs*|t|jo d|Sdt|S(Ns%.3fs%s(tround(tvar((s/usr/share/dstat/dstat.pytprintcsvs RiR)( R RRRRRRRYR(RZRRRRlRR((s/usr/share/dstat/dstat.pytshowcsvs   4 cCs0||dj odS||dj odSdS(NiR)R((RZRR((s/usr/share/dstat/dstat.pyt showcsvends N(RyRzR9RRlRRRRRxRRRRRRRRRRRRRRRR(((s/usr/share/dstat/dstat.pyR{Us.            t dstat_aiocBseZdZdZRS(cCs>d|_d|_d|_|idd|_d|_dS( Ntasynctdis/proc/sys/fs/aio-nrs#aiotaio(s#aio(R(RlRRRRR(RZ((s/usr/share/dstat/dstat.pyR`$s      cCsLxE|iD]7}t|djoq nt|d|idd|_d|_d|_|idd |_d |_dS( Ntpii"s /proc/stattusrRtidltwaithiqtsiqi(RssysRRRR(RRRRRRx(RZ((s/usr/share/dstat/dstat.pyR`2s      cGsg}x[|iD]M}t|djp|ddd!djoqn|i|ddqW|ix|D]}|i|quW|S(NiiiR((RRYRRU(RZRRRR ((s/usr/share/dstat/dstat.pyR:s + cCsg}tio ti}nStip d}n?g}d}x/|tjo!|it||d}q@Wx6|D].}||idgjo|i|qvqvW|S(NR}ii(stotal(RvR:RtcpunrRRMR(RZRtvarlistR(Rl((s/usr/share/dstat/dstat.pyRCs      cCsQg}xD|iD]9}|djo|idq|id|dqW|S(NR}stotal cpu usageR(s usage(RR(RZRRl((s/usr/share/dstat/dstat.pyRlUs  c Csx|iD]}t|djoq nx|iD]}|dd|jp|ddjoz|djomt|dt|dt|dt|dt|d t|d t|d f|i|d|_d|_d|_|idd|_d|_dS( NRii"s /proc/statRRR(susrssyssidl(RRRRRRx(RZ((s/usr/share/dstat/dstat.pyR`os      cGsg}x[|iD]M}t|djp|ddd!djoqn|i|ddqW|ix|D]}|i|quW|S(NiiiR((RRYRRU(RZRRRR ((s/usr/share/dstat/dstat.pyRws + cCsg}tio ti}nStip d}n?g}d}x/|tjo!|it||d}q@Wx6|D].}||idgjo|i|qvqvW|S(NR}ii(stotal(RvR:RRRRMR(RZRRR(Rl((s/usr/share/dstat/dstat.pyRs      cCsGg}x:|iD]/}|o|id|q|idqW|S(NR(s cpu total(RR(RZRRl((s/usr/share/dstat/dstat.pyRls c CsKx|iD]}x|iD]}|dd|jp|ddjoS|djoFt|dt|dt|dt|df|i|d|_tid|_|idd|_d|_dS(NRs(^(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)$s/proc/diskstatstreadtwriti(sreadR(Rtretcompilet diskfilterRRRx(RZ((s/usr/share/dstat/dstat.pyR`s    cGsg}xd|iD]V}t|djoqn|ddgdjoqn|d}|i|qWx|D]}|i|qtW|p tdn|S(Ni it0i is*No suitable block devices found to monitor(RRYRR(RZRRRRlR ((s/usr/share/dstat/dstat.pyRs   cCsg}tio ti}ntip d}ng}g}tidD]}|tii|qK~}xL|iD]A}|ii |oqwn||joqwn|i |qwW|i xC|D];}||idgti i jo|i |qqW|S(NR}s /sys/block/*(stotal(RvR<RtglobRRtbasenameRRtmatchRRURJRT(RZRRt_[1]Rt blockdevicesRl((s/usr/share/dstat/dstat.pyRs(    6   $cCs&g}|iD]}|d|q~S(Nsdsk/(R(RZRRl((s/usr/share/dstat/dstat.pyRlsc Csx|iD]}d|i||iiD]-}|i||i|dt |i ||idd|_d|_tid|_d|_dS(Ns /proc/net/devRtrecvtsends!^(lo|bond[0-9]+|face|.+\.[0-9]+)$i(R#ssend(RRRRRt totalfilterRx(RZ((s/usr/share/dstat/dstat.pyR`s    cGsg}x|iddD]q}t|djoqn|ddjo|ddjoqn|d}|d jo|i|qqW|ix|D]}|i|qW|S( NRRiiRi itlotface(sloR'(RRYRRU(RZRRRRlR ((s/usr/share/dstat/dstat.pyRs"   cCsg}tio ti}n(tip d}n|i}|ix9|D]1}||iddgjo|i|qKqKW|p tdn|S(NR}R&s/No suitable network interfaces found to monitor(stotal(RvR>RRRURR(RZRRRl((s/usr/share/dstat/dstat.pyRs       cCs&g}|iD]}|d|q~S(Nsnet/(R(RZRRl((s/usr/share/dstat/dstat.pyRlscCsddg|idR?srawR@(ssockets:sTCP:sUDP:sRAW:sFRAG:(RlRRRRRR(RZ((s/usr/share/dstat/dstat.pyR`=s      cCsxI|iD];}t|djoq nt|d|i|dRRRRRt+tplusc CsBtiohtdd6tdtdd6tdd6tdd6tdtd d 6tdd 6td d 6tdd6tdd6tdd6tdd6tdd6td tdtdtdtdtdtdtdfd6tdtdtdtdtdtdtd tdfd6}nhtdd6tdtdd6tdd6tdd6tdtd d 6tdd 6td d 6tdd6tdd6tdd6tdd6tdd6tdtdtdtdtdtdtd tdfd6td td tdtdtdtdtdtdfd6}|S(!NR{RR}RRRRRRRLt roundtripRxRRtinputRwttext_lottext_hitunit_lotunit_hiR|RyR~RRt colors_loRRRt colors_hiRRz(RvRtansi(R((s/usr/share/dstat/dstat.pyt set_themeHsH           #*          #&cCsyXxQtdddiD]7}|i}t|djoqnt|dSWWntxntdiD]V}|i}t|djoqqn|ddjotit|dSqqWnXdS( s)Return the number of 'ticks' since bootups /proc/uptimetriis /proc/stattbtimeiN(RRRORYRRR4R(RR((s/usr/share/dstat/dstat.pytticksqs  cCsR|ido|idd}n(|ido|idd}n|S(sImprove a device names /dev/mapper/Rais/dev/i(RXRO(tdevname((s/usr/share/dstat/dstat.pyRDs cCstii|ptd|ndtijo hanttijot|ddt|ti|iggg|do||id}q7W|idS(s7Read available data from pipe in a non-blocking fashionRiis (tselecttfilenoRRO(tfileobjttmoutR((s/usr/share/dstat/dstat.pytreadpipes&&cCsd}x+ti|iggg|dpq Wxpti|iggg|doI|id}|djo||}q7|i|o|Sd}q7Wtio tdndS(s7Grep available data from pipe in a non-blocking fashionRiis s-Nothing found during greppipe data collectionN(RRRRXRvRRR9(RRMRRt character((s/usr/share/dstat/dstat.pytgreppipes&&    cCsd}ti|}x+ti|iggg|dpqWxpti|iggg|doI|id}|djo||}qF|i|o|Sd}qFWtio tdndS(s8Match available data from pipe in a non-blocking fashionRiis s.Nothing found during matchpipe data collectionN( RRRRRRRvRRR9(RtstringRRRR((s/usr/share/dstat/dstat.pyt matchpipes &&    cCsid}xVtoHttt|}t||joPn||}|d}q Wd}||fS(s/Convert decimal to string given base and lengthiii(R@RMRRRY(RRtbasetcR((s/usr/share/dstat/dstat.pytdchgs cCsd}x to|djotd}Pnttt||}t||jo|t|d}x||djoVd||}t||jo'|ttt||joPn|d}qsWttt|}Pn||}|d}q Wd}||fS(s.Convert float to string given scale and lengthiRis%%.%dfi(R@RMRRRY(RRRRRR((s/usr/share/dstat/dstat.pytfchgs*   5 cCsBd}}x1|D])}||t||||}d}qW|S(s Return all columns color printedRR(R(RRRRRRR((s/usr/share/dstat/dstat.pyRs   R|iic Cs}d}|djo d}nt}|d"jo-|tt|jot}|d}n|djoJ|o"tddi|dtdStddi|tdSn|djo d#}nd$}ttijo"td}td}td} ntd}td}td} ti o)|d%jot |||\} } nti o)|d&jot |||\} } n|d'jot |||\} } n|djot |||\} } nb|djot||} } n>|djo#d|d|df|} } nt d|| d jo | } n|djo |} n|d(jo"|t||t|} na|djo(|tt||t|} n,|d)jo|| t|} n|} |d*jo| | i|} n| | i|} |oD| d!jo)t|djo| | || 7} qy| d7} n| S(+sColor print one columniiiiRLRRRtBtktMtGtTtPtEtZtYRRRRRRRRR|Rdtts%2dh%02di<sType %s not known to dstat.Ri(ii( RRRRRRRRR( RRRRRRRRR(RRR|(RRR|(RR(ii(RR|(Rd(R7RYRMR@RtrjustRRvR;RRRRRR-Rtljust( RRRRRtunittunitstcolorstctexttcunitRRRA((s/usr/share/dstat/dstat.pyRsj  & "!           #      " (   cCsd}xp|D]h}||i7}||dj o|tdtd7}q ||jo|tdtd7}q q W|d7}xp|D]h}||i7}||dj o|tdtd7}q||jo|tdtd7}qqW|dS( NRiRRRRs R(RRRR(RRRto((s/usr/share/dstat/dstat.pyRCUs"   cCsd}x=|D]5}||i}||dj o|d}q q W|d7}x=|D]5}||i}||dj o|d}qWqWW|dS(NRiR)s (RR(RRR((s/usr/share/dstat/dstat.pyt csvheaderhs cCsti|IJdS(sOutput info messageN(RRQ(tlevelRM((s/usr/share/dstat/dstat.pytinfowscCsti|IJt|dS(s#Print error and exit with errorcodeN(RRQRN(RRM((s/usr/share/dstat/dstat.pytdie|s cCs}y/ddkaddkaddkatiWnAy*titidtidfWnqyXdanXdadS( sInitialise terminaliNR;Rxii(Ni(Ni( tfcntltstructttermiost TIOCGWINSZtcursest setuptermttigetnumR9ttermsize(((s/usr/share/dstat/dstat.pytinitterms$    c CstdpytddjoQtiddddd}titiiti |}ti d|d Stddjo't i t i dt i dfSttidttidfaWqd aqXntS( s$Return the dynamic terminal geometryiitHHHHiR;RxtLINEStCOLUMNSiiP(iiP(RRtpackRtioctlRRHRRRtunpackRRRR-Rtenviron(Rdtx((s/usr/share/dstat/dstat.pyRqs ! *cCsl|oatiioQy5ddk}|i|iddjotSWqhtidIJtSXn|S(NiRis:Color support is disabled, python-curses is not installed.(RRHRIRRRR7RQ(RAR((s/usr/share/dstat/dstat.pyRos     cCs&|ddjotii|S|S(NiRat.(RaR(RRR(Rl((s/usr/share/dstat/dstat.pyRsc Csd}ytd|iid}t|d}|djot|d }n|id o+t|d }|id oqn|pnWnt|}nX|S(Ns/proc/%s/cmdlinetitbashtcshtkshtperltpythontrubytshiRi(RRRRspythonRR(R9RRRORRX(tpidRlRtcmdline((s/usr/share/dstat/dstat.pyt getnamebypids   cCs`d}x<tdiD](}|dd!djo|d}qqW|djo dn|S(s'Return the number of CPUs in the systemis /proc/statiiR(is)Problem finding number of CPUs in system.(RR(RR((s/usr/share/dstat/dstat.pyRrs  cCstid|}|oG|i}t|ddt|d}dttd|Stid|}|odS|S( s,Convert sysfs device names into device namess8ide/host([0-9])/bus([0-9])/target([0-9])/lun([0-9])/disciiithdtat placeholdertsdX(RRRR-tchrtord(tdeviceRRtnr((s/usr/share/dstat/dstat.pyRs "cCsdg}dddddddd d d g }d g}d dddddddddddddddg}dg}ddd d!d"d#d$d%g}d&g}d'g} d(g} ||joTttd)|i|d*|d*} |d*} | p d+| Sd,| | fS||joTttd)|i|d-|d.} |d.} | p d/| Sd0| | fS|| jo d1|S||jo d2|S||jo d3|S||jo d4|S|| joD| i|d*|d*} |d*} | p d5| Sd6| | fS||joK|i|} |d*} |d*} | pd7| | fSd8| | | fS||joD|i|d*|d*} |d*} | p d9| Sd:| | fSd;||fSd<S(=s+Convert major/minor pairs into device namesiiii!i"i8i9iXiYiZi[iiiAiBiCiDiEiFiGiiiiiiiii iHiIiJiKiLiMiNiOibihiRissd%sssd%s%dii@shd%sshd%s%dsdm-%dsmd%dsloop%dsram%dsc0d%dsc0d%dp%dsida%d-%ds ida%d-%d-%dsubd%dsubd%d-%dsdev%d-%dN(RRR (tmajtmintramtidetlooptscsitmdtidatubdtccisstdmtdisctparttcont((s/usr/share/dstat/dstat.pyRsb $ 6     +   +                   cCs%tiitdti|dS(NR(RRHRRRN(R((s/usr/share/dstat/dstat.pyRN/scCsg}tid}xEtD]:}|ido$|i|i|idqqWtid}x[tiD]P}xGt i |dD]2}|i|i|idi ddqWqvW|i |S(Ns dstat_(.+)$tdstat_is.+/dstat_(.+).py$s /dstat_*.pyt_R( RRRRXRRRRRRRRU(RGtremodRR((s/usr/share/dstat/dstat.pyRF3s ( 4 c Cst\}}dGtid}g}xQtD]F}|ido0|i|i|ididdq2q2W|i |d}xh|D]`}|t |d}|djod G|t |d }n||d jo |d GqqW|GHtid }xt i D]}g}xGt i |dD]2}|i|i|ididdq9W|pqn|i |d}dti i|Gxh|D]`}|t |d}|djod G|t |d }n||d jo |d GqqW|GHqWdS(Ns internal: s dstat_(.+)$RiRRiis i iR)s.+/dstat_(.+).py$s /dstat_*.pys%s: (RqRRRRXRRRRRURYRRRRtabspath(RwRxRRGRtcols2tmodR((s/usr/share/dstat/dstat.pyRV@sP 4    0   cBseiaeaeidad}ei }ei d}e i i de i ioeid}eid}|djoc|o\eidi|oCe i i d||eiie id d ieifqneeie_eioeiieio&eeid d ati d n4eeid d ati deti dti d||fti dd ieie i!de i"fnei#o{y<eei#d d }|i e$ei%|i&WqXe'j o,}e i(dei#I|IJe)e_#qXXneipqe)e_*xt+i,D]}dt+|} n8| d!jo d?} n!| d#jo d@} n | f} x| D]x} d%| i3d&d'} y| e4i,jod(dk5} | i6| \}}}|d d)joe7|d*| dUq}|d d+jod,| dUd-| dUq}e i(d.| IJn d/| dUWne'j ot}| | d(joe i(d0| |fIJn&ei8oe i(d1| |fIJnei8d2joqqnX||i9d}t/i:|PqWqWt/pe;d3d4nei8onxkt/D]_}d5Ge<|d6o |i=Gne$|i>i?d7dGe<|d8od9G|i@GnHqTWneioti eAt/neBiCe i e iD}e i aEd a*d aFxjt*ei.eiGjpeiGd(joB|iHtEt*deIt*f|iJe i iKt*|a*qWei*oe i i d:ndS(ANRjist XTERM_SHELLRis /bin/bashs(screen*|xterm*)s]0;(%s@%s) %s %siRRs tws"Dstat %s CSV output" s["Author:","Dag Wieers ",,,,"URL:","http://dag.wieers.com/home-made/dstat/" s"Host:","%s",,,,"User:","%s" s'"Cmdline:","dstat %s",,,,"Date:","%s" s%d %b %Y %H:%M:%S %ZsFailed to create pidfile %sRRRRR RR(tcpu24R*tdisk24t disk24oldR-tint24R,tpage24R3tswapoldRRRis.pysQo = dstat_plugin(); o.filename = "%s"; o.check(); o.prepare(); del(dstat_plugin);s.sos import %ss%o = %s.new(); o.check(); o.prepare();sModule %s is of unknown type.s!o = %s(); o.check(); o.prepare();sModule %s failed to load. (%s)s.Module %s failed to load, trying another. (%s)iis-None of the stats you selected are available.tModuleRRRtrequiress (slistshelp(scpuR(sdiskRR(sintR(spageR(sswapR(LRsRtR.RrRRRuthztgetpasstgetuserRnRRHRRIRpRRRRRtargvRRRvR6RoRARDRbRt outputfileRkR4RfRgRERMtgetpidRVRRQR7RBRRTRR;RRGRVRNRRtimpt find_moduletexecfileRRRRthasattrRt __class__RORRtschedt schedulertsleeptinittimetmissedR8tenterabstperformR2tflush(tintervaltuserthostnametshellttermREtetkeyt linewidthtpluginR!Rt pluginfileR(Rtpathnamet descriptionRR.((s/usr/share/dstat/dstat.pytmainds   -G  9                          '   cCsNtia|dtitia|dtidatip d}n+tdjp tdjo dand}tdjo$tt|djot da dStdjo+t a d\a a gagatanta tiiot }t\a a |t joqgaxhtD]\}||id}|t jpttd jo$|t joti||}q%q%WntioTt djoGttjo taqtdjott ddjo taqntantattijotdtds*  <<-  ,    =8CAOBFE ;3   )         O          J  $ v