<< | [up] | >> |
dim_STAT User's Guide. by Dimitri |
Linux Special Notes |
I don't know if it will surprise you that all dim_STAT binaries for Solaris SPARC until now were compiled on the same old and legendary SPARCstation-5, which runs Solaris 2.6 and that they still work on every next generation Sun SPARC machines. This includes the last generation, and Solaris 10. Some unchanged binaries are still here and are even 10 years old! This is calling a TRUE binary compatibility! :)) Now, can I say the same thing about Linux??? Sometimes, even the same vendor breaks binary compatibility between previous and next distributions! Because the main problem lies with the different implementations of shared libraries, I've recompiled all main dim_STAT programs as static binaries to be sure they will run on every distribution. Over time, things got worse: static binaries are core dumping on some distros. Therefore, the current dim_STAT Linux version ships with both dynamic and several static versions of the same binary generated on the different distros. dim_STAT reported to work out-of-the-box on MEPIS 3.3.1-1, MEPIS 6.0/7.0, Debian 3/4, RHEL 4.x/5.x, CentOS 4.x/5.x, OEL 5.x/6.x, SuSE 9/10/11/12, Fedora Core. Anyway, if you encounter any problems during installation or execution of dim_STAT, please, contact me directly and we'll try to fix the issue together. Last years many Linux vendors have stopped even to ship system libraries to run 32bit programs on their 64bit distributions.. - keep it in mind if you're planning to install dim_STAT on a 64bit Linux, you may will need to add 32bit packages then like: glibc.i686 / libc6-i386, libzip.i686/ lib32z1, libX11, libssl, libcrypto, libpng12, libjpeg, .. (check for some discussions on the dim_STAT Users Group @Google: http://groups.google.com/group/dimstat ) NOTE: PC boxes are quite cheap nowadays. So rather than trying to fix issue after issue, ask yourself if buying a $300 PC, installing MEPIS-6.0 or openSUSE-11.2 32bit on it (10 minutes), installing dim_STAT (5 minutes) and starting the collection of stats from all your servers, will not be a cheaper, easier and simpler solution. And Again: why you simply don't use Solaris/OpenSolaris and just avoid all such kind of problems?... :-) There is even Pocket Solaris available (http://milax.org) - 300MB full install + 60MB dim_STAT = all other disk space to use securely with ZFS and collect data from your servers!... Seriously...
Linux STAT-service |
While there is in general no problem with the stat programs for Solaris, there are always a lot of questions about Linux stats integration. Keep in mind: The most important part of collecting stats from a Linux box is a working STAT-service! If it starts on your box, you may integrate _any_ existing or new stat commands (there are many, many available on the internet). Pre-integrated stats are already coming with the STATsrv-Lux.tgz package. It doesn't mean it will work on your system at once (linux distribution compatibility is always an issue). Some of them I got from the 'sysstat' kit and were recompiled on MEPIS 6.0. If required, you may recompile them yourself, these stat programs are coming from sysstat (http://perso.wanadoo.fr/sebastien.godard/). And some I developed myself, as I was tired of seeing different outputs on different distros, even with standard commands like 'vmstat'! Therefore, the STAT-service is shipping 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 the form expected. The following commands already have wrappers and are pre-integrated into the packaged STAT-service. NOTE: sometimes the same command gives a different output on different Linux distribution! Be ready to create in this case new Add-Ons or to create common wrappers to adapt command output.
Lvmstat |
Source: the Linux "vmstat", as shipped with STAT-service since v.8.0 Output example :A wrapper is not needed anymore. On all systems, the same output is guaranteed (if it runs ;-)).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 0 dim$
Lmpstat |
Per CPU detailed usage statistics.
Source: the Linux "mpstat" v2 (improved) from Sysstat, and shipped with STAT-service since v.8.3 Output example :# /etc/STATsrv/bin/Lmpstat.sh 5 09:44:12 CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s 09:44:17 all 4.57 0.00 1.12 1.52 0.10 0.00 0.00 92.69 182.60 09:44:17 0 3.81 0.00 1.20 2.00 0.00 0.00 0.00 92.99 109.40 09:44:17 1 5.59 0.00 0.62 0.83 0.00 0.00 0.00 92.96 1.40 09:44:17 CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s 09:44:22 all 1.65 0.00 0.68 0.00 0.00 0.00 0.00 97.68 145.40 09:44:22 0 1.80 0.00 1.00 0.00 0.00 0.00 0.00 97.19 95.60 09:44:22 1 1.32 0.00 0.38 0.00 0.00 0.00 0.00 98.31 2.20 ^C
LcpuSTAT (deprecated) |
The source: "mpstat" from Sysstat Output example :A wrapper is not really needed, but simplifies usage. Just ignore the "*Linux*||*CPU*||" lines and use "*all*" as a separator. Deprecated (on some systems may show over 100% values :-) - better to use Lmpstat now).# /etc/STATsrv/bin/cpuSTAT.sh 1 Linux 2.6.15-26-386 (dimitri) 11/16/06 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 ^C #
LioSTAT |
Source: "iostat" from Sysstat Output example :Wrapper: ioSTAT.sh - to ignore the CPU-related part, the devices and partition list may vary from system to system.# /etc/STATsrv/bin/ioSTAT.sh 5 Device: rrqm/s wrqm/s r/s w/s op/s rsec/s wsec/s rkB/s wkB/s kB/s avgrq-sz avgqu-sz await svctm %busy sdb 0.00 515.90 17.81 88.83 106.65 1286.49 9897.66 643.24 4948.83 5592.07 104.87 0.09 0.86 0.27 2.87 sdb1 0.00 515.90 17.81 88.60 106.42 1286.49 9897.66 643.24 4948.83 5592.07 105.10 0.09 0.86 0.27 2.87 sda 0.02 10.39 0.15 0.66 0.81 29.14 87.50 14.57 43.75 58.32 144.72 0.04 54.28 1.65 0.13 sda1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 24.85 0.00 7.92 6.89 0.00 sda2 0.02 10.39 0.15 0.53 0.68 29.14 87.50 14.57 43.75 58.32 172.04 0.04 64.52 1.96 0.13 dm-0 0.00 0.00 0.03 8.02 8.05 1.09 64.15 0.54 32.07 32.62 8.11 0.68 84.82 0.14 0.11 dm-1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 7.73 0.00 7.21 2.22 0.00 dm-2 0.00 0.00 0.00 0.00 0.00 0.03 0.00 0.01 0.00 0.01 7.99 0.00 1.84 0.29 0.00 dm-3 0.00 0.00 0.00 0.00 0.00 0.03 0.00 0.01 0.00 0.01 7.99 0.00 1.77 0.23 0.00 dm-4 0.00 0.00 0.00 0.00 0.00 0.02 0.00 0.01 0.00 0.01 7.99 0.00 1.65 0.26 0.00 dm-5 0.00 0.00 0.12 2.92 3.04 27.97 23.35 13.98 11.68 25.66 16.88 1.04 341.67 0.06 0.02 dm-6 0.00 0.00 0.00 0.00 0.00 0.01 0.00 0.01 0.00 0.01 7.99 0.00 2.17 0.25 0.00 Device: rrqm/s wrqm/s r/s w/s op/s rsec/s wsec/s rkB/s wkB/s kB/s avgrq-sz avgqu-sz await svctm %busy sdb 0.00 1.79 0.00 5.78 5.78 0.00 70.12 0.00 35.06 35.06 12.14 0.02 2.72 2.62 1.51 sdb1 0.00 1.79 0.00 5.78 5.78 0.00 70.12 0.00 35.06 35.06 12.14 0.02 2.72 2.62 1.51 sda 0.00 0.20 0.00 1.39 1.39 0.00 12.75 0.00 6.37 6.37 9.14 0.00 1.29 0.43 0.06 sda1 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 0.00 0.00 sda2 0.00 0.20 0.00 1.39 1.39 0.00 12.75 0.00 6.37 6.37 9.14 0.00 1.29 0.43 0.06 dm-0 0.00 0.00 0.00 1.59 1.59 0.00 12.75 0.00 6.37 6.37 8.00 0.00 1.25 0.38 0.06 dm-1 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 0.00 0.00 dm-2 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 0.00 0.00 dm-3 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 0.00 0.00 dm-4 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 0.00 0.00 dm-5 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 0.00 0.00 dm-6 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 0.00 0.00 ^C #
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:Output example :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$There are 3 Linux add-ons based on psSTAT: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$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 - 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)
LpsSTAT (psSTAT) |
Source: psSTAT for Linux, mode: ref Output example :This STAT should be used if you're looking for a single process activity and go in detail for PID, etc.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 $dim
LPrcLOAD (ProcLOAD) |
Source: psSTAT for Linux, mode: proc Output example :This 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 (!)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 $dim
LUsrLOAD (UserLOAD) |
Source: psSTAT for Linux, mode: user Output example :This 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 (!)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 $dim
LnetLOAD (netLOAD) |
Source: my netLOAD script for Linux Output example :For the STAT-service Wrapper, no need, sit hould work as on any Linux system./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 ^C
<< | [up] | >> |