How can I have different Notification For Diferrent states?

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
doulakis
Posts: 1
Joined: Wed Aug 28, 2013 9:36 am

How can I have different Notification For Diferrent states?

Post by doulakis »

Hello,
I need to have different notification for different states (hosts and services) is it possilbe to do this,
without creating the same contact two times?
For example i want to get notified by SMS for critical states and for all the other states i want to get an email.

Is it possible to create two different templates of contact with diferent notification method and use in the definition of contact both of these?

Thank you.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: How can I have different Notification For Diferrent stat

Post by slansing »

Well you would more than likely need to create a contact group, that contains your two contact's. They would both receive the notifications that their contact definition allows them to "w,c,u,s,r, etc."
grimm26
Posts: 36
Joined: Wed Dec 12, 2012 1:57 pm

Re: How can I have different Notification For Diferrent stat

Post by grimm26 »

Or write a notification script that can differentiate between the types of alerts and send the alert to the appropriate address.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: How can I have different Notification For Diferrent stat

Post by abrist »

grimm26 wrote:Or write a notification script that can differentiate between the types of alerts and send the alert to the appropriate address.
^This. It can be done as others have done so. You will need to make use of a number of nagiso macros. If you choose this route, I would suggest that you start with the following documents:

http://nagios.sourceforge.net/docs/3_0/macrolist.html
http://nagiosplug.sourceforge.net/devel ... lines.html
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked