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?
On 12/21/2010 10:09 AM, Matt wrote:> 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?Where you should start depends on how much else you would like to monitor. Cacti is probably the easiest thing to set up for a small number of machines and not unreasonable for a single host monitoring itself. I like OpenNMS but it is overkill for a small setup. -- Les Mikesell lesmikesell at gmail.com
lhecking at users.sourceforge.net
2010-Dec-21 16:41 UTC
[CentOS] Graphing System Load MRTG
Matt writes:> 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?$ uptime 16:40:45 up 7 days, 54 min, 20 users, load average: 0.17, 0.17, 0.12 $ snmpget -c community -v2c localhost UCD-SNMP-MIB::laLoadInt.1 UCD-SNMP-MIB::laLoadInt.1 = INTEGER: 14 $ snmpget -c community -v2c localhost UCD-SNMP-MIB::laLoadInt.2 UCD-SNMP-MIB::laLoadInt.2 = INTEGER: 17 $ snmpget -c community -v2c localhost UCD-SNMP-MIB::laLoadInt.3 UCD-SNMP-MIB::laLoadInt.3 = INTEGER: 11 $ --------------------------------------------------------------- This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message. ---------------------------------------------------------------
> 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.
On 12/21/2010 11:09 AM, Matt wrote:> 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?The easy way or the hard way? The easy way: You take the snmpget command someone else previously provided, convert it to the oid, add it to the appropriate place in your mrtg.cfg (If I recall correctly). The hard way: use one of the shell scripts provided, cat /proc/loadavg, or your perl script to grab the values, figure out how to stuff them into rrdtool, then figure out how to convince mrtg to render the resulting rrd files. Really, the best way is to install cacti, and be done with it, as others have suggested. -- -- John E. Jasen (jjasen at realityfailure.org) -- "Deserve Victory." -- Terry Goodkind, Naked Empire
Make yourself a script, include this: #!/bin/sh # first the load 5 and 15 min avg # multiply * 100 to avoid floats # it helps if mrtg "period" is a multiple of 5 mins uptime | sed -e 's/^.*average.*: \(.*\)$/\1/' -e 's/ //g' | awk -F, '{ printf("%.0f\n",$2*100); printf("%.0f\n",$3*100) }' # the uptime uptime | sed 's/.*\sup\s\(.*\),\s*.*user.*$/\1/' # my name uname -n than for mrtg (in the mrtg.cfg file): Target[load]: `THE_NAME_AND_PATH_OF_THE_SCRIPT_ABOVE` Options[load]: integer,gauge Title[load]: System load Xsize[load]: 600 Ysize[load]: 200 Ytics[load]: 10 MaxBytes[load]: 3000 PageTop[load]: <H1>Load Average</H1> YLegend[load]: Load Average ShortLegend[load]: LegendO[load]: 5 minute average LegendI[load]: 15 minute stagger jobst On Tue, Dec 21, 2010 at 10:09:30AM -0600, Matt (lm7812 at gmail.com) wrote:> 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? > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos-- Sometimes, the sharpest sword is not enough, but usually...it is. | |0| | Jobst Schmalenbach, jobst at barrett.com.au, General Manager | | |0| Barrett Consulting Group P/L & The Meditation Room P/L |0|0|0| +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia