[mrtg] how to echo system.sysDescr.0 in the output html

Steve Shipway s.shipway at auckland.ac.nz
Thu Oct 22 00:24:46 CEST 2009


> >> I want to echo the current value for system.sysDescr.0 into the html
> >> output
> >> file but cannot get it to work.
> >> In fact i don't know how to get it done :)
> >
> > You could set up code to extract this value and put it into the PageTop
> or
> > PageFoot and put this into a host template that you use with cfgmaker
> when
> > you create the .cfg file for MRTG.
> 
> I'll be happy to echo something into the PageTop, will serve my needs for
> now.
> Could you elaborate on what code i would need to put where to accomplish
> that?

You'll need to put Perl code in the cfgmaker interface template.   Read up on the cfgmaker documentation for this... and of course you'll need to be adequately good at perl coding.  I don't have the itme to write the whole thing for you though!  Take a look at the sample templates in the template library at http://www.steveshipway.org/cfgmaker

> I have tried various stuff including calling scripts from the PageTop
> directly, but it will just echo whatever i put in there. I can only
> imagine
> i need to put a var in there, but how do i get it to be read by the host
> template?

If you are using MRTG/RRD with Routers2 then you can put vars in the Pagetop, and later versions of routers2 let you put in Includes and even external execs which would achieve this by a long route.  The difference is if you want this value to be re-polled each time you look, or if it is sufficient to just poll it once when you initially set up the MRTG configuration file (IE by using cfgmaker templates)

Steve



More information about the mrtg mailing list