Re: Script-Help (86 Views)
Reply
Frequent Advisor
Karthick K S
Posts: 85
Registered: ‎08-16-2005
Message 1 of 5 (86 Views)

Script-Help

Help Needed for Script to Monitor System use and capacity
Please use plain text.
Honored Contributor
Muthukumar_5
Posts: 4,030
Registered: ‎06-09-2004
Message 2 of 5 (86 Views)

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!
Please use plain text.
Honored Contributor
RAC_1
Posts: 5,920
Registered: ‎03-21-2002
Message 3 of 5 (86 Views)

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
Please use plain text.
Honored Contributor
Arunvijai_4
Posts: 4,194
Registered: ‎04-07-2005
Message 4 of 5 (86 Views)

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"
Please use plain text.
Honored Contributor
Muthukumar_5
Posts: 4,030
Registered: ‎06-09-2004
Message 5 of 5 (86 Views)

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!
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation