SNMP/Examples/Example 2:Graphing with MRTG

From ImageStream Router Documentation

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

Overview

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="205.159.243.1" 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

Memory

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]: .1.3.6.1.4.1.2021.4.5.0&.1.3.6.1.4.1.2021.4.6.0:public@gw01:
SetEnv[gw01_available_ram]: MRTG_INT_IP="205.159.243.1" 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 .1.3.6.1.4.1.2021.4.5.0
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
Personal tools
Router software releases