Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some power connect switches and I use MRTG to monitor them, though I noticed that if I plug a new server into one of the switches MRTG does not update to display this.

for example I just plugged a server into port 21 and my graphs still don't show port 21.

it does not show pu up in the folder nor in my index.

any ideas?

is there a way I Can add this without loosing all historical data?



share|improve this question
up vote 2 down vote accepted

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:

cfgmaker --subdirs=HOSTNAME --output=mypcnt-01.conf mysecret@powerConnectSwitch-01
indexmaker --output mypcnt\index.html mypcnt-01.conf 

Just run something like that on a schedule. Adjust to taste.

share|improve this answer
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. – Luma Jul 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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.