[mrtg] Newbie Question

Steve Shipway s.shipway at auckland.ac.nz
Thu Sep 29 22:51:49 CEST 2011

> extensive); I wanted to know if it is possible to evaluate a command
> in a mrtg configration file, similar to how the graveyard ticks are
> used in bash shell scripting. Basically I have a PHP script that I use
> to print an HTML menu (it uses iterative loops and conditional logic
> to apply various CSS styles depending on the state of a hyperlink
> (i.e. active).  I want to execute an arbitrary external PHP script
> from within an mrtg file; is this possible?  If so could somebody
> please send me a code snippet or syntax example of how this can be
> achieved?

You can have MRTG call an external script to either:
a) collect the data, using Target[]:`command`
b) handle threshold breaks/heals, using ThreshProg{I/O}[]:command

However, from your posting it sounds as if you want an arbitrary script to be run every pass in order to generate static web pages?  I would have thought it would be better to use some sort of CGI to do this processing on demand from the web server, rather than every pass of MRTG.  If you are running MRTG in RRDTool mode (as opposed to Native mode) then MRTG will not generate the HTML and images every pass but will simply update the RRD files, leaving the image and HTML creation to your frontend ( routers2/mrtg-rrd/14all.cgi etc) -- this is much more efficient.  


Steve Shipway
ITS Unix Services Design Lead
University of Auckland, New Zealand
Floor 1, 58 Symonds Street, Auckland
Phone: +64 (0)9 3737599 ext 86487
DDI: +64 (0)9 924 6487
Mobile: +64 (0)21 753 189
Email: s.shipway at auckland.ac.nz
 Please consider the environment before printing this e-mail 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4928 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/mrtg/attachments/20110929/73cd86d4/attachment-0001.bin 

More information about the mrtg mailing list