Notifications to a Contact Group
-
aravindreddy114
- Posts: 55
- Joined: Tue May 07, 2013 12:48 pm
Notifications to a Contact Group
I have create 15 contacts and added them to a contact group. I included this contact group in all the service checks.
In the TO section of email notifications that i receive from nagios, i am not seeing list of people in the contact group. I only see my name.
What should i do to see the names of all the people in the contact group, when i receive any alert
In the TO section of email notifications that i receive from nagios, i am not seeing list of people in the contact group. I only see my name.
What should i do to see the names of all the people in the contact group, when i receive any alert
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Notifications to a Contact Group
You will not see other peoples email addresses from a notification email, this is a privacy thing as emails are sent out from nagios to all of the contact addresses.
-
aravindreddy114
- Posts: 55
- Joined: Tue May 07, 2013 12:48 pm
Re: Notifications to a Contact Group
Is there a way where we can change this, that way people will know who is getting the mails
Thanks Araivnd
Thanks Araivnd
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Notifications to a Contact Group
Not easily, you could create a few custom notification handlers and hand include each contact's email address in the mail body, however you would need to manually change this whenever you added or removed contacts.
-
aravindreddy114
- Posts: 55
- Joined: Tue May 07, 2013 12:48 pm
Re: Notifications to a Contact Group
How can i create custom notification handlers
Re: Notifications to a Contact Group
You can use the macro: $NOTIFICATIONRECIPIENTS$
This will show the short (display) names of the contacts associated with the object.
1. Go to --> Admin --> Notification Management.
2. Add the following to the body of the service and host emails:
3. Now go to --> Configure --> Core Config Manager --> Commands. Search for "notification_handler". Add the following to the end of the command for the two commands (xi_host_notification_handler and xi_service _notification_handler):
Save out and apply configuration.
Now your emails should include a list of the contacts also on the object.
This will show the short (display) names of the contacts associated with the object.
1. Go to --> Admin --> Notification Management.
2. Add the following to the body of the service and host emails:
Code: Select all
Contacts: %contacts%Code: Select all
--contacts="$NOTIFICATIONRECIPIENTS$" Now your emails should include a list of the contacts also on the object.
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.
"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.
-
aravindreddy114
- Posts: 55
- Joined: Tue May 07, 2013 12:48 pm
Re: Notifications to a Contact Group
No problem. This works for any core macro (http://nagios.sourceforge.net/docs/3_0/macrolist.html). Just map the macro to a name and put it at the end of the xi notification handlers:
Then add the name (with bookended percents) to the notification message:
Note: This only works with XI notifications, not core. Core notifications would use just the core macro and would have to be embedded in the body portion of the core notification handler.
Code: Select all
--<name>="<$macro$>"Code: Select all
Whatever: %<name>%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.
"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.
-
aravindreddy114
- Posts: 55
- Joined: Tue May 07, 2013 12:48 pm
Re: Notifications to a Contact Group
It there a way to edit the Macro NOTIFICATIONRECIPIENTS
Re: Notifications to a Contact Group
No, not without altering the Nagios core source. It is a built-in macro.
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.
"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.