<< | [up] | >> |
dim_STAT User's Guide. by Dimitri |
Linux Special Notes |
I don't know if I'll surprise you by saying: all dim_STAT binaries for Solaris SPARC are still compiled on the old and legendary SPARCstation-5 under Solaris2.6 and working on every next generation Sun SPARC machines, as well as last generation + Solaris10 included? Some unchanged binaries are still here and are even 10 years old! This calls a TRUE binary compatibility! :))Now, may I say the same thing about Linux? :)) Even sometime the SAME vendor breaking its binary compatibility between previous and next distribution version!...
Firstly, when the main problem was only in the different implementation of shared libraries, I've recompiled all main dim_STAT programs as static binaries to be sure they will run on every distribution. With time things are more worse: static binary may do a core dump on some distros... So, current dim_STAT Linux version shipping both dynamic and several static versions of the same binary generated on the different distros. Current v.8.0 is reported to work out-of-the-box on: MEPIS 3.3.1-1, MEPIS 6.0, RHEL 4.x, CentOS 4.x, SuSE 9/10, Fedora Core 3/4/5. Anyway, if you meet any problem during installation or execution of dim_STAT - please, contact me directly and we'll try to fix this issue together...
NOTE: PC boxes are quite chip today, so always ask yourself if simple buying of $200 PC, installing MEPIS 6.0 (10 minutes), installing dim_STAT (5 minutes) and START to collect from all your servers! - will not be chipper/easier/simpler rather trying to fix issue after issue :))
Linux STAT-service |
If generally there is no problem with Solaris stat programs, people always have a lot of questions about Linux stats integration...Main point: keep in mind - the most important part to collect stats from Linux box is the working STAT-service! If it starts on your box - you may integrate now _any_ existing or new stat commands (there are so many available via internet)...
Pre-integrated stats are already coming with STATsrv-Lux.tgz package. It doesn't mean it will work on your system at once (linux distribution compatibility is another issue :)) Some of them I got from 'sysstat' kit and recompiled on MEPIS 6.0 (so you may recompile them yourself if needs, these stat programs are coming from sysstat (http://perso.wanadoo.fr/sebastien.godard/). And some developed myself - as I was tired by seeing different output on different distros even with standard commands like 'vmstat'!... So, now STAT-service is shipped with its own vmstat, netLOAD and psSTAT! :))
Wrappers may be needed for some stat commands to skip unused information or just transform input data into expected form. Following commands already have wrappers (if need) and pre-integrated into packaged STAT-service.
NOTE: sometime the same command may give a different output on a different Linux distribution! So, be ready to create new Add-Ons in this case or create common wrappers to adapt command output...
LvmSTAT |
Source: Linux "vmstat", shipped with STAT-service since v.8.0Output example:
dim$ /etc/STATsrv/bin/vmstat 1 procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 0 0 434384 691948 9708 220592 3 4 32 28 36 47 3 1 95 1 0 0 434384 691948 9708 220592 0 0 0 0 347 913 2 0 98 0 0 0 434384 691948 9708 220592 0 0 0 0 396 1083 2 1 97 0Wrapper: no need anymore, the same output is guaranteed on the all systems now (if it runs ;-))dim$
LcpuSTAT |
Source: "mpstat" from SysstatOutput example:
dim$ /etc/STATsrv/bin/cpuSTAT.sh 1 Linux 2.6.15-26-386 (dimitri) 11/16/06Wrapper: not really needed, but simplifying usage, just ignoring "*Linux*||*CPU*||" lines and use "*all*" as separator.16:45:15 CPU %user %nice %system %idle intr/s 16:45:16 all 0.00 0.00 0.00 100.00 115.00 16:45:16 0 0.00 0.00 0.00 100.00 115.00 16:45:17 all 1.00 0.00 0.00 99.00 147.00 16:45:17 0 1.00 0.00 0.00 99.00 147.00 16:45:18 all 0.00 0.00 0.00 100.00 162.00 16:45:18 0 0.00 0.00 0.00 100.00 162.00
dim$
LioSTAT |
Source: "iostat" from SysstatOutput example:
dim$ /etc/STATsrv/bin/ioSTAT.sh 1 Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util hda 11.05 1.24 0.84 0.37 64.54 56.72 32.27 28.36 100.59 0.21 175.97 6.16 0.74Wrapper: ioSTAT.sh - to ignore CPU-related part, devices/partitions list may vary from system to system.Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s rkB/s wkB/s avgrq-sz avgqu-sz await svctm %util hda 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
^C $dim
psSTAT for Linux |
I was tired by strange/wrong 'top' output which in many cases just not showing or ignoring low loaded processes, and finally give you a wrong vision about your system. So I adapted my Solaris psSTAT idea to the Linux /proc structures...
So well, there are few similar options:
psSTAT (dim) v.2.0 Nov.2006 Usage: psSTAT [options] -l Long output -O active Only processes/users -T sec Timeout sec seconds between outputs -N name[,name2[,...]] only proc Name containing name, or name2, or ... -M mode Use Special Mode output: proc - output is grouped by process name user - output is grouped user name ref - reference: process name combined with pid dim$Output example:
dim$ /etc/STATsrv/bin/psSTAT -O -T 1 PID PNAME UsrTM SysTM CPU% MinF MajF PRI NI Thr VmSIZE 1 init 0.00 0.00 0.0 0 0 16 0 1 1568 3153 dbus-daemon 0.02 0.00 2.0 0 0 17 0 1 2324 3166 hald 0.01 0.00 1.0 0 0 16 0 1 6916 3761 Xorg 0.01 0.00 1.0 0 0 5 -10 1 100680 3879 konsole 0.02 0.00 2.0 2 0 16 0 1 29416 24904 kpowersave 0.01 0.00 1.0 0 0 16 0 1 32720 28035 psSTAT 0.02 0.00 2.0 336 0 16 0 1 1812 PID PNAME UsrTM SysTM CPU% MinF MajF PRI NI Thr VmSIZE 1 init 0.00 0.00 0.0 0 0 16 0 1 1568 28035 psSTAT 0.03 0.00 3.0 336 0 17 0 1 1812 PID PNAME UsrTM SysTM CPU% MinF MajF PRI NI Thr VmSIZE 1 init 0.00 0.00 0.0 0 0 16 0 1 1568 3761 Xorg 0.03 0.00 3.0 0 0 5 -10 1 100680 22726 java_vm 0.01 0.00 1.0 0 0 16 0 21 231760 28035 psSTAT 0.03 0.00 3.0 336 0 17 0 1 1812 PID PNAME UsrTM SysTM CPU% MinF MajF PRI NI Thr VmSIZE 1 init 0.00 0.00 0.0 0 0 16 0 1 1568 3761 Xorg 0.02 0.00 2.0 0 0 5 -10 1 100680 3879 konsole 0.01 0.00 1.0 0 0 15 0 1 29416 28035 psSTAT 0.03 0.00 3.0 336 0 16 0 1 1812 ^C dim$
There are 3 Linux add-ons based on psSTAT:
- LpsSTAT - process stat using 'ProcName-PID' pair as unique process reference (mode: ref)
- LPrcLOAD - grouped by process name activity stats (mode: proc)
- LUsrLOAD - grouped by user name activity stats (mode: user)
NOTE: data are collected in live from '/proc' data but by given time interval, so be aware - if during this interval some processes are forked and dead very quickly - they're simply not seen by tool as there will be no trace about them in any '/proc' data...
LpsSTAT (psSTAT) |
Source: psSTAT for Linux, mode: refOutput example:
dim$ /etc/STATsrv/bin/psSTAT.sh 1 PNAME-PID UsrTM SysTM CPU% MinF MajF PRI NI Thr VmSIZE VmLCK VmRSS VmData VmSTK VmEXE VmLIB VmPTE init-00001 0.00 0.00 0.0 0 0 16 0 1 1568 0 84 160 88 28 1256 12 dbus-daemon-03153 0.03 0.00 3.0 0 0 17 0 1 2324 0 820 308 84 328 1540 12 hald-03166 0.01 0.00 1.0 0 0 16 0 1 6916 0 2016 3312 580 204 2732 12 Xorg-03761 0.02 0.00 2.0 0 0 5 -10 1 100680 0 29688 88740 276 1472 6200 248 konsole-03879 0.01 0.00 1.0 0 0 16 0 1 29416 0 6684 2980 88 40 24820 44 opera-13455 0.01 0.00 1.0 0 0 15 0 1 84380 0 52596 49804 84 9788 21844 92 java_vm-22726 0.01 0.00 1.0 0 0 16 0 21 231760 0 23960 182852 116 12 48192 108 psSTAT-27995 0.01 0.00 1.0 336 0 16 0 1 1816 0 836 420 88 16 1256 12 ^C $dimThis STAT should be used if you're looking for a single process activity and go in detail for PID, etc.
LPrcLOAD (ProcLOAD) |
Source: psSTAT for Linux, mode: procOutput example:
dim$ /etc/STATsrv/bin/ProcLOAD.sh 1 PNAME UsrTM SysTM CPU% MinF MajF Nmb Act Thr VmSIZE VmLCK VmRSS VmData VmSTK VmEXE VmLIB VmPTE NetworkManager 0.00 0.00 0.0 0 0 1 0 1 3928 0 1048 324 88 264 3140 16 Xorg 0.01 0.00 1.0 0 0 1 1 1 100680 0 29688 88740 276 1472 6200 248 konsole 0.01 0.00 1.0 0 0 5 1 5 148032 0 30780 15852 440 200 124100 220 psSTAT 0.03 0.00 3.0 338 0 1 1 1 1816 0 836 420 88 16 1256 12 PNAME UsrTM SysTM CPU% MinF MajF Nmb Act Thr VmSIZE VmLCK VmRSS VmData VmSTK VmEXE VmLIB VmPTE NetworkManager 0.00 0.00 0.0 0 0 1 0 1 3928 0 1048 324 88 264 3140 16 Xorg 0.01 0.00 1.0 0 0 1 1 1 100680 0 29688 88740 276 1472 6200 248 konsole 0.01 0.00 1.0 0 0 5 1 5 148032 0 30780 15852 440 200 124100 220 psSTAT 0.01 0.00 1.0 338 0 1 1 1 1816 0 836 420 88 16 1256 12 ^C $dimThis STAT should be used if you're looking for global per 'process name' activity and don't really need to go in detail - specially when you have a lot of processes running (!)
LUsrLOAD (UserLOAD) |
Source: psSTAT for Linux, mode: userOutput example:
dim$ /etc/STATsrv/bin/UserLOAD.sh 1 UNAME UsrTM SysTM CPU% MinF MajF Nmb Act Thr VmSIZE VmLCK VmRSS VmData VmSTK VmEXE VmLIB VmPTE root 0.01 0.00 1.0 420 0 62 1 62 256312 3576 44224 33216 3208 5700 201456 616 dim 0.03 0.00 3.0 46 0 92 2 124 1774180 0 393556 795244 8176 60672 838516 2632 UNAME UsrTM SysTM CPU% MinF MajF Nmb Act Thr VmSIZE VmLCK VmRSS VmData VmSTK VmEXE VmLIB VmPTE root 0.02 0.00 2.0 338 0 62 1 62 256312 3576 44224 33216 3208 5700 201456 616 dim 0.02 0.00 2.0 46 0 92 2 124 1774180 0 393556 795244 8176 60672 838516 2632 ^C $dimThis STAT should be used if you're looking for global per 'user' activity and don't really need to go in detail - specially when your tasks are grouped per user or you have a lot of users using the system (!)
LnetLOAD (netLOAD) |
Source: my netLOAD script for LinuxOutput example:
/etc/STATsrv/bin/netLOAD.sh 1 Name IBytes/s OBytes/s IPack/s OPack/s IErr OErr IDrp ODrp Bytes/s Pack/s none 0 0 0 0 0 0 0 0 0 0 lo 66070356 66070356 130181 130181 0 0 0 0 132140712 260362 eth0 32074500 19059001 236433 218784 0 0 0 0 51133501 455217 eth1 3766140 1544506 93950 56325 60 0 60 0 5310646 150275 Name IBytes/s OBytes/s IPack/s OPack/s IErr OErr IDrp ODrp Bytes/s Pack/s none 0 0 0 0 0 0 0 0 0 0 lo 0 0 0 0 0 0 0 0 0 0 eth0 0 0 0 0 0 0 0 0 0 0 eth1 0 0 2 3 0 0 0 0 0 5 Name IBytes/s OBytes/s IPack/s OPack/s IErr OErr IDrp ODrp Bytes/s Pack/s none 0 0 0 0 0 0 0 0 0 0 lo 0 0 0 0 0 0 0 0 0 0 eth0 0 0 0 0 0 0 0 0 0 0 eth1 0 0 2 3 0 0 0 0 0 5 ^CSTAT-service Wrapper: no need, should work as it on any Linux system
<< | [up] | >> |