[mrtg] Re: CPU monitoring for Unix Server

kelsey hudson khudson at tsss.org
Wed Nov 30 23:12:17 MET 2005

Luiz Antonio Oliveira wrote:
> Title[cpu0]: CPU 0 Usage
> MaxBytes[cpu0]: 100
> AbsMax[cpu0]: 1000
> Options[cpu0]: bits
> Target[cpu0]: `/usr/bin/awk '/cpu0 /{print $2+$3; print $2+$3+$4; print
> "quite some time"; print "home"}'</proc/stat`
> PageTop[cpu0]: CPU 0 Usage
> ShortLegend[cpu0]: %x100
> Ylegend[cpu0]: %x100
> LegendI[cpu0]: &nbsp;user:
> LegendO[cpu0]: &nbsp;total:
> Legend1[cpu0]: Time spent in user mode
> Legend2[cpu0]: Time spent in user mode + time spent in system mode
> Legend3[cpu0]: Maximum occurance of time spent in user mode
> Legend4[cpu0]: Maximum occurance of (time spent in user mode + time spent in
> system mode)
> XSize[cpu0]: 350
> YSize[cpu0]: 150

It's worth mentioning that this only works on Linux systems or systems 
that have the /proc/stat file. If you want real CPU statistics on a 
generic UNIX machine download and install Net-SNMP then probe the System 
Stats MIB as follows:

Target[localhost_cpu0]: ssCpuRawUser.0&ssCpuRawUser.0:public at localhost + 
ssCpuRawSystem.0&ssCpuRawSystem.0:public at localhost + 
ssCpuRawNice.0&ssCpuRawNice.0:public at localhost
MaxBytes[localhost_cpu0]: 100
Options[localhost_cpu0]: growright, nopercent, noo
Title[localhost_cpu0]: CPU Utilization
YLegend[localhost_cpu0]: Utilization (%)
Unscaled[localhost_cpu0]: ymwd
ShortLegend[localhost_cpu0]: %
LegendI[localhost_cpu0]: Utilization
Legend1[localhost_cpu0]: Utilization
Legend3[localhost_cpu0]: Max Utilization
PageTop[localhost_cpu0]: <h1>CPU Utilization</h1>

You'll also need:

LoadMIBs: /path/to/SNMPv2-SMI.txt
LoadMIBs: /path/to/UCD-SNMP-MIB.txt

good luck.

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the mrtg mailing list