[CentOS] Graphing System Load MRTG

Matt lm7812 at gmail.com
Tue Dec 21 17:05:27 UTC 2010


> I check system load like so:
>
> [root at server cron.daily]# w
>  10:07:33 up 4 days, 15:01,  2 users,  load average: 4.22, 3.17, 3.09
>
> I would like to to graph the 3.17 5 minute average with MRTG.  Anyone
> know of some examples of doing this?

Wrote this simple perl script:

#!/usr/bin/perl -w

my $uptime = `uptime`;
my $load = ( split /load/, $uptime )[1];
$load = ( split /,/, $load )[1];
chomp $load;
print "$load\n";

It spits out 5 minute load average.  Would like to just have MRTG
graph the result every 5 minutes.



More information about the CentOS mailing list