MRTG/Routers2: Adding a Cisco Router

This post shortly explains the process of adding a Cisco router into the monitoring system “MRTG with Routers2” as I explained it here. It gives an example on how SNMP is activated on the router and how the *.cfg file for MRTG/Routers2 is created with the additional values for CPU and memory usage.

SNMP w/ Access-List

It is really important to not only activate SNMP on the Cisco router, but to use an ACL that allows only a few hosts (or networks) to query it via SNMP. So, the first step is to create the appropriate ACL, such as:

The SNMP commands then look like the following. The first command sets the community string with a read-only (RO) policy and allows only connections from an IP address that passed access-list 3.

Basic *.cfg Config File

The first step is to generate the basic *.cfg file that lists all interfaces from the router:

Then, all “Global Config Options” can be deleted. This is because they are already specified in the basic mrtg.cfg file (if it is installed due to my tutorial in the previous post).

An icon that shows the common router symbol in the Routers2 overview can be set with: routers.cgi*Icon: router3-sm.gif . And the nice GryphStyle “mirror” is globally set for the whole config file (= all interfaces) with: routers.cgi*GraphStyle[_]: mirror . This produces interface graphs that look like that:


Finally, it should be verified that the MaxBytes values for all interfaces are correct.

Additional Values to Monitor

(Note that cfgmaker can also use templates with the option  --host-template=cisco.htp  in order to generate the CPU and memory graphs. Cisco templates can be found here. However, I am specifying them manually.)

CPU Usage

The CPU usage can be gathered by MRTG with the following lines. I like the CPU and memory graphs to be “unscaled” in which the y-axis always displays the range from 0..100 % and therefore gives a complete view. Of course, the file description [foobar] must be set correctly as well as the COMMUNITY string and the IP address:

This gives a CPU graph that looks like the following. Note that my CPU usage is not that high, so there is not much color here. 😉


Memory Usage

In the same way as the CPU, the memory usage can be captured by MRTG. It is only mandatory to specify the correct MaxBytes value for the memory:

The graph will look like that:


That’s it. Go for it! 😉

Leave a Reply

Your email address will not be published. Required fields are marked *