[CentOS] Graphing System Load MRTG

Tue Dec 21 18:30:51 UTC 2010
Alexander Dalloz <ad+lists at uni-x.org>

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

Isn't that a bit overkill?

cut -d"" -f2 /proc/loadavg

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

Alexander