Graphing Other Objects

MRTG polls and graphs the MIB variables ifInOctets and ifOutOctets by default, but it is possible to poll and graph the values of other objects, in addition to polling different kinds of devices. Let’s first get MRTG collecting input and output octets from a server. To do this, run the following command:

[root][linuxserver] ~/mrtg-2.9.10> cfgmaker public@linuxserver >> \

This is almost identical to the command we ran earlier in the chapter, except for the community string and target[69] (public@linuxserver). We appended the output to the mrtg.cfg file, as opposed to specifying an output file with the - -output option; this lets us add a new host to the existing configuration file, rather than starting a new file. Because the existing file already specifies a working directory, we also omitted the working directory option (- -global 'WorkDir: .. ' ). This cfgmaker command adds a number of lines like the following to the configuration file:

Target[linuxserver]: 2:public@localhost
MaxBytes[linuxserver]: 1250000
Title[linuxserver]: linuxserver(linuxserver): eth0
PageTop[linuxserver]: <H1>Traffic Analysis for eth0
   <TR><TD>Interface:</TD><TD>eth0 (2)</TD></TR>
   <TR><TD>IP:</TD><TD>linuxserver(  )</TD></TR>
   <TR><TD>Max Speed:</TD>
       <TD>1250.0 kBytes/s (ethernetCsmacd)</TD></TR>

These lines tell MRTG how to poll the server’s Ethernet interface. ...

Get Essential SNMP now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.