Notifications and distribution lists

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Notifications and distribution lists

Post by snapon_admin »

Ok, I need some guidance on what the best way to do this would be. This is going to be a bit of a lengthy explanation so bear with me. Currently we're using the AD component to allow users to login to Nagios with their AD credentials. When a user is created, a monitoring contact entry is created as well. This monitoring contact is put into a contact group and that contact group is assigned to whatever hosts/services those users need to be able to see when they log into Nagios. All of that is handled via CCM. When a notification is sent, Nagios uses the email address stored in the Admin > User Admin list, not the one in CCM. This email address field cannot be blank. Currently, an individual email is sent to each user whenever a notification is sent. Our 24/7 operations team needs these notifications to be sent to certain distribution groups set up in exchange. I can create a dummy user in Admin ?

User Admin with the distribution group email address, which creates a monitoring contact that I can assign to whatever host/service it needs to alert on, but then 2 notifications are generated, one for the user that needs to be a contact in order to see it in nagios, and one for the distribution group. What is the best way to set this up so that individual users can see what they need to see in nagios, and ONLY what they need to see, but have the emails go to distribution groups? I should also note than not ALL notifications will be going to just distribution groups, some individual users will need to receive emails as well. God I hope someone can make sense of all that...I can clarify whatever is confusing about this if anything.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Notifications and distribution lists

Post by BanditBBS »

Welcome to my world!

I handle this multiple ways. As you described and have the users go into their accounts(or masquerade as them) and under notification preferences I uncheck enable notifications. That way, they can still browse to their stuff but receive no notifications except from the DL.

The other method I use is setup escalations. Out internal IT here is split into three hostgroups. They want to see it all but only get notifications for what the cover. I have three different matching host templates with the contact/contactgroups added that need to be. As for access, I created escalations for the other two hostgroups and set the first and last notification number to 500. That way they'll never get a notification(we only send one) but can still see the items in XI.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Notifications and distribution lists

Post by snapon_admin »

I think this would prevent me from being able to do that:
"I should also note than not ALL notifications will be going to just distribution groups, some individual users will need to receive emails as well. "

As a matter of fact, I think that bit makes what I want to do basically impossible. Without the ability to set individual user's ability to VIEW specific hosts/services and/or be alerted on said hosts/services I don't think this can happen. Is the ability to specify what hosts/services a user can see in nagios, and be separate from what hosts/services a user is notified on something that's planned for a future release? Is it even possible?
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Notifications and distribution lists

Post by BanditBBS »

Just use escalations to set view permissions and add as contact also where ever they need the notifications. You can do both and it'll work great...unless I am severely misunderstanding.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Notifications and distribution lists

Post by snapon_admin »

Hmm, so I would need to set up escalation rules for all hosts and services individual users need to view? Yeah that'd probably be prohibitively time consuming. Meh, I'll just have to tell ops that this can't be done and we'll have to keep things the way they are. Thanks for the tips!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Notifications and distribution lists

Post by BanditBBS »

snapon_admin wrote:Hmm, so I would need to set up escalation rules for all hosts and services individual users need to view? Yeah that'd probably be prohibitively time consuming. Meh, I'll just have to tell ops that this can't be done and we'll have to keep things the way they are. Thanks for the tips!
Well, kinda. You can use hostgroups and wildcard(*) for service to designate all services on the hosts. It is a pain, but if you use hostgroups and contactgroups wisely already, the initial setup won't be too bad and very easy to maintain when adding new users. Would just have to add to proper contactgroup(s).

I think that's all my hints on the subject now :)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Notifications and distribution lists

Post by snapon_admin »

Our Ops team is happy with just a list of who the notification was sent to in their emails, so I'm going to go that route I think. One question on that, though: Is there a way to list the contact alias of all members of a contact group? I know there's a macro for $CONTACTALIAS$ but I'm only seeing ones for $NOTIFICATIONRECIPIENTS$ and $CONTACTGROUPMEMBERS$ which only show the actual user names, i.e. jdoe, instead of the alias, like John Doe. Since our AD usernames are things like kh9063 and such, the alias would obviously be much more useful. For that matter, is there a way to list all the contact groups that the notification was sent to? All of the contact group related macros I see only list the contact groups that the user receiving the notification is a member of.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Notifications and distribution lists

Post by tmcdonald »

I don't think this will be possible with macros alone, but I can double-check with the devs.

To be clear:

- You have a contact group
- When notifications get sent to the members of that group, you want to include the alias (not the name) of all members
- Currently with $NOTIFICATIONRECIPIENTS$ and $CONTACTGROUPMEMBERS$ you only get the name
- You also want to include all members for all contact groups that were notified

Does that sound about right?
Former Nagios employee
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Notifications and distribution lists

Post by snapon_admin »

There's a couple of things I want with this. A lot of our checks have both individual contacts and contact groups assigned to them.

- I would like all the contact's aliases (not names) that were sent an email included, as well as all the contact groups that were notified.
- For the groups it can either be alias or name really, since those are usually the same.
- Ideally there would be a $NOTIFICATIONCONTACTGROUPS$ macro that would include the contact groups that were sent a notification and a $NOTIFICATIONRECIPIENTALIAS$ macro that does what $NOTIFICATIONRECIPIENTS$ does, but with alias instead of name.

Example (bolded bit is what I'm after):

Host: blahblah server
Service: blahblah service check
Service output: WARNING - blahblahblah
Alert time: blah o'clock
Groups notified: Operations, Database Administrators, Unix Administrators
Users notified: John Doe, Rusty Shackleford, Nicholas Cage, Patrick Kane, Duncan Keith, Jonathan Toews
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Notifications and distribution lists

Post by tmcdonald »

We talked this over, and there does not appear to be a way to do this with just macros. Consider that each notification is individually launched from Core, for a single contact. Aside from a NID (notification ID) there isn't a ton that links notifications together directly. It could be possible to build up a list of who needs to be notified, store that list in a string, then iterate through that list to send notifications, but that would be a pretty big overhaul of how notifications are sent out. If it went in as a feature request it may be denied, otherwise custom dev is always an option.

We can keep this open for discussion, but there ins't an "easy" solution.
Former Nagios employee
Locked