Xymon Mailing List Archive search

Is there a way to clone host definitions in bb-hosts?

list John Burk
Tue, 10 Jun 2008 20:38:04 -0700
Message-Id: <user-eed83bea0bcf@xymon.invalid>

Sweet.  This is exactly what I was looking for.

I'll experiment tomorrow and see if the var (guess I'll have to start
calling it a macro) can be defined in the body of bb-hosts and still
be evaluated correctly in the include files that contain the client
entries.  I'm guessing it will since the section of the hobbit-alerts
manpage that deals with macros mentions that macros can be nested, but
that the inner macro must be defined first.  This leads me to believe
that the config file parser reads line-by-line evaluating as it goes.

I'm just going to get started in the next day or two with alerts
within hobbit, hence my unfamiliarity with macros.  I had quickly
scanned the hobbit-alerts manpage today but had missed the
significance of the section on macros, mainly because it looked at
first glance to be regex evaluation; the example with
"$WEBHOSTS=%(www|intranet|support|mail).foo.com" caught my eye.  Does
the leading '%' always signify some sort of regular expression in
hobbit?


johnB

2008/6/10 Tim McCloskey <user-2644b182ab49@xymon.invalid>:
So I was curious about the whole macro thing and decided to test it out.  It
has only been a few minutes but the following seems to work fine.  I hope
this helps in some way.


bb-hosts:

$foo="dns"
ipaddress    servername             # $foo


Regards,

Tim


Tim McCloskey wrote:
As mentioned, perhaps someone with knowledge on the topic can answer.

To extend the question further, since macros (variables) are able to be
used within the hobbit-alerts.cfg file I wonder if variables can be assigned
in bb-hosts and hobbit-clients.cfg?  At one point I thought of trying to
keep all of our host/client/alerts data within mysql, but it was only a
thought.

Regards,
Tim


John Burk wrote:
 I'm using includes in my bb-hosts to keep the file
length down, but my included files are comprised of hundreds of hosts
all identical except for the ipaddresses and hostnames.

Surely there must be a way to template this, I just can't find it in
the bb-hosts manpage...
...
and so on in mind-numbing repetition...
==============================

I'd like to be able to define the tags in a template, and simply use
that template.  Does this mechanism exist in bb-host?  That way
if/when I need to change the tags for all my hosts, I only need to do
it in one place, and not on every line in 3 different files.