OBTAIN SYSTEM INFORMATION WITH MRTG

The Multi Router Traffic Grapher (MRTG) is a useful tool for gathering statistics about a given system or network appliance. Originally, MRTG was designed to graph network throughput on devices such as firewalls and routers, which made use of the Simple Network Management Protocol (SNMP), so that it could gather statistical information.

More recently, however, MRTG has become a comprehensive analytical tool for obtaining all sorts of information. Used with a tool such as ucd-snmp, MRTG can obtain traffic analysis information of your Linux workstations or servers. Using other plug-ins and tools, MRTG can obtain information on MTA throughput, queue sizes, CPU usage of the system in question, disk analysis, etc.

MRTG uses HTML files for output, which is ideal for remote servers, as you can get an overview of what the server is doing remotely. To configure MRTG to get traffic analysis information, the simplest task that MRTG does, you would use the cfgmaker tool like this:

# cfgmaker --global 'WorkDir: /var/www/html/mrtg'

--global 'Options[_]: bit,growright' --output /etc/mrtg/mrtg.cfg

10.0.1.28

This tells MRTG to write the HTML files to /var/www/html/mrtg with options for the SNMP support, to output its configuration file to /etc/mrtg/mrtg.cfg, and to use the IP address 10.0.1.28 to get its information. Using this, you can have MRTG running on one machine and obtaining traffic information from multiple remote machines.
The file that MRTG outputs will have the form [IP_address]_[interface].html. In this case, the output file would be 10.0.1.28_2.html for eth0 on the remote system. (The second interface as the local interface is always interface 1.) ---