[mrtg] Monitoring Harddrives!!!

alain.aube at hrdc-drhc.gc.ca alain.aube at hrdc-drhc.gc.ca
Tue Feb 1 20:19:49 MET 2000


Hi all,

	This is more of a functionality question.  I have been trying to monitor 
Hard drives on a HP-UX 10.20 machine using MRTG.  I got the idea after 
checking this web site: http://moria.org/~bvi/utils/mrtg/ , in which Barry 
Irwin did it on FREEBSD.  I downloaded the config file and source code he 
used, however, I can't seem to get it working, I suspect it is because he 
wrote it for FREEBSD, and not for HP-UX.  Is anyone monitoring hard drives on 
HP-UX out there and if you have a little time, could you maile me  the script 
and sample config you are using?  I tried making my own script, but I don't 
know much PERL, and I was very ineffective.  I have pasted my config and the 
script that I downloaded.  Thanks in advance if anyone can help.


SCRIPT:

#!/usr/local/bin/perl 
# Copywrite: 
#  This Work is copywrite Barry Irwin , Moria Research 1999
#  All Rights Reserved
#
# Permission is given for derivitive works to be freely distributed provided
# Original Author is acknowledged, and this copywrite remains intact
#
# DISCLAIMER: Your milage may vary. NO WARRANTY provided. USE, Enjoy, but if
#   it blows up , or suchlike, badluck. Author Assumes NO responsibility for
#   this work
#VERSION=0.1
# Outputs the %used for a disk partition. parameter can be either disk slice
# name (/dev/da2s1f) or symbolic name ( eg /var)
# probably a good idea to set AbsMax to somethign like 115( since file
# systems can get >100% full.  guage type is also recomended

#root at rucus:/home/system/quark/www# df -k /var | tail -1
#/dev/da2s1f     595383   263439   284314    48%    /var

if ( $ARGV[0] eq "" )
{
  print "Usage: $0 <disk name or mount point>\n";
  exit;
}

#uptimestuff
 $tmp =`uptime`;
 $tmp =~ s/,//g;
 @utime = split /\s/, $tmp;

$percent = 0;
foreach $_ (`df -k | grep -v "Filesystem"`)  # grab df table
{
  ($device, $size, $used, $free, $percent, $mount) = split(/\s+/);
  if ( $ARGV[0] eq $device || $ARGV[0] eq $mount) 
        { chop($percent);  last;}  #bail out
}

print "$percent\n";
print "$percent\n";
print "$utime[3] days $utime[5] hours\n";
print "\n";


CONFIG:

Workdir: /someworkdir

Target[var]: 'somedir/diskspace.pl /var'
MaxBytes[var]: 100
AbsMax[var]: 115
Options[var]: gauge, integer,noinfo
Unscaled[var]: dwmy
#WithPeak[var]: wym
Suppress[var]: y
YLegend[var]: % used
ShortLegend[var]: % used
Legend1[var]: Diskspace Used
LegendI[var]: Disk Used
Title[var]:  /var Disk Stats
PageTop[var]: <H1>Disk Status : /var </H1>


Cheers,
Alain Aubé
IT COMMUNICATIONS
Network Planning and Analysis
Tel: (819) 953-9398
Fax: (819) 997-0460
alain.aube at hrdc-drhc.gc.ca

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:mrtg-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/mrtg



More information about the mrtg mailing list