[mrtg] Re: Include files and WorkDirs

Jerry Heidtke jheidtke at fmlh.edu
Tue Feb 4 23:52:14 MET 2003


Workdir is a global setting, not a per-target setting. When mrtg builds the
complete config file in memory from all the includes, it sets the Workdir to
whatever it sees, whenever it sees it. This means that the last defined
Workdir among all the includes is used when the complete config is
"executed".

If you want to use the Workdir directive, and want your rrd's/logs/htmls in
different directories for different devices, set the "Workdir:
/var/www/mrtg/" along with your global config options. Then use
"Directory[_]: device_x" in each device-specific config, which will tell
mrtg to use the directory "device_x" relative to the /var/www/mrtg/
directory for each target in processes until it sees another "Directory[_]:"
directive.

Hope this is clear.

Jerry

-----Original Message-----
From: Colin Horsington [mailto:chorsington at flow.com.au] 
Sent: Tuesday, February 04, 2003 4:42 PM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] Include files and WorkDirs



Hi,

I have one main mrtg.cfg where I set all the global config options.  I then
include all other configs from a directory tree.

For example:
/etc/mrtg.cfg
/etc/mrtg/devicetype_1/device_1.cfg
/etc/mrtg/devicetype_1/device_2.cfg
/etc/mrtg/devicetype_1/device_3.cfg
/etc/mrtg/devicetype_2/device_a.cfg
/etc/mrtg/devicetype_2/device_b.cfg
/etc/mrtg/devicetype_2/device_c.cfg

Where all the devices.cfg are created from policies based upon devicetype
definitions.  Now each device.cfg defines it's own WorkDir: in the
form...(via cfgmaker --global "WorkDir: %s")

WorkDir: /var/www/mrtg/device_x/

However all the rrd's/logs/htmls for all devices are placed in the same one
directory, this directory is:

/var/www/mrtg/device_x/

Any ideas?

Thanks,

Colin

PS. Main mrtg.cfg is:

###
#
#  MRTG Configuration file
#
###
#
#  This file contains global configuration options
#  and includes which point to other configs for devices.
#  This file _SHOULD_NOT_ contain information pertaining
#  to devices.
#
#  All device configs are stored in /etc/mrtg/
#
#  

###
#
# Global configuration
#
###
WriteExpires: Yes
Refresh: 600
RunAsDaemon: Yes
Interval: 5
Forks: 4
LogFormat: rrdtool

###
#
#  Global Options
#
###
XSize[_]: 600
YSize[_]: 150
Options[_]: bits

###
#
# Includes Section
#
###
Include: /etc/mrtg/devicetype_1/device1
Include: /etc/mrtg/devicetype_1/device2
Include: /etc/mrtg/devicetype_1/device3

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


Confidentiality Notice: This e-mail message, including any attachments, is 
for the sole use of the intended recipient(s) and may contain confidential 
and privileged information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 
message.


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list