nagiosadmin contact not getting notifications.

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

nagiosadmin contact not getting notifications.

Post by Pres-Gas »

Hello,

Our initial rollout of NagiosXI had our nagiosadmin user/contact have Notifications disabled. We continued adding hosts with the

Code: Select all

notifications_enabled           0
set. We are currently running Nagios XI 5.2.3 but these machines started at 5R1.0 with RHEL 6 64 latest updates.

We are now ready to start enabling notifications. We changed

Code: Select all

notifications_enabled
to 1 on all hosts/services and also checked Enable Notifications in the Admin area for the nagiosadmin user. It is not getting notifications nor custom notifications, but we are able to send test emails from the Manage Users page and Mail Settings. The Event Log shows notifications sent but /var/log/maillog does not show messages being sent.

Other users/contacts that we have created are getting notifications for their services, just not the nagiosadmin. Those are in /var/log/maillog along with our test emails from the Manage Users page and Mail Settings.

We looked into the CCM for the nagiosadmin contact (mapped to the nagiosadmin user) and did find that the email definition was set to nagios@localhost where the user was set to a regular email. We changed that setting in the contact to be consistent with the user but still no notifications.

I also noticed the nagiosadmin contact specifies notification commands where the other contacts do not so I removed those to make it consistent with the other contacts and still no notifications. I later found out that the Nagios Core (main) Configuration in the CCM has those set as the global event handler:

Code: Select all

# GLOBAL EVENT HANDLERS
global_host_event_handler=xi_host_event_handler
global_service_event_handler=xi_service_event_handler
So what we have done is pretty much change the contact from this:

Code: Select all

define contact {
	contact_name                  		nagiosadmin
	alias                         		Nagios Administrator
	host_notification_period      		nagiosadmin_notification_times
	service_notification_period   		nagiosadmin_notification_times
	host_notification_options     		d,u,r,f,s
	service_notification_options  		w,u,c,r,f,s
	host_notification_commands    		xi_host_notification_handler
	service_notification_commands 		xi_service_notification_handler
	email                         		nagios@localhost
	use                           		xi_contact_generic
	}	
...to this:

Code: Select all

define contact {
	contact_name                  		nagiosadmin
	alias                         		Nagios Administrator
	host_notification_period      		nagiosadmin_notification_times
	service_notification_period   		nagiosadmin_notification_times
	host_notification_options     		d,u,r,f,s,
	service_notification_options  		w,u,c,r,f,s,
	email                         		[email protected]
	use                           		xi_contact_generic
	}	
Any help on this would be appreciated.

Robert
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: nagiosadmin contact not getting notifications.

Post by hsmith »

Are you using SMTP or Sendmail for this? The maillog will only show sendmail logs.
Former Nagios Employee.
me.
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

Re: nagiosadmin contact not getting notifications.

Post by Pres-Gas »

hsmith wrote:Are you using SMTP or Sendmail for this? The maillog will only show sendmail logs.
We are using sendmail.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nagiosadmin contact not getting notifications.

Post by lmiltchev »

Can you send a "test" email logged in as nagiosadmin user?

Click on the "nagiosadmin" username in the upper-right corner, then click on the "Send Test Notifications" on the left (under the "Notification Options"), and click on "Send Test Notifications". Check to see if you received this test email. Also, check the mail log:

Code: Select all

tail -100 /var/log/maillog
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

Re: nagiosadmin contact not getting notifications.

Post by Pres-Gas »

That went through and is listed in /var/log/maillog however it is not in the event log.

Additionally, I go to a host and send a custom notification from the Advanced tab. I get a notice in the event log, but no log entry in /var/log/maillog

Robert
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: nagiosadmin contact not getting notifications.

Post by lmiltchev »

If you received the "test" notification email, next thing to do would be to test "custom" and actual notifications. Go to Home->Host Detail->localhost->Advanced. Make sure you see a green dot next to "Notifications" under "Host Attributes".

1. Click on "Send Custom Notification", select "Forced", type a comment, and click "Submit"

2. Under the "Advanced" tab, click on the "Disable" action button next to the "Active Checks" to temporarily disable them. Click on the "Submit Passive Check Result", select "Down" from the "Check Result" drop-down menu, type something in the "Check Output" field, and click "Submit". Don't forget to enable active checks for "localhost" after you are done.

3. Go to Home->Notifications and show us a screenshot of this page.

4. Also, run the following command, and show the output in code wraps.

Code: Select all

tail -100 /var/log/maillog
Note: I am assuming that nagiosadmin is added as a monitoring contact to all of your hosts/services, and you haven't removed it from "localhost". You can test this with any other host. This is just an example.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

Re: nagiosadmin contact not getting notifications.

Post by Pres-Gas »

lmiltchev wrote: Note: I am assuming that nagiosadmin is added as a monitoring contact to all of your hosts/services, and you haven't removed it from "localhost". You can test this with any other host. This is just an example.
lmiltchev, you know, I don't think anyone is a contact for localhost. Is that significant?

Code: Select all

###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.4.0
# Date:       2015-10-16 09:46:13
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
        host_name                       localhost
        use                             linux-server
        alias                           localhost
        address                         127.0.0.1
        register                        1
        }       

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################
Regular hosts do have the nagiosadmin contact listed though:

Code: Select all

###############################################################################
#
# Host configuration file
#
# Created by: Nagios Core Config Manager 2.5.2
# Date:       2016-02-11 12:17:12
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND --- 
# Nagios CCM will overwrite all manual settings during the next update if you 
# would like to edit files manually, place them in the 'static' directory or 
# import your configs into the CCM by placing them in the 'import' directory.
#
###############################################################################

define host {
        host_name                       estrain01.uits.iu.edu
        use                             xiwizard_linuxserver_host
        address                         10.234.26.128
        hostgroups                      ESA-Lin-Test,estrain,ictc,ictc-test
        max_check_attempts              5
        check_interval                  10
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        contacts                        nagiosadmin
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        notifications_enabled           1
        icon_image                      redhat.png
        statusmap_image                 redhat.png
        _xiwizard                       linux-server
        register                        1
        }       
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: nagiosadmin contact not getting notifications.

Post by tgriep »

Go in to Core Config Manager > Contacts and edit the nagiosadmin contact.
Go to the Alert Settings tab and enable the Host and Service Notifications.
Save and apply the configuration. That should fix it for you.

Also, you can review this document for configuring Notifications in XI.
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!
Pres-Gas
Posts: 52
Joined: Thu Mar 22, 2012 12:09 pm

Re: nagiosadmin contact not getting notifications.

Post by Pres-Gas »

Apologies for not getting back to this sooner. We performed a work around by changing the notification commands to "notify-*-by-email" from "xi_*_notification_handler" on service and hosts.

This can be closed.
Locked