3.6 Maintaining MRTG
MRTG requires more maintenance than most of the tools described in this book. Each time you move a network or router interface, you will have to make sure the change is reflected in the MRTG configuration. This is why it is to your advantage to save the cfgmaker command line and indexer.sh script described earlier. They will allow you to generate a new configuration and new index pages with a minimal amount of effort. You may even choose to run them nightly from the crontab so that changes will be reflected automatically.
Moving networks and interfaces can wreak havoc with MRTG’s sense of which data files belong to which network. Your setting of ifref on the cfgmaker command line will give you control over how MRTG references interfaces. If you set ifref to ip, MRTG will track an interface by its IP address. This is a good choice since you’ll be able to move a network to a new interface and MRTG will still track the data. Other options for the the ifref variable are the same as those listed in Figure 3.2, except that the alias setting is not available.
In the event that you do make a change that causes MRTG to lose its sense of which data belongs to which network, you can attempt to remedy the situation by finding the appropriate .log file under /usr/local/apache/htdocs/mrtg/router* and renaming it to be the data file that MRTG expects for the new network.