I check system load like so:
[root@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@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.
I check system load like so:
[root@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.
I already have MRTG installed and am somewhat familiar with it. Graph interfaces with it. I was thinking an MRTG config and perhaps a shell script for it to call.
On 12/21/2010 10:25 AM, Matt wrote:
I check system load like so:
[root@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.
I already have MRTG installed and am somewhat familiar with it. Graph interfaces with it. I was thinking an MRTG config and perhaps a shell script for it to call.
You can do that - but if you install cacti it is already set up with the web interface to view it and a framework to add other things. You do need to set up snmpd if you haven't already - although it has been a while since I used cacti - it might have something special for localhost collection.
Matt writes:
I check system load like so:
[root@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@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.
I check system load like so:
[root@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
On 12/21/2010 11:09 AM, Matt wrote:
I check system load like so:
[root@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.
On 12/21/2010 12:41 PM, John Jasen wrote:
On 12/21/2010 11:09 AM, Matt wrote:
I check system load like so:
[root@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.
Cacti is in the epel repository, so if you have that configured it is just 'yum install cacti' and you are pretty much done.
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.
On 12/21/2010 4:55 PM, Matt wrote:
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. ;-(
Typically what you do with cacti is install it on a different machine that has network snmp access to the one(s) you want to monitor.
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@gmail.com) wrote:
I check system load like so:
[root@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@centos.org http://lists.centos.org/mailman/listinfo/centos
On 01/05/2011 09:33 PM, Jobst Schmalenbach wrote:
On Tue, Dec 21, 2010 at 10:09:30AM -0600, Matt (lm7812@gmail.com) wrote:
I check system load like so:
[root@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?
Make yourself a script, include this:
[...]
That is doing it the hard way. Use scripts only if there isn't an OID for what you want.
Target[hostname_load]: laLoadInt.2&laLoadInt.2:community@host:::::2 RouterUptime[hostname_load]: community@host:::::2 MaxBytes[hostname_load]: 30000 Title[hostname_load]: System Load Factor[hostname_load]: 0.01 YTicsFactor[hostname_load]: 0.01 YLegend[hostname_load]: System Load Legend1[hostname_load]: Load Legend2[hostname_load]: Legend3[hostname_load]: Legend4[hostname_load]: LegendI[hostname_load]: Load LegendO[hostname_load]: ShortLegend[hostname_load]: load Options[hostname_load]: gauge,growright,nopercent Directory[hostname_load]: hostname
Make sure you load the correct MIB otherwise you might have to use the OID instead of the symbolic name.
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
I understand that, but here are some points why I chose my post:
1: not sure about the persons knowledge re snmp 2: dont know the guys hardware and packages installed 3: seeing uptime and uname explains other parts of the MRTG system, i.e. required return values of the scripts 4: portabilty 5: most of the time server are cruising below their capacity, adding a few more cycles because calling scripts etc does not really matter
Jobst
On Thu, Jan 06, 2011 at 04:58:50AM -0800, Benjamin Franz (jfranz@freerun.com) wrote:
On 01/05/2011 09:33 PM, Jobst Schmalenbach wrote:
On Tue, Dec 21, 2010 at 10:09:30AM -0600, Matt (lm7812@gmail.com) wrote:
I check system load like so:
[root@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?
Make yourself a script, include this:
[...]
That is doing it the hard way. Use scripts only if there isn't an OID for what you want.
Target[hostname_load]: laLoadInt.2&laLoadInt.2:community@host:::::2 RouterUptime[hostname_load]: community@host:::::2 MaxBytes[hostname_load]: 30000 Title[hostname_load]: System Load Factor[hostname_load]: 0.01 YTicsFactor[hostname_load]: 0.01 YLegend[hostname_load]: System Load Legend1[hostname_load]: Load Legend2[hostname_load]: Legend3[hostname_load]: Legend4[hostname_load]: LegendI[hostname_load]: Load LegendO[hostname_load]: ShortLegend[hostname_load]: load Options[hostname_load]: gauge,growright,nopercent Directory[hostname_load]: hostname
Make sure you load the correct MIB otherwise you might have to use the OID instead of the symbolic name.
LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
-- Benjamin Franz _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos