Viewing Graphs
Once you've generated some graphs, you will want to look at them to see the results. To make it easier to view the graphs, MRTG comes with an indexmaker script that generates HTML index pages. Here's how to run indexmaker for a typical set of graphs:[root][linuxserver] ~/mrtg-2.9.10>indexmaker --title "Cisco to Internet" \
--filter name=~'cisco' --output /mrtg/images/cisco.html /mrtg/run/mrtg.cfg
This command creates one index page with the five-minute average graph for each target you've specified in your mrtg.cfg file. Keep in mind that the target is the interface from which you're gathering data. If you have four targets for your router, there will be four graphs in the index file, all pointing to the daily, weekly, monthly, and yearly summary graphs for that target. The - -title option tells indexmaker what title to use for the index file. - -filter name=~cisco allows you to select some of the targets in the mrtg.cfg file by using a regular expression: we told indexmaker to find all targets that include the string
cisco
. The - -output option is the name of the index file. The final argument on the command line is the full path to the configuration file. Table 13-1 gives a synopsis of these options as well as some other useful options to indexmaker.
Table 13-1. Command-Line Options to indexmaker
To display the entire list of options to indexmaker, run the command without any options. Figure 13-1 shows how the cisco.html file generated by indexmaker looks when it's loaded into a web browser.
Figure 13-1. Cisco graph overview
There are four graphs on the page, one for each of the operational interfaces (interfaces that were up and running when we ran cfgmaker) on our router. This page includes links to other pages that have more detailed information about individual interfaces; Figure 13-2 shows the daily, weekly, monthly, and yearly traffic graphs for the Ethernet0 interface.