Mpstat.sh
Revision as of 13:54, 3 March 2015 by PeterHarding (talk | contribs)
Automated mpstat Collector
#!/bin/sh # #-------------------------------------------------------------------------- PERIOD=720 # Minutes DELAY=60 # Seconds #-------------------------------------------------------------------------- HOST=`hostname | sed 's/\..*//'` SECONDS=`expr $PERIOD '*' 60` CNT=`expr $SECONDS '/' $DELAY` TS_FILENAME=`date '+%Y%m%d_%H%M'` TS_START=`date "+%Y-%m-%d %H:%M:%S"` LOG="${HOST}_${TS_FILENAME}.mpstat" #-------------------------------------------------------------------------- cd /tmp echo "==> Count: $CNT Delay: $DELAY" > $LOG echo "==> Start: $TS_START" >> $LOG date >> $LOG mpstat $DELAY $CNT >> $LOG & #--------------------------------------------------------------------------