Quick and Dirty Monitoring Tool
Published February 23rd, 2010Recently, we needed a simple cron script to record load average, apache server count, existence of lighthttpd and mysql status in a log file every 10 minutes. So following shell script was born:
#!/bin/sh
httpd_cnt=`ps auxww | grep ‘/home/apache/bin/httpd’ | wc -l`
lighthttpd_cnt=`ps auxww | grep ‘lighthttpd’ | wc -l`
mysql_status=`/usr/bin/mysqladmin -u root -pYOUR_DB_PWD status`
load=`/bin/cat /proc/loadavg`
now=`date “+%m-%d-%Y %H:%M:%S”`
today=`date [...]