[mrtg] Re: monitor disk IO

John Adams jadams007 at earthlink.net
Thu Sep 30 21:12:41 MEST 2004


Although my script is not as fancy as some others, it seems to work.

disk.io.sh
****************************************************************
#!/bin/sh

UPTIME="/usr/bin/uptime"
HOSTNAME="/bin/hostname"
IOSTAT="/usr/local/bin/iostat"

D0=`$IOSTAT -dk | grep hdisk0 | gawk '{print $2}' | cut -d "." -f 1`
D2=`$IOSTAT -dk | grep hdisk2 | gawk '{print $2}' | cut -d "." -f 1`

echo $D0
echo $D2
$UPTIME | awk '{ print $3, $4, $5 }'
$HOSTNAME
****************************************************************

My mrtg config file.  Please note that this uses php so I can use  
templates.
Feel free to disreguard the pagetop informtion. or not..

disk.io.cfg
*****************************************************************
#
### Hard Disk Transactions Per Second
#
Target[disk.io]: `/home/mrtg/cfg/disk.io.sh`
MaxBytes[disk.io]: 500
LegendI[disk.io]:  Disk0
LegendO[disk.io]:  Disk2
Options[disk.io]: gauge, nopercent, noarrow, nolegend, nobanner, noinfo
Ylegend[disk.io]: TPS
ShortLegend[disk.io]: IO/Sec    
Title[disk.io]:
PageTop[disk.io]: <td style="background:#B5BEFF">
   <H1>Disk Transactions per Second -- qube3.highdesertnetworks.com</H1>
  <b>
  <ul>
  <li>The dark blue line represents the number of transactions per  
second for Dis
k0.</li>
  <li>The light blue represents the number of transactions per second  
for Disk2.<
/li>
  </ul>
************************************************************************ 
*****************
Sample output can be viewed at http://monitor.highdesertnetworks.com

Cheers,
    John


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list