Page 1 of 1
Different notification command for different host group
Posted: Mon Dec 22, 2014 2:33 am
by linhua11
Hi, I want to know is it possible to run different notification command for hosts under different host group for same contacter?
Re: Different notification command for different host group
Posted: Mon Dec 22, 2014 10:25 am
by tmcdonald
Typically a contact will only have one notification script for all hosts and services. However you could change that script to one of your own design that will inspect the host name and take appropriate actions.
Re: Different notification command for different host group
Posted: Tue Dec 23, 2014 4:26 am
by linhua11
tmcdonald wrote:Typically a contact will only have one notification script for all hosts and services. However you could change that script to one of your own design that will inspect the host name and take appropriate actions.
Thanks for your reply, do you mean that I could put "if clause" in the notification command? So that I could test the value of host name and do different logic?
Re: Different notification command for different host group
Posted: Tue Dec 23, 2014 10:10 am
by tmcdonald
Typically all the logic would be stored in a file that is run, but you could probably technically put it in the command and get away with it. However, I would suggest against this as some characters used in bash scripting might be illegal characters in a Nagios config definition and would break things.