[mrtg] Include vs require [ Was adding a new probe to the cfg file ]

McDonald, Dan Dan.McDonald at austinenergy.com
Wed Oct 8 01:25:17 CEST 2008


On Wed, 2008-10-08 at 12:05 +1300, Steve Shipway wrote:
> Dan McDonald wrote:
> > One of these days I'll write an Include: that is optional, (cf.
> > include() and require() in php) so that missing one file doesn't kill
> > the whole run for the other 600 hosts....
> 
> Now, if we're listing requests for the next version of MRTG, what I'd really like to have is a wildcarded Include, such as:
>   Include: *.cfg
> so that you never need to recreate your master.cfg when running MRTG in daemon mode.

Won't work.  The whole advantage of daemon mode is that it only parses
the config once.  So, it doesn't matter if you change the existing files
or create new ones, it's still not going to be read and you still have
to restart the daemon.  That's why I run from cron.

But wildcard includes might be a possibility, although it would mean I
need to re-write my cfgmaker wrapper to clean up stale configs...


> Having a missing Include: file as a warning rather than a fail would
> be useful too, although you'd need to be able to do it both ways (your
> global.cfg would need to be a required, but the various host.cfg files
> can of course be missed)

Correct.  We'll have to come up with a new directive for optional
includes for backward-compatibility.  I can't very well call it
Require: ;-)




> 
> Steve
> 
> _______________________________________________
> mrtg mailing list
> mrtg at lists.oetiker.ch
> https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
-- 
Daniel J McDonald, CCIE #2495, CISSP #78281, CNX
Austin Energy
http://www.austinenergy.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.oetiker.ch/pipermail/mrtg/attachments/20081007/a62d3fa2/attachment.bin 


More information about the mrtg mailing list