[mrtg] Strategery for cfg file

DA Forsyth iwrtech at iwr.ru.ac.za
Tue Aug 28 08:44:50 CEST 2007


On 27 Aug 2007 , Peter Laws entreated about
 "[mrtg] Strategery for cfg file":

> I've got a couple core routers, a dozen or so main floor switches,
> then bunches more odds'n'ends around the shop.

my setup is a lot smaller.... just 4 servers and a 48 port switch (my 
small corner of the campus)

> MRTG is working fine, but I need advice on how to manage configs.  I
> dumped all the devices into one cfg file, ran indexmaker and voila
> .... a huge ugly page with hundreds and hundreds of ports!  Not what I
> wanted but exactly what I specified.  :-)  Shouldn't it do what I mean
> and not what I said?

ouch.  I think most of us use seperate .cfg's to avoid just this 
problem, other than the obvious maintenance issues.  some of my 
.cfg's are generated by shell/AWK scripts, so it would be hard to 
make one huge one anyway.

> What I want is a page that has one link for each device showing its
> aggregate traffic.  Click on the link, and I see the breakdown of each
> port.  What is the best way to do that?  Separate cfgs?  A different
> set of options on indexmaker?

1 - separate cfg's
2 - php on the web server
3 - a little include for indexmaker....
	--pagetop=<?PHP include('menu.php'); ?>

menu.php contains code that finds all files of the form 
index*.html (note that my php is set to interpret html files, if 
yours isn't so set, you'll have to use .php extentions on everything)

so my indexmaker calls for each cfg generate files like
   indexswitch.html
   indexdisks.html
and so on.
and the php autoindexes them in a table.

result looks like
http://www.ru.ac.za/institutes/iwr/iwdf/mrtg.png
(my server isn't completely visible to the rest of the world so I had 
to screen capture it and put it in the main public server)

If there is demand for the indexing script, I'll post it, but I think 
I need to clean it up a bit cos it probably has highly local stuff in 
it (I program to get it working, not to be elegant, theoretically 
correct, nor cater for every general case :-)

> ----------------------------------------------------------------------
> ------- + Ranked 10th in PC Magazine's 2007 Top 20 Wired Campuses +
> Computerworld 2006 100 Best Places to Work in IT
> ----------------------------------------------------------------------

I think we'll get the 'most challenging' prize....


--
       DA Fo rsyth            Network Supervisor
Principal Technical Officer -- Institute for Water Research
http://www.ru.ac.za/institutes/iwr/




More information about the mrtg mailing list