[mrtg] MRTG as Daemon, mrtg.cfg including files, variables overwritten

falz me at falz.net
Fri Apr 27 16:32:47 CEST 2007


I'm migrating MRTG to a new host, and moving to use the mrtg daemon
instead of via cron. The daemon calls a single MRTG file, in which I'm
including "real" cfg files:

 this is the main mrtg config file that the daemon calls. It will include no

WorkDir: /var/mrtg/www
IconDir: ../mrtgicons/
Options[_]: growright,nobanner,noinfo,bits
RunAsDaemon: Yes
Interval: 5
Include: routers.cfg
Include: switches.cfg


In each of the included files, "WorkDir" is re-defined, but it's
always overwritten with the LAST one that's defined. This is almost
exactly like this person is doing. However, I do not want each host in
its own directory, as was his solution:

https://lists.oetiker.ch/pipermail/mrtg/2003-September/025520.html

I see a few possible solutions:

1) Tell the mrtg daemon about more than 1 cfg file, and don't use the
"include" lines in my master mrtg.cfg". I've tried to give it two cfg
files seperated with a space and a comma. comma doesn't work at all
(was a longshot) and the space seperated it will only read the first
file.

2) Fix my include syntax and somehow force MRTG to not overwrite the
WorkDir variable. Not sure if this is realistic or not, but it seems
that the "Include" is documented anywhere that I can see.

3) Run an MRTG daemon for each config file (I *really* do not want to do this)

Thanks for any suggestions.
--falz



More information about the mrtg mailing list