Showing results for 
Search instead for 
Do you mean 

Script-Help

Frequent Advisor

Script-Help

Help Needed for Script to Monitor System use and capacity
4 REPLIES
Honored Contributor 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!
Honored Contributor 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
Honored Contributor 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"
Highlighted
Honored Contributor 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!