Notifications not being sent

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
cunningrat
Posts: 29
Joined: Mon Nov 18, 2013 5:51 pm

Notifications not being sent

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Notifications not being sent

Post 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
cunningrat
Posts: 29
Joined: Mon Nov 18, 2013 5:51 pm

Re: Notifications not being sent

Post 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?
cunningrat
Posts: 29
Joined: Mon Nov 18, 2013 5:51 pm

Re: Notifications not being sent

Post by cunningrat »

Nevermind my earlier post, I misread what you said.

Email notification handlers have been changed. Still not sending out notifications. :(
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Notifications not being sent

Post by abrist »

Do you send through an smtp mail relay? If so, do you use authentication?
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.
cunningrat
Posts: 29
Joined: Mon Nov 18, 2013 5:51 pm

Re: Notifications not being sent

Post 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?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Notifications not being sent

Post 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.
cunningrat
Posts: 29
Joined: Mon Nov 18, 2013 5:51 pm

Re: Notifications not being sent

Post 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.)
Last edited by cunningrat on Fri Feb 28, 2014 12:39 pm, edited 2 times in total.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Notifications not being sent

Post 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.
Former Nagios employee
cunningrat
Posts: 29
Joined: Mon Nov 18, 2013 5:51 pm

Re: Notifications not being sent

Post 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?
Locked