1 Answer
1

The way to fix this is to run a periodic poll of the switch and auto-generate your MRTG configs. There is a key utility that comes with MRTG that's called cfgmaker. This is a utility that will auto-generate pages based on data it pulls out of a target's SNMP data. The key is to name your pages after the interfaces and populate any descriptive names in the page itself. This way the same interface will keep its name no matter what's plugged into it.

Once you have all that, you can couple that with indexmaker to build a dynamic key for your site. But the cfgmaker and indexmaker calls into a single script and run that script on whatever schedule suits you, and it'll just make new pages as it finds them. It works pretty good, I was using MRTG to track certain server-based statistics back in the day and had a swank .bat file that generated it all.

You can get really complex with these with regards to formatting, but if you just want defaults something like this might be all you need:

ah so I can use cfgmaker again on the host and it won't get rid of my existing history? I have the switch set to use the name (g##) for ref and name.
–
LumaJul 21 '10 at 1:12

Oh yes! The key thing are the names. When it goes to poll, it checks to see if the right file names are there. If so, it re-uses what's there. Those files don't get generated at config-time, they get generated at run-time. Don't know about RRDTOOL-based installs, though.
–
sysadmin1138♦Jul 21 '10 at 1:34