SNMP/Examples/Example 2:Graphing with MRTG
From ImageStream Router Documentation
RichardJune (Talk | contribs) (New page: ==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 thi...) |
RichardJune (Talk | contribs) |
||
Line 29: | Line 29: | ||
kMG[gw01_available_ram]: k,M,G,T,P | kMG[gw01_available_ram]: k,M,G,T,P | ||
kilo[gw01_available_ram]: 1024 | kilo[gw01_available_ram]: 1024 | ||
+ | |||
+ | ==CPU Usage== | ||
+ | :[http://www.imagestream.com/~rjune/mrtg/gw01/gw01_cpu.html 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@205.159.243.1\ | ||
+ | +ssCpuRawSystem.0&ssCpuRawSystem.0:public@205.159.243.1\ | ||
+ | +ssCpuRawNice.0&ssCpuRawNice.0:public@205.159.243.1)/10 | ||
+ | RouterUptime[gw01_cpu]: public@205.159.243.1 | ||
+ | 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) | ||
+ | Legend2[gw01_cpu]: | ||
+ | Legend3[gw01_cpu]: | ||
+ | Legend4[gw01_cpu]: | ||
+ | LegendI[gw01_cpu]: Active | ||
+ | LegendO[gw01_cpu]: | ||
+ | Options[gw01_cpu]: growright,nopercent,noo |
Latest revision as of 05:30, 12 June 2008
Contents |
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
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@205.159.243.1\ +ssCpuRawSystem.0&ssCpuRawSystem.0:public@205.159.243.1\ +ssCpuRawNice.0&ssCpuRawNice.0:public@205.159.243.1)/10 RouterUptime[gw01_cpu]: public@205.159.243.1 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) Legend2[gw01_cpu]: Legend3[gw01_cpu]: Legend4[gw01_cpu]: LegendI[gw01_cpu]: Active LegendO[gw01_cpu]: Options[gw01_cpu]: growright,nopercent,noo