[mrtg] How to monitor various Router Info

Kevin Pham sentiblue at sentiblue.net
Fri Apr 18 03:06:28 CEST 2008

Hello you guys out there... I need help and hope someone will be available

Here's what I got:

Router: Cisco ASA5505 currently reporting traffic utilization to management
station. Both outside and inside being monitored very well

Management Station: SunFire X4100 running on CentOS5 with latest and
greatest fixes & patches

SNMP running on the management station itself and reporting to itself CPU,
disk, RAM, eth0, etc...

I've also got a SRW48G4 Linksys switch reporting its traffic utilization to
the same management station

The steps that I've done to get the above are

cfgmaker --global 'WorkDir: /home/mrtg' --global 'Options[_]:
bits,growright' --output /home/mrtg/cfg/asa.cfg cup at
cfgmaker --global 'WorkDir: /home/mrtg' --global 'Options[_]:
bits,growright' --output /home/mrtg/cfg/sw-lan.cfg cup at
cfgmaker --global 'WorkDir: /home/mrtg' --global 'Options[_]:
bits,growright' --output /home/mrtg/cfg/server-traffic.cfg
cup at

indexmaker --output=/home/mrtg/index.html /home/mrtg/cfg/asa.cfg
/home/mrtg/cfg/sw-lan.cfg /home/mrtg/cfg/server-traffic.cfg

The /home/mrtg/server-stats.cfg file is custom... not created by cfgmaker.

Content of that cfg file is here
workdir: /home/mrtg/

# CPU Monitoring
# (Scaled so that the sum of all three values doesn't exceed 100)

Target[server.cpu]:ssCpuRawUser.0&ssCpuRawUser.0:cup at localhost +
ssCpuRawSystem.0&ssCpuRawSystem.0:cup at localhost +
ssCpuRawNice.0&ssCpuRawNice.0:cup at localhost
Title[server.cpu]: Server CPU Load
PageTop[server.cpu]: <H1>CPU Load - System, User and Nice Processes</H1>
MaxBytes[server.cpu]: 100
ShortLegend[server.cpu]: %
YLegend[server.cpu]: CPU Utilization
Legend1[server.cpu]: Current CPU percentage load
LegendI[server.cpu]: Used
Options[server.cpu]: growright,nopercent
Unscaled[server.cpu]: ymwd

# Memory Monitoring (Total Versus Available Memory)

Target[server.memory]: memAvailReal.0&memTotalReal.0:cup at localhost
Title[server.memory]: Free Memory
PageTop[server.memory]: <H1>Free Memory</H1>
MaxBytes[server.memory]: 100000000000
ShortLegend[server.memory]: B
YLegend[server.memory]: Bytes
LegendI[server.memory]: Free
LegendO[server.memory]: Total
Legend1[server.memory]: Free memory, not including swap, in bytes
Legend2[server.memory]: Total memory
Options[server.memory]: gauge,growright,nopercent
kMG[server.memory]: k,M,G,T,P,X

# Memory Monitoring (Percentage usage)
Title[server.mempercent]: Percentage Free Memory
PageTop[server.mempercent]: <H1>Percentage Free Memory</H1>
Target[server.mempercent]: ( memAvailReal.0&memAvailReal.0:cup at localhost ) *
100 / ( memTotalReal.0&memTotalReal.0:cup at localhost )
options[server.mempercent]: growright,gauge,transparent,nopercent
Unscaled[server.mempercent]: ymwd
MaxBytes[server.mempercent]: 100
YLegend[server.mempercent]: Memory %
ShortLegend[server.mempercent]: Percent
LegendI[server.mempercent]: Free
LegendO[server.mempercent]: Free
Legend1[server.mempercent]: Percentage Free Memory
Legend2[server.mempercent]: Percentage Free Memory

# New TCP Connection Monitoring (per minute)

Target[server.newconns]: tcpPassiveOpens.0&tcpActiveOpens.0:cup at localhost
Title[server.newconns]: Newly Created TCP Connections
PageTop[server.newconns]: <H1>New TCP Connections</H1>
MaxBytes[server.newconns]: 10000000000
ShortLegend[server.newconns]: c/s
YLegend[server.newconns]: Conns / Min
LegendI[server.newconns]: In
LegendO[server.newconns]: Out
Legend1[server.newconns]: New inbound connections
Legend2[server.newconns]: New outbound connections
Options[server.newconns]: growright,nopercent,perminute

# Established TCP Connections

Target[server.estabcons]: tcpCurrEstab.0&tcpCurrEstab.0:cup at localhost
Title[server.estabcons]: Currently Established TCP Connections
PageTop[server.estabcons]: <H1>Established TCP Connections</H1>
MaxBytes[server.estabcons]: 10000000000
YLegend[server.estabcons]: Connections
LegendI[server.estabcons]: In
Legend1[server.estabcons]: Established connections
Options[server.estabcons]: growright,nopercent,gauge

# Disk Usage Monitoring

#Target[server.disk]: dskPercent.1&dskPercent.2:cup at localhost
#Title[server.disk]: Disk Partition Usage
#PageTop[server.disk]: <H1>Disk Partition Usage /home and /var</H1>
#MaxBytes[server.disk]: 100
#ShortLegend[server.disk]: %
#YLegend[server.disk]: Utilization
#LegendI[server.disk]: /home
#LegendO[server.disk]: /var
#Options[server.disk]: gauge,growright,nopercent
#Unscaled[server.disk]: ymwd


Notice that I commented out the last section because when I execute the
graph plotting... it generates the following error:
[root at server ~]# env LANG=C /usr/bin/mrtg /home/mrtg/cfg/server-stats.cfg
SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 2 (OID:
SNMPv1_Session (remote host: "localhost" [].161)
                  community: "cup"
                 request ID: 194740009
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at /usr/bin/../lib64/mrtg2/SNMP_util.pm line 490
SNMPGET Problem for dskPercent.1 dskPercent.2 sysUptime sysName on
cup at localhost::::::v4only
 at /usr/bin/mrtg line 2035
Thursday, 17 April 2008 at 18:02: ERROR: Target[server.disk][_IN_] '
$target->[8]{$mode} ' did not eval into defined data
Thursday, 17 April 2008 at 18:02: ERROR: Target[server.disk][_OUT_] '
$target->[8]{$mode} ' did not eval into defined data

I'm quite fine with that right now... I'm sure I can find a way to fix it...

What I'd like to ask is how do I monitor the Router's Memory, CPU
utilization, errors, warnings, etc...

What I'm looking for is a way to run cfgmaker... but if this has to be a
custom cfg file... would you guys show me an example cfg? Thanks! I dont
seem to know any OID for the ASA5505.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20080417/88f95f7e/attachment-0001.html 

More information about the mrtg mailing list