SNMP/Examples/Example 2:Graphing with MRTG

From ImageStream Router Documentation

< SNMP | Examples
Revision as of 05:30, 12 June 2008 by RichardJune (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



MRTG can generate graphs for many interesting pieces of information available from the router. Any data which can be quantified numerically can be graphed by MRTG, though this page focuses on what information can be gleaned from SNMP. Configuration can go in any file, but commonly /etc/mrtg/mrtg.cfg is the main configuration file. My reference mrtg configuration file provides configuration samples for everything discussed here in a functional setup. The MRTG configuration reference explains every option in use here as well as others not in use.

Network Interfaces

Traffic usage information is the easiest to graph in MRTG. Simply point MRTG to your router and tell it what interface to graph. Replace gw01 with the IP address of your router, and eth0 with the interface you want statistics on.
Target[gw01_eth0]: \eth0:public@gw01:
SetEnv[gw01_eth0]: MRTG_INT_IP="" MRTG_INT_DESCR="eth0"
MaxBytes[gw01_eth0]: 12500000
Title[gw01_eth0]: Traffic Analysis for eth0 -- gw01
PageTop[gw01_eth0]: <h1>Traffic Analysis for eth0 -- gw01</h1>
WithPeak[gw01_eth0]: ymwd


RAM usage graphs provide indicators of when RAM is no longer available to the system. When this happens, an upgrade is in order.
Target[gw01_available_ram]: .
SetEnv[gw01_available_ram]: MRTG_INT_IP="" MRTG_INT_DESCR="available_ram"
#Set this to the amount of RAM in your router
# get the value to put here by doing: snmpwalk  -v2c -c public ROUTER .
MaxBytes[gw01_available_ram]: 515376
Title[gw01_available_ram]: Available RAM -- gw01
PageTop[gw01_available_ram]: <h1>Available RAM -- gw01</h1>
ShortLegend[gw01_available_ram]: B
YLegend[gw01_available_ram]: Available RAM
LegendI[gw01_available_ram]: Total RAM
LegendO[gw01_available_ram]: Free RAM
Options[gw01_available_ram]: gauge,growright
kMG[gw01_available_ram]: k,M,G,T,P
kilo[gw01_available_ram]: 1024

CPU Usage

CPU usage graphs track how much strain your router is under.
# ImageStream routers report cpu load * 10, so to properly graph it,
# we must shift the decimal place back to the right
Target[gw01_cpu]: (ssCpuRawUser.0&ssCpuRawUser.0:public@\
RouterUptime[gw01_cpu]: public@
MaxBytes[gw01_cpu]: 100
Title[gw01_cpu]: CPU Load
PageTop[gw01_cpu]: <H1>Active CPU Load %</H1>
#Unscaled[gw01_cpu]: ymwd
ShortLegend[gw01_cpu]: %
YLegend[gw01_cpu]: CPU Utilization
Legend1[gw01_cpu]: Active CPU in % (Load)
LegendI[gw01_cpu]: Active
Options[gw01_cpu]: growright,nopercent,noo
Personal tools
Router software releases