Different notification command for different host group

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
linhua11
Posts: 2
Joined: Mon Dec 22, 2014 2:21 am

Different notification command for different host group

Post by linhua11 »

Hi, I want to know is it possible to run different notification command for hosts under different host group for same contacter?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Different notification command for different host group

Post 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.
Former Nagios employee
linhua11
Posts: 2
Joined: Mon Dec 22, 2014 2:21 am

Re: Different notification command for different host group

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Different notification command for different host group

Post 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.
Former Nagios employee
Locked