<< | [up] | >> |
dim_STAT User's Guide. by Dimitri |
EasySTAT |
Since dim_STAT version 7.0, the EasySTAT script makes part of the STAT-service for Solaris. EasySTAT is designed to simplify the combination of collecting STATs on "very remote" or "highly secured" hosts with BatchLOAD. In a few words all you need to do is:EasySTAT Usage (v.1.9)
- install STAT-service on the host
- run EasySTAT
- backup the output directory
- restore the directory on your dim_STAT server
- execute the "LoadDATA.sh" script (from the directory)
$ /etc/STATsrv/bin/EasySTAT.sh OutDIR IntervalSec NbHours [Title [Hostname [DBname [Batch [Log]]]]]
options: OutDIR - Output directory for stat collects (def: /var/tmp) Interval - measurement interval for stat commands in sec. (default: 15) NbHours - execution duration in hours (default: 8 hours) Title - title to use during BatchLOAD processing Hostname - hostname to use during BatchLOAD processing DBname - database name to use during BatchLOAD processing Batch - full path to BatchLOAD binary on your server (default: /apps/ADMIN/BatchLOAD) Log - log file name (if given, all processing output is forwarded into this file) NOTE: may also be enabled via LOG environment variable (see EasySTAT.sh for details)
EasySTAT Config By default script collects 5 main stats:Additional Options
- VMSTAT (runqueue, memory, CPU)
- MPSTAT (per CPU usage, interrupts, mutex, etc.)
- IOSTAT-xn (per disk I/O stats)
- netLOAD (network per interface stats +nocanput)
- ProcLOAD (processes stats summarized by process name)
- you may add any other Add-On commands by editing /etc/STATsrv/bin/EasySTAT.sh
NOTE : since v.8.3-1 both COMPRESS and TIMER options are included within EasySTAT.sh script by default !!! - it's preferable to have compressing and timestamps out of the box to avoid any space overflow as well a faster text file analyzing. However be aware you have to edit EasySTAT.sh file to disable them (but at least you know what you're doing :-))
- To reduce disk space usage, since v.8.3 if environment variable COMPRESS is set, EasySTAT will automatically call it to compress every finished output file:
Don't forget to "uncompress" output files before start any load process! :-)# COMPRESS=gzip /etc/STATsrv/bin/EasySTAT.sh ...
- Since v.8.3 if TIMER environment variable is set to "yes", EasySTAT will automatically timestamp all collecting data within its output files:
All timestamp tags are transparent for BatchLOAD and serving only to simplify human reading. Also, if during collecting there were some output freezes due high system load or other - Timer will automatically take care about it and add a special time sync tag to synchronize data when loading to the database..# TIMER=yes /etc/STATsrv/bin/EasySTAT.sh ...
Example |
Collect STATs :Load Collect then Analyze :On the 'Very Remote' Host:
==> copy STATsrv.pkg somewhere (ex: /tmp) and install: # pkgadd -d /tmp/STATsrv.pkg
==> create data dir # mkdir /var/tmp/Easy # cd /var/tmp/Easy
==> collect data every 30sec. for 24 hours # nohup /etc/STATsrv/bin/EasySTAT.sh /var/tmp/Easy 30 24 & ...
==> archive+compress collected data # cd /var/tmp # tar cf - Easy | compress > /tmp/Easy.tar.Z
==> copy /tmp/Easy.tar.Z into your laptop/flash/CD/etc. # ...up to you :)
==> remove all staff if no more need # rm /tmp/Easy.tar.Z; rm -rf /var/tmp/Easy; pkgrm STATsrvOn your local dim_STAT server:
==> restore Easy.tar.Z somewhere (ex: /home/tmp): # cd /home/tmp # uncompress < Easy.tarZ | tar xvf - # cd Easy/* # gunzip *.gz ## (if compressions was used)
==> edit if you need to modify default settings (db name for ex.) # vi LoadDATA.sh
==> load all data into your database (don't forget to create this database before!!!) # sh LoadDATA.sh
==> Analyze data via web interface & enjoy :))
EasySTAT Hints |
Few notes about EasySTAT hints (some were introduced with 8.3-1 version):
- Per hour files -- to avoid having collected data out of sync with a real time, EasySTAT is restarting each stat program every hour; so every hour you have a new file for all stats, and it's by defaulf, and was designed from the beginning
- Run forever -- to run EasySTAT for undetermined period just give a "0" for a number of hours - also, in this case EasySTAT will not create a new working directory for incoming stats, but (re)use the given directory name
- Inittab -- you may use /etc/inittab to make your EasySTAT collects permanent - if for any reasons collects were stopped (or killed) - init process will restart them automatically! - all you need is just to add a such kind of line at into your /etc/inittab:
it'll collect stats forever with 15sec time interval, and keep data in "/var/tmp/stats" directory; to force rescan of modified /etc/inittab:dim:3:respawn:/etc/STATsrv/bin/EasySTAT.sh /var/tmp/stats 15 0 2>&1 >>/var/tmp/stats.logto disable collecting just replace "respawn" by "off" and then "init q" again :-)# init q
the advantage of a such solution is that it'll work on any UNIX platform ;-)
- PID file -- EasySTAT always creating a pid file within its working directory: .EasySTAT.pid
- Stopping -- at any time you need to stop EasySTAT gracefully - just send a TERM or INT signal to its PID:
# kill `cat .EasySTAT.pid`- LoadDATA.sh file(s) -- on USR1 signal EasySTAT backing up its current LoadDATA.sh file into a LoadDATA.sh-saved-... and then creating a new LoadDATA.sh for all next incoming collects (until next SIGUSR1 ;-)) - it may be helpful if you're collecting your stats permanently but want to be able to upload them into your dim_STAT database by time periods, etc...
<< | [up] | >> |