Change notification recipient on the fly

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
rokborn
Posts: 3
Joined: Mon Nov 23, 2015 10:13 pm

Change notification recipient on the fly

Post by rokborn »

Hi All,

I need to find a way to change the recipient of an alert based on the content of the subject or message. I have a storage system that sends tree quota alerts per SNMP to Nagios Core. Each tree belongs to a different customer. The quota alert needs to be send to the correct customer. I would like to change the recipient of the alert/notification based on the tree name. I am not sure if that is even possible in Nagios. I would appreciate any idea how I can could solve this issue.

Thanks,
Robert
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Change notification recipient on the fly

Post by hsmith »

This is a pretty unique scenario. I can't think of a way to do it off the top of my head without a good deal of scripting. Is it possible that it is something you can do at the email server level? I'll ask around the office a bit with some of the techs that have been here longer, but I know this is the first scenario of this type I've had come up. For some clarification, you have one check, set up in Nagios, but based on the result of that check, it could be an issue with different customers?
Former Nagios Employee.
me.
rokborn
Posts: 3
Joined: Mon Nov 23, 2015 10:13 pm

Re: Change notification recipient on the fly

Post by rokborn »

Hi,
Here are a few more details. I am not able to create an active SNMP check towards the storage system (VNX NAS). Currently the VNX triggers the alert and I am using SNMPTT to make that trap available in Nagios. So back to your question. Yes, it is one passive check setup in Nagios. If there is scripting necessary I do not worry to get my hands dirty. I just do not know where I could get started to get this accomplished.
Thanks,
Robert
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Change notification recipient on the fly

Post by hsmith »

The best way that I can think to deal with it, would be by using event handlers. To be honest, I don't know how easy or difficult this would be. I would write a script that looks for the incoming information, and uses some if statements to determine what to do, such as email someone. I don't have a much better solution. https://assets.nagios.com/downloads/nag ... dlers.html

It may honestly be easier to configure on the email server.
Former Nagios Employee.
me.
Locked