Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

iostat - monitoring disk activity

Status
Not open for further replies.

ereshatezer

Technical User
Oct 14, 2004
48
0
0
HU
Hello,

I need an urgent help. I should write a script which monitors disk activity frequently and creat a mail when it is over 90%.

Could anyone help now?

Thank you in advance.
 
try nmon - free tool....




The nmon tool is designed for AIX and IBM eServer pSeries performance specialists to use for analyzing AIX performance data, including the following:

CPU utilisation
Memory use
Kernel statistics and run queue information
Disks I/O rates, transfers, and read/write ratios
Free space on file systems
Disk adapters
Network I/O rates, transfers, and read/write ratios
Paging space and paging rates
CPU and AIX specification
Top processors
IBM HTTP web cache
User defined disk groups
Machine details and resources
Async I/O
Workload Manager
ESS disks
NFS
Dynamic LPAR changes
 
I'm with ogniemi, I use nmon for almost all of my servers, but I kick it off a midnight and then dump the data to a mysql database. Then of course use perl and gnuplot to make purty graphs for management.

nmon rocks!

 
Thank you. I know nmon.
I meant to a shell script which monitors my disk with iostat for example.....

something like this:
----------------------
#! /bin/ksh

TEMPFILE=blablabla.txt
TEMPFILE2=blablabla2.txt
TEMPFILE3=blablabla3.txt
DAY=`date +"%D %T %Z"`

iostat -d 2 10|grep hdisk|awk '{print $1 " "$2"%"}'> $TEMPFILE

cat $TEMPFILE|sed s/%//g|awk ' $2 > 90 { print $1,".........." $2"%"}' > $TEMPFILE2

ls -ltr $TEMPFILE2|awk '{print$5}'> $TEMPFILE3

if [ $(cat $TEMPFILE3 |head -1) -ne 0 ]
then
mail -s "*Disk activity more than 90% on `hostname` at: $DAY *" bla.bla@blabla.com < $TEMPFILE2
fi

rm $TEMPFILE
rm $TEMPFILE2
rm $TEMPFILE3
---------------------

I wrote it and scheduled in the crontab.....

I know it is very basic, but it works fine. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top