[CentOS] Graphing System Load MRTG

Matt lm7812 at gmail.com
Tue Dec 21 22:55:41 UTC 2010


> Cacti is in the epel repository, so if you have that configured it is
> just 'yum install cacti' and you are pretty much done.

This box is CentOS 4 and has some web hosting software on it.  Due to
exclusions its not that easy. ;-(

I manged to make this work with just plain MRTG which was on it already.

/home/../domains/../public_html/systemload/mrtg.cfg

WorkDir: /home/../domains/../public_html/systemload/
Title[index]: System Load
PageTop[index]: <H1>Load</H1>
Target[index]: `/scripts/sysload.pl`
MaxBytes[index]: 300
Options[index]: growright,unknaszero,nopercent,gauge,noinfo
LegendI[index]: Load:
LegendO[index]:
YLegend[index]: Load
XSize[index]: 600
YSize[index]: 150

/scripts/sysload.pl

#!/usr/bin/perl

my $load = `cut -d" " -f2 /proc/loadavg`;
chomp $load;
print "$load\n";
print "$load\n";

May not be perfect but it works.  May needed to be tweaked a bit yet too.



More information about the CentOS mailing list