Tuesday, July 7, 2009
Unix Script(Solaris) to check the system Health
This script is used to check the CPU utilization diskspace etc..
Place this script in ur temp directory /tmp and change the mode of file with exectuable rights and just enter the file name in the # or $ prompt accordingly,This will trigger you the details in an email format if the mail option is enabled or rights is there for the user if not it will display the details in detail as more command is there
#SCRIPT Sound CPU,memory,Disk
echo "VMSTAT Details\n" >>output
vmstat 5 5 >>output
echo "----------------\n" >>output
echo "Disk Space\n" >>output
df -k |awk '{print $5,"\t",$6}' >>output
echo "----------------\n" >>output
echo "High CPU Utilised\n" >>output
ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10 >>output
echo "----------------\n" >>output
echo "Check for CFT\n" >>output
ps -ef|grep {some application related process}>> output
echo "----------------\n" >>output
more output
echo "report " | mailx -s "HEALTH CHECK `date`" xx@yy.com rm output
Subscribe to:
Posts (Atom)