Getting the right $HOSTGROUPNOTE$ field

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mulo
Posts: 6
Joined: Wed Sep 21, 2016 7:48 am

Getting the right $HOSTGROUPNOTE$ field

Post by mulo »

Hi,

We've got an issue and with an issue comes a question :)

The issue which we are facing is that we've created a script which is called from a host escalation, the script takes a number of arguments like $HOSTNAME$ and $HOSTSTATETYPE$ from a nagios command, but we run into a problem when we try to pass the $HOSTGROUPNOTE$ variable to the command. When a host is added to multiple hostgroups or has added mutiple hostgroups to itself, we were unable to specify which hostgroup notes the command should be send to the script, i.e.:

- hostgroup1: notes : testing
- hostgroup2: notes : testtest
- hostgroup3: notes : testing123

The host has been added to all three hostgroups, but we want to pass the notes of hostgroup2 to the command/script.

is there a way that you guys know of that can help me specify which hostgroupnote variable should be passed?

Thnx in advance!

regards,

Kees
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Getting the right $HOSTGROUPNOTE$ field

Post by tmcdonald »

Check out the on-demand macros section of the documentation:

https://assets.nagios.com/downloads/nag ... acros.html

You should be able to use $HOSTGROUPNOTE:hostgroup2$ here.
Former Nagios employee
Locked