On 3/20/2017 7:15 PM, Jeremy Laidman wrote:
Does anyone know if it's valid to use multiple NET: tags for a host, or will it break stuff? I don't actually use NET: tags for its real purpose (for xymonnet to match with $XYMONNETWORK) and instead I have some server-side scripts that are only meant for hosts on some networks. If I wanted to define a host so that it is included in multiple server-side script processing, can I do something like this:
10.1.1.1 host1.example.com <http://host1.example.com> # NET:net1 NET:net2
Eventually, someone might want to use NET: tags as intended, and I don't want to make that not work, or behave unexpectedly.
Unfortunately, only a single NET property is available for a given host. In 4.4 and Terabithia multiple NET's can be assigned to a given *poller* (or thing using xymongrep) to filter the hosts by, but each host inherently only has a single stored field for this.
Depending on your needs, and if someone is planning on using NETs in the future there, you might be able to combine things textually (NET:net1.net2). A better option for custom scripting could just be to add new arbitrary tags into the hosts.cfg lines and filter using xymongrep (locally) or xymon localhost "hostinfo XMH_RAW=<string>"
There really isn't a great arbitrary array-of-values field within the host record for things like this, other than the config as a whole.
HTH, -jc