[mrtg] MRTG include directive.
mrtg at dandoore.com
Thu Sep 13 23:21:03 CEST 2007
philpen01 at westnet.com.au wrote:
> Is there a way to configure MRTG to ignore/bypass non-existant
> include .cfg files ? and/or is there a way to use a wildcard on the
> include directive (rather than add a specific include directive for
> each .cfg file) ?
Probably your best way around this is to make a script that you call
instead of 'mrtg MASTER.cfg' that builds the MASTER.cfg file for you and
then calls MRTG with it.
I don't know shell/DOS batch without a white book with an animal on the
front next to me but it would be something like:
echo to /apps/mrtg/MASTER.conf until EOF
# This is the Master.conf file
# Any options here...routers2cgi ignores etc.
For blah in /apps/mrtg/*.cfg
echo to MASTER.conf "Include: $blah"
call /apps/mrtg /apps/mrtg/MASTER.conf
You'd have to have the master file as a different extension to the
.cfg's to stop it adding it into itself but that's the sort of thing.
More information about the mrtg