-----Original Message-----
From: Henrik Størner [mailto:user-ce4a2c883f75@xymon.invalid]
Sent: Thursday, September 23, 2010 8:29 AM
To: xymon at xymon.com
Subject: Re: [xymon] directory directive
In <user-5bc0f196f990@xymon.invalid> Stef Coene <user-dbffe946c0f4@xymon.invalid> writes:
On Thursday 23 September 2010, Henrik "St=F8rner" wrote:
Related to this, I would prefer an automatic system: 'if hobbitgraph exists
and is a directory, include it in config file hobbitgraph.cfg'.
I believe you can do that already, although it will probably result in some
complaints being logged to the logfiles :-)
Mandrake has broken out their hobbitgraph file for some time, apparently, without any ill-effects. The perl one-liner below is what I use to split the distro .cfg files apart during an RPM install... (rpmbuild macros have been replaced with real paths):
install -d /etc/xymon/graph.d
pushd /etc/xymon/graph.d/
perl -e "\$/='';while (<>) { \$_ .= <> while not (m#\n\[([\w+._-]+)\]#s || eof);open (FILE,'>',\$1); print FILE \$_; };" ../hobbitgraph.cfg
popd
echo "#
# The hobbitgraph.cfg file is read by the grapher module.
# It controls which of the Xymon data streams to graph using RRD and
# their respective RRD configuration options.
#
directory graph.d/" > /etc/xymon/hobbitgraph.cfg
Remember that the directory directive will parse the files it sees in alphabetical order.
The same logic, of course, works for clientlaunch and hobbitlaunch files. Hope this helps!
-jc