Xymon Mailing List Archive search

Nesting include files hosts.cfg

2 messages in this thread

list Michael Beatty · Wed, 12 Dec 2012 14:53:00 -0500 ·
It looks like the answer is no, but I'm going to try anyway. I've tested 
it and it doesn't appear to work, but maybe I'm doing it wrong.

I have a large number of hosts to monitor.  Is there a way to nest the 
tags for the hosts into a list of hosts to include into the hosts.cfg file?

For Example:
If I have a:
group-only test1|test2|test3
host1 # test1 test2 test3
host2 # test1 test2 test3
host3 # test1 test2 test3

Is there a way I could do something along the lines of:
having a file - tests.dat
test1 test2 test3

and including it into a file
hosts.dat
host1 # include tests.dat
host2 # include tests.dat
host3 # include tests.dat

and then putting in into the hosts.cfg file

group-old test1|test2|test3
include hosts.dat


Thank you.

-- 
Michael Beatty
list Japheth Cleaver · Wed, 12 Dec 2012 15:25:46 -0800 (PST) ·
quoted from Michael Beatty
Is there a way I could do something along the lines of:
having a file - tests.dat
test1 test2 test3

and including it into a file
hosts.dat
host1 # include tests.dat
host2 # include tests.dat
host3 # include tests.dat

and then putting in into the hosts.cfg file

group-old test1|test2|test3
include hosts.dat

Sadly, no... include (and directory) operate on a per-line basis.

FWIW, when I get to the point where there's a ton of repeated content like
that, I simply 'include' a generated file (whether textually assembled or
DB-driven).


HTH,

-jc