Page 1 of 1

Email notifications not being sent

Posted: Tue Mar 19, 2013 12:52 pm
by manymiles
I am having problems with my XI installation sending SMTP messages. I know that notifications in general are working because, for a given notice, I get notified by the other Service Notification Command that is set up for my user. I have only set up and am only using the nagiosadmin user.

I attempted to follow the FAQ, but, got not further than:

Code: Select all

2. User's Notification Options...
...From the same page, click on "Notification Methods" and make sure a Notification Method is selected.
When I click "Notification Methods", I get

Code: Select all

Notification Methods

Nagios XI notification handlers are not defined for this account. XI notification handlers must be defined in the Core Config Manager for customized notification settings.
Management of notification preferences is not available for your account. Contact your Nagios XI administrator for details.
I have read this thread
http://support.nagios.com/forum/viewtop ... ed+#p30894
and this doc
http://assets.nagios.com/downloads/nagi ... ntacts.pdf
and THINK I understand what's being discussed but still get the "...handlers are not defined..." message.

This also happens if I click on "Notification Messages" and if I click on "Send Test Notifications", I get

Code: Select all

Send Test Notifications

Testing notification messages is not available for your account. Contact your Nagios XI administrator for details.
This installation of XI was originally on another machine that was a 32bit machine running CentOS 6.3 installed following "XI_Manual_Installation_Instructions.pdf" . Using the backup and restore process (Backing_Up_And_Restoring_XI.pdf), I moved the installation to a Centos 6.2 EC2 64-bit machine.

There is nothing in /var/log/maillog indicating an attempt to send. There is nothing in /var/log/httpd/error_log of any consequence.

Here is the output from System Profile

Code: Select all

Nagios XI Installation Profile

Download Profile
System:

Nagios XI Version : 2012R1.6
ip-10-151-111-132 2.6.32-220.7.1.el6.x86_64 x86_64
CentOS release 6.2 (Final)
Gnome is not installed
Apache Information

PHP Version: 5.3.3
Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22
Server Name: ec2-54-225-243-72.compute-1.amazonaws.com
Server Address: 10.151.111.132
Server Port: 80
Date/Time

PHP Timezone: US/Eastern 
PHP Time: Tue, 19 Mar 2013 13:49:07 -0400
System Time: Tue, 19 Mar 2013 13:49:07 -0400
Nagios XI Data

nagios (pid 7401) is running...
NPCD running (pid 1113).
ndo2db (pid 1346) is running...
CPU Load 15: 1.86 
Total Hosts: 23 
Total Services: 213 
Function 'get_base_uri' returns: http://ec2-54-225-243-72.compute-1.amazonaws.com/nagiosxi/
Function 'get_base_url' returns: http://ec2-54-225-243-72.compute-1.amazonaws.com/nagiosxi/
Function 'get_backend_url(internal_call=false)' returns: http://ec2-54-225-243-72.compute-1.amazonaws.com/nagiosxi/includes/components/profile/profile.php
Function 'get_backend_url(internal_call=true)' returns: http://localhost/nagiosxi/backend/
Ping Test localhost

Running:
/bin/ping -c 3 localhost 2>&1 
PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.042 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.035 ms
64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.033 ms

--- localhost.localdomain ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.033/0.036/0.042/0.008 ms
Test wget To locahost

WGET From URL: http://localhost/nagiosql/index.php 
Running:
/usr/bin/wget http://localhost/nagiosql/index.php 
--2013-03-19 13:49:09-- http://localhost/nagiosql/index.php
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5259 (5.1K) [text/html]
Saving to: `/tmp/nagiosql_index.tmp'

0K ..... 100% 226M=0s

2013-03-19 13:49:09 (226 MB/s) - `/tmp/nagiosql_index.tmp' saved [5259/5259]
Any guidance would be greatly appreciated

Miles

Re: Email notifications not being sent

Posted: Tue Mar 19, 2013 1:15 pm
by abrist
You will need to set up notification commands for the nagiosadmin contact (or any others you may add). Go to the CCM --> contacts --> click on "nagiosadmin". Click on the "Alert Settings" tab.

1. Click the button "Manage Host Notification Commands", choose "xi_host_notification_handler", click add, and then close.
2. Click the button "Manage Service Notification Commands", choose "xi_service_notification_handler", click add, and then close.
3. Save and apply configuration.

Re: Email notifications not being sent

Posted: Tue Mar 19, 2013 2:07 pm
by manymiles
When I went to the manage notifications commands area for both, I had two in there for each:
For host:
ed-notify-host-by-notifry
xi_host_notification_handler

For service:
ed-notify-service-by-notifry
xi_service_notification_handler

ed-notify-*-by-notifry were the notification methods that were working while the email was not working.

I removed all four entries. Did an apply. Then, I was able to properly surf to the "Notifications Methods" page properly. Yay!

Then, I added back only the xi_notification_handler to each, applied and was still able to get to the "Notifications Methods" page. Still Yay!!!

When I added back ed-notify-*-by-notifry, my Notifications Methods page reverted back to "handlers are not defined". :(

I did not actually test the notifications themselves yet. I'll do that once I reremove the ed-notify-*-by-notifry options.

I'll update again when I've completed such and have more findings.

Thanks abrist!



2nd message:



Send Test Notifications are now going out via SMTP. :mrgreen:

When I added back the ed-notify-*-by-notifry, I successfully was getting both email and Notifry notifications!

But, that does create the following:
When I have
ed-notify-host-by-notifry
and
xi_host_notification_handler
set up under "Manage Host Notification Commands" AND
ed-notify-service-by-notifry
and
xi_service_notification_handler
set up under "Manage Service Notification Commands"
I get the "handlers are not defined for this account" message under Notification Methods and Notification Messages
even though notifications seem to be sent just fine.

I'm not sure if that is a bug, or, something I'm not understanding, but, I'm happily able to send notifications.

Also, when I WAS able to get to the "Notification Methods" page, the options to send via SMS and SMTP were not enabled. I guess the restore did not restore that functionality? I'm guessing that the fact those were not enabled was the core issue related to not being able to send notifications.

Thanks again, abrist.

Re: Email notifications not being sent

Posted: Tue Mar 19, 2013 2:45 pm
by lmiltchev
You see this message
Nagios XI notification handlers are not defined for this account. XI notification handlers must be defined in the Core Config Manager for customized notification settings.
because you have multiple notification handlers defined.

You should be able to use only one, and make notifications work.

"Users" in Nagios XI use: xi_host_notification_handler and xi_service_notification_handler, which are the "default" notification handlers.
"Contacts only" use: notify-host-by-email and notify-service-by-email.