nagios

Include hostgroups in nagios notifications


Im trying to include the hostgroups in my nagios notification. I modified the commands.cfg notify_host_by_email command to include

... Host: $HOSTNAME$\nHostgroups: $HOSTGROUPS$\nState: $HOSTSTATE$ ...

but that doesn't seem to work. I just get Hostgroups: $ in my email. Does anyone know the right way to do this?


Solution

  • the current behavior is correct as you are trying to use invalid macro.
    To get list of all supported Nagios macros see this document.

    You should use $HOSTGROUPNAME$ instead of $HOSTGROUPS$ or maybe $HOSTGROUPNAMES$ if it is usual that your hosts belongs to multiple host groups.