1752664 Members
5762 Online
108788 Solutions
New Discussion юеВ

Re: Script-Help

 
Karthick K S
Frequent Advisor

Script-Help

Help Needed for Script to Monitor System use and capacity
4 REPLIES 4
Muthukumar_5
Honored Contributor

Re: Script-Help

You have use bdf to get disk resource usage, vmstat to get virtual memory and iostat as well.

#!/bin/ksh

while [ 1 ]
do
date >> /tmp/systemusage.log
bdf >> /tmp/systemusage.log
vmstat >> /tmp/systemusage.log

# Sleep for 5 minutes
sleep 300
done

exit 0

# Track report as,
tail -f /tmp/systemusage.log

hth.
Easy to suggest when don't know about the problem!
RAC_1
Honored Contributor

Re: Script-Help

I run this through cron.
#/usr/bin/ksh
bdf | grep -Ee "8[5-9]%|9[0-9]%|100%" |grep -v ":" >> /tmp/bdf.status
status=`/usr/bin/grep [/] /tmp/bdf.status|wc -l`
if [ $status -gt 0 ] 2>/dev/null;then
/usr/bin/mailx -s "BDF status(above 85 %) of servers as on `date`"
sysadm < /tmp/bdf.status
fi
There is no substitute to HARDWORK
Arunvijai_4
Honored Contributor

Re: Script-Help

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=891675

Get SEP's script from the above given thread..

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: Script-Help

To give more effective solution,

a) Which system resource you want to monitor?
b) Is it runnable by schedular or background process?
c) Reporting by mail / log file generation?

hth.

PS: check your profile. It is very week on assigning points :)

Easy to suggest when don't know about the problem!