Page 1 of 1

Notification for services for a specific host

Posted: Wed Jan 27, 2021 6:16 am
by rhassing
Hello,

We have setup different host which share service checks. For example check_cpu.

Would it be possible to send a service notification to a group of users for a specific host?
For example we have a host in USA and a host in the Netherlands and both will have the same service check (check_cpu).
If the CPU check in USA fails, I only want the people in the USA to be notified and no notification to the Netherlands.

Do I need to create two different service checks ie. check_cpu_usa and check_cpu_nl or is there another way to distinguis the notification group?

Best regards,
Rob Hassing

Re: Notification for services for a specific host

Posted: Wed Jan 27, 2021 6:02 pm
by benjaminsmith
Hi Rob,
Would it be possible to send a service notification to a group of users for a specific host?
If you don't assign a notification contact to the service itself, it will pull the contacts from the host using implied inheritance. For more of the rules, take a look a the following doc.

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

Let me know if that would work for your situation.

Best Regards,
Benjamin

Re: Notification for services for a specific host

Posted: Thu Jan 28, 2021 4:18 am
by rhassing
Hello,

This will not work in all cases, as there are different contacts for the services on 1 host.
If a contact is defined on the service, I assume it will not inherit the contacts defined on the host as well.

Best regards,
Rob Hassing

Re: Notification for services for a specific host

Posted: Thu Jan 28, 2021 6:26 pm
by benjaminsmith
Hi Rob,

That's right if there are contacts assigned at the service level that type of inheritance is not going to kick in. Another option would be to use Escalations as they will take priority over standard notifications. If you have two hostgroups, say USA and Netherlands, and then apply the service to those two host groups. You should be able to create separate service escalations for each host group and notify the different contacts.

The other option would take some custom scripting for the notification handlers (e.g. a wrapper script) to make this work using the macros provided by Core to run logic checks on the hosts and then notify the corresponding contacts.

--Benjamin

Re: Notification for services for a specific host

Posted: Fri Jan 29, 2021 9:02 am
by rhassing
Thank you very much for this information. I will discuss the different options with the customer and see which option will fulfill their needs.

Best regards,
Rob

Re: Notification for services for a specific host

Posted: Fri Jan 29, 2021 10:02 am
by benjaminsmith
Hi Rob,

Sounds good. We'll keep this open if you have any other questions.

Have a great weekend!