1

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?

thanks.

Luma

Luma
  • 1,440
  • 4
  • 19
  • 31

1 Answers1

2

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.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
  • 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 01: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 01:34