[CentOS] Graphing System Load MRTG

Jobst Schmalenbach

jobst at barrett.com.au
Thu Jan 6 05:33:33 UTC 2011


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



More information about the CentOS mailing list