[mrtg] CPU utilization

Steve Lindemann steve at marmot.org
Thu Apr 26 16:27:54 CEST 2007


You can monitor pretty much anything.  If you have snmp enabled then all 
you need is the OID, but if not you can script it.  For example, I 
wanted to monitor system load on my email server (also running httpd and 
mrtg).  I found a program called linux_loadavg_mrtg (written in C) on 
the web then in /etc/mrtg/mrtg.cfg I have:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Global Config Options
WorkDir: /var/www/mrtg
Options[_]: growright,unknaszero,withzeroes
WithPeak[_]: wmy
Forks: 10
Interval: 5

######################################################################
# Contact: Steve Lindemann, +1.970.242.3331x16
# Location: Grand Junction, CO
######################################################################
#---------------------------------------------------------------------
### loadavg

Target[loadavg]: `/usr/local/bin/linux_loadavg_mrtg`
MaxBytes[loadavg]: 50
Title[loadavg]: Load Average
PageTop[loadavg]: <H2>Load Average on Email Server</H2>
Options[loadavg]: growright,gauge,absolute,nopercent
YLegend[loadavg]: Load Avgerage
ShortLegend[loadavg]: unit
Legend1[loadavg]: Load Average (1min)
Legend2[loadavg]: n/a
Legend3[loadavg]: Maximal 5 Minute Load Average
Legend4[loadavg]: n/a
LegendI[loadavg]: &nbsp;Value:
LegendO[loadavg]: &nbsp;n/a:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can find the program at
http://oss.oetiker.ch/mrtg/pub/contrib/
and more specifically
http://oss.oetiker.ch/mrtg/pub/contrib/linux_loadavg_mrtg.txt

Google can be so handy at times... 8^)
Hope that helps
--
Steve Lindemann                         __
Network Administrator                  //\\  ASCII Ribbon Campaign
Marmot Library Network, Inc.           \\//  against HTML/RTF email,
   url: http://www.marmot.org           //\\  vCards & M$ attachments
email: mailto:steve at marmot.org
voice: +1.970.242.3331 ext 16
   fax: +1.970.245.7854

Mahesh Bharadwaj wrote:
> Dear all,
> 
> Please let know if we can monitor CPU utilization with MRTG ...do we have a
> doc for that?
> 
> any help would be highly appreciated
> 
> Mahesh
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> mrtg mailing list
> mrtg at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/mrtg



More information about the mrtg mailing list