Nagios Core - Problem with E-Mail Notifications

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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Core - Problem with E-Mail Notifications

Post by rkennedy »

Looks like it's still set at that (root@localhost). Please PM your /usr/local/nagios/var/objects.cache file for me to look at.
Last thing, Nagios Core don't need the "E-Mail Configuration" (Pop Server, Smtp Server, Authentication credentials) for sending the E-Mail?
No, it uses the basic mail sending on your machine. Was there a specific reason you switched from Nagios XI?
Former Nagios Employee
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Nagios Core - Problem with E-Mail Notifications

Post by Bone8Head »

rkennedy wrote:Looks like it's still set at that (root@localhost). Please PM your /usr/local/nagios/var/objects.cache file for me to look at.
Last thing, Nagios Core don't need the "E-Mail Configuration" (Pop Server, Smtp Server, Authentication credentials) for sending the E-Mail?
No, it uses the basic mail sending on your machine. Was there a specific reason you switched from Nagios XI?
I PM'ed you.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Core - Problem with E-Mail Notifications

Post by rkennedy »

You'll want to modify your contact definition to be accurate, and not have the email set to nagios@localhost -

Code: Select all

define contact {
	contact_name	nagiosadmin
	alias	Nagios Admin
	service_notification_period	24x7
	host_notification_period	24x7
	service_notification_options	r,w,u,c,f,s
	host_notification_options	r,d,u,f,s
	service_notification_commands	notify-service-by-email
	host_notification_commands	notify-host-by-email
	email	nagios@localhost
	minimum_importance	0
	host_notifications_enabled	1
	service_notifications_enabled	1
	can_submit_commands	1
	retain_status_information	1
	retain_nonstatus_information	1
	}
Former Nagios Employee
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Nagios Core - Problem with E-Mail Notifications

Post by Bone8Head »

The Problem was that in the Contacts files there was a duplicate "notify-host-email". Don't know why nagios didn't tell me that before.

By the way, there is a way to DISABLE only the "Recovery" E-Mails? I need only the Warning - Critical E-Mails.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Core - Problem with E-Mail Notifications

Post by rkennedy »

You'll want to remove the -r flag from your definition. See this -
notification_options: This directive is used to determine when notifications for the host should be sent out. Valid options are a combination of one or more of the following: d = send notifications on a DOWN state, u = send notifications on an UNREACHABLE state, r = send notifications on recoveries (OK state), f = send notifications when the host starts and stops flapping, and s = send notifications when scheduled downtime starts and ends. If you specify n (none) as an option, no host notifications will be sent out. If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states. Example: If you specify d,r in this field, notifications will only be sent out when the host goes DOWN and when it recovers from a DOWN state.
https://assets.nagios.com/downloads/nag ... tions.html
Former Nagios Employee
Bone8Head
Posts: 106
Joined: Tue Nov 10, 2015 2:39 am

Re: Nagios Core - Problem with E-Mail Notifications

Post by Bone8Head »

rkennedy wrote:You'll want to remove the -r flag from your definition. See this -
notification_options: This directive is used to determine when notifications for the host should be sent out. Valid options are a combination of one or more of the following: d = send notifications on a DOWN state, u = send notifications on an UNREACHABLE state, r = send notifications on recoveries (OK state), f = send notifications when the host starts and stops flapping, and s = send notifications when scheduled downtime starts and ends. If you specify n (none) as an option, no host notifications will be sent out. If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states. Example: If you specify d,r in this field, notifications will only be sent out when the host goes DOWN and when it recovers from a DOWN state.
https://assets.nagios.com/downloads/nag ... tions.html
I resolved this, thank you. We can close the thread.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagios Core - Problem with E-Mail Notifications

Post by rkennedy »

Awesome! Closing this out.
Former Nagios Employee
Locked