[mrtg] monitoring remote CPU and harddrive

zeeshana ahmed zeeshan at worldcall.net.pk
Wed Dec 18 20:41:32 MET 2002

Dear all iam using the follosing parameters to monitor the local machine on which my MRTG is running. iw anmt to monitor some other server too of linux. what emendmends to i need to do in this file to monitor the remote machines.

(TO monitor CPU Usage)

# (multiply as 100 because this will return values in the hundreths ie:4.21)
Target[cou1]:. at localh
ost * 100

MaxBytes[cou1]: 100
YLegend[cou1]: load
ShortLegend[cou1]: load
Legend1[cou1]: CPU Load (x 100)
Legend2[cou1]: .
Legend3[cou1]: Max value per interval on graph
Legend4[cou1]: .
LegendI[cou1]: CPU Load (x 100)
LegendO[cou1]: .
Title[cou1]:  10DEVICE
PageTop[cou1]: <H1>$DEVICE</H1>
Options[cou1]: gauge, nopercent, integer, unknaszero
Colours[cou1]: GREEN#00eb0c,BLUE#0000ff,GRAY#AAAAAA,VIOLET#ff00ff
WithPeak[cou1]: ymw

and following is to monitor the hardirves. what changings should made to monitor remote machine hardrives.

Target[load1]: `/usr/bin/perl /etc/mrtg/df2mrtg.pl /`
AbsMax[load1]: 100
Options[load1]: integer,growright,gauge
#Unscaled[load1]: dwmy
WithPeak[load1]: wym
#Supress[load1: y

MaxBytes[load1]: 100

Title[load1]: Disk Load
PageTop[load1]: <H1>Root '/' Partition Usage</H1>

where df2mrtg.pl script is as follows.

# 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
# 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 "/dev/hda7 \n";

$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";

zeeshan ahmed
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