Platform is: Nagios XI 5.5.3
I've been trying to setup alerts to send to a Contact recipient and not having any luck. Please note the recipient is setup as a "Contact" only object and not a "User" account. I do not need this Contact recipient to be able to login to the Nagios system but rather only be able to receive alerts. I've tried creating a user manually as well as copied an existing Contact but neither is working. The Contact definition is below (some info modified). The contact is currently setup to receive Host status only and not other related services such as disk space, utilization, etc. but can expand on it if necessary. I did try enabling both Host and Services alert but again, did not work.
define contact {
contact_name ITSupport
alias IT Support Center
host_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,r,s,
service_notification_options w,u,c,r,f,
host_notification_commands xi_host_notification_handler
email support@<somedomain>.com
use xi_contact_generic
}
Basic steps taken to setup the Contact:
1) In Core Config Manager | Alerting / Contacts | Add New - provided all the necessary info
2) Also tried copying an existing Contact entry.
3) Assign Contact Templates
4) Enable Host Notification Command for "notify-host-by-email" but also tried "xi_host_notification_handler"
5) Assign to Contact Groups
6) Update monitored object alert to include Contact and Contact Group.
Can anyone confirm the above steps are correct and/or share a better process (step-by-step instruction would be greatly appreciated)?
Thanks,
-pc
Alert emails not sent to Contacts
-
npolovenko
- Support Tech
- Posts: 3457
- Joined: Mon May 15, 2017 5:00 pm
Re: Alert emails not sent to Contacts
Hello, @pcheng. Here is the problem.
If you don't want to create usernames I suggest using different commands -> notify_host_by_email and notify_service_by_email. You'd need to unassign the handler commands.
Keep in mind the commands im suggesting do not work with SMTP, they will use the PHP sendmailer to send emails.
The xi_host_notification_handler and xi_service_notification_handler commands require each contact to have a corresponding/matching username.please note the recipient is setup as a "Contact" only object and not a "User" account.
If you don't want to create usernames I suggest using different commands -> notify_host_by_email and notify_service_by_email. You'd need to unassign the handler commands.
Keep in mind the commands im suggesting do not work with SMTP, they will use the PHP sendmailer to send emails.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
Maxwellb99
- Posts: 97
- Joined: Tue Jan 26, 2016 5:29 pm
Re: Alert emails not sent to Contacts
hey pcheng. We run a mixed environment (contacts/users) as well & I found this invaluable.
https://assets.nagios.com/downloads/nag ... Mailer.pdf
We use "notify_service_xi_contact" & "notify_host_xi_contact". Works for Users OR contacts. You lose a bit from being able to config the notification message from the GUI via a user but if you really need to you could create the service with a user then use "xi_service_notification_handler" or i'd create a copy of "notify_service_xi_contact" & apply that.
Cheers,
Maxwell Ramirez
https://assets.nagios.com/downloads/nag ... Mailer.pdf
We use "notify_service_xi_contact" & "notify_host_xi_contact". Works for Users OR contacts. You lose a bit from being able to config the notification message from the GUI via a user but if you really need to you could create the service with a user then use "xi_service_notification_handler" or i'd create a copy of "notify_service_xi_contact" & apply that.
Cheers,
Maxwell Ramirez
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Alert emails not sent to Contacts
Thanks for sharing @Maxwellb99!
Re: Alert emails not sent to Contacts
@Maxwellb99 Thanks very much. Exactly what I was looking for. Working like a charm.
-pc
-pc
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Alert emails not sent to Contacts
great, Locking threadpcheng wrote:@Maxwellb99 Thanks very much. Exactly what I was looking for. Working like a charm.
-pc