Page 1 of 2

Notifications not being sent

Posted: Thu Feb 27, 2014 4:52 pm
by cunningrat
I have a configuration that's been working for months, and sending me email. I attempted to add a second contact that sends me an SMS through an email gateway. I am not receiving them, and the Nagios log shows they're not being sent out.

I'm using the latest version of XI.

Contact definition
define contact {
contact_name elliot-page
alias Elliot
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period xi_timeperiod_24x7
service_notification_period xi_timeperiod_24x7
host_notification_options d,u,r,f,s,n,
service_notification_options w,u,c,r,f,s,n,
host_notification_commands xi_host_notification_handler
service_notification_commands xi_service_notification_handler
email [email protected]
use xi_contact_generic
}

Host definition:
define host {
host_name aix61_test
use xiwizard_linuxserver_host
address XXX.XXX.XXX.XXX
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts elliot-page,nagiosadmin
notification_interval 60
notification_period xi_timeperiod_24x7
notifications_enabled 1
icon_image aix.png
statusmap_image aix.png
_xiwizard sshproxy
register 1
}

Extract from the Nagios log:
[1393535742] SERVICE FLAPPING ALERT: aix61_test;Errpt log;STOPPED; Service appears to have stopped flapping (3.8% change < 5.0% threshold)
[1393535742] SERVICE NOTIFICATION: nagiosadmin;aix61_test;Errpt log;FLAPPINGSTOP (OK);xi_service_notification_handler;ERRPT OK: last check 15:04 Feb 27 2014.

Any ideas?

Re: Notifications not being sent

Posted: Thu Feb 27, 2014 5:10 pm
by slansing
The first thing that I noticed is that if you are using only a contact, and not a user, you need to change your email handlers as described here:

http://assets.nagios.com/downloads/nagi ... ations.pdf

Re: Notifications not being sent

Posted: Thu Feb 27, 2014 5:15 pm
by cunningrat
What I want to do, though, is to eventually change it so that the email notifications continue 24x7 and the text notifications (which are also going over an email interface) only arrive during off-hours. There is (AFAIK) no way to do that with a user contact?

Re: Notifications not being sent

Posted: Thu Feb 27, 2014 5:51 pm
by cunningrat
Nevermind my earlier post, I misread what you said.

Email notification handlers have been changed. Still not sending out notifications. :(

Re: Notifications not being sent

Posted: Thu Feb 27, 2014 6:00 pm
by abrist
Do you send through an smtp mail relay? If so, do you use authentication?

Re: Notifications not being sent

Posted: Fri Feb 28, 2014 11:36 am
by cunningrat
abrist wrote:Do you send through an smtp mail relay? If so, do you use authentication?
Abrist, that's not the issue. The issue is that I don't see Nagios *sending out* the notifications to that contact. When I look in the log, I see Nagios sending out a notification to "nagiosadmin", but not to "elliot-page"....

... unless Nagios only logs the notification line if that email has been sent correctly? Is that the case?

Re: Notifications not being sent

Posted: Fri Feb 28, 2014 11:48 am
by slansing
Can you post the service definition that you have elliot-page attached to as well? It looks like the nagios log snip that you posted was from a service.

Re: Notifications not being sent

Posted: Fri Feb 28, 2014 12:32 pm
by cunningrat
slansing wrote:Can you post the service definition that you have elliot-page attached to as well? It looks like the nagios log snip that you posted was from a service.
I don't have elliot-page attached to any services. It was my impression that allocating contacts to a host would also make them contacts for any services on that host, but now that I think about it, that wouldn't necessarily be the case. And if that's not the case, there's my problem right there...

EDIT: checked the docs. The service is supposed to inherit the host contacts?

In either case, here's the service definition.

define service {
host_name aix61_test,che-prd
service_description Errpt log
use generic-service
display_name Errpt log
check_command check_xi_by_ssh!-C "/home/nagios/scripts/ready/check_aix_errpt.pl"!!!!!!!
max_check_attempts 1
flap_detection_enabled 0
notification_period xi_timeperiod_24x7
notification_options w,c,u,r,f,s,
notifications_enabled 1
register 1
}

(Yes, max_check_attempts are supposed to be 1, and flap detection is supposed to be 0, that's not an error for this service.)

Re: Notifications not being sent

Posted: Fri Feb 28, 2014 12:37 pm
by tmcdonald
That is correct - a service will not inherit contacts from its host. Go ahead and test things out with this new knowledge and let us know how it turns out.

Re: Notifications not being sent

Posted: Fri Feb 28, 2014 12:44 pm
by cunningrat
Wunderbar.

So, I have 60 services defined. Any way to batch-modify them? Or am I stuck with modifying each one by hand?