Page 1 of 2

Email alerts not send for a new contact

Posted: Mon Apr 21, 2014 11:37 am
by SistemesLRC
Hello:

We add another contact to nagios to send email alerts to another email account , when was created the new user we received an email confirmation from Nagios in the user mailbox (the email domain is different like the nagiosadmin email account domain).

We add the user to contacts and setiing the email alerts for host and services in a sever test, but the alerts only arrive to the original nagiosadmin email account, not arrive at the new user.

The settings in the alert settings tab are copy form the nagiosadmin settings.

We need the alert email arrives to both accounts.

Re: Email alerts not send for a new contact

Posted: Mon Apr 21, 2014 12:17 pm
by lmiltchev
Go to CCM->Contacts->click on the "View Text Config" action button, and show us the contact definition (hide sensitive info).

BTW, can you run the following command:

Code: Select all

echo 'select * from xi_users;' | psql nagiosxi nagiosxi | grep <put user's name in here>
and compare the email you see to the one in the config file.

Re: Email alerts not send for a new contact

Posted: Tue Apr 22, 2014 2:47 am
by SistemesLRC

Code: Select all

user_id |  username   |             password             |  name  |          email          |       backend_ticket      | enabled
---------+-------------+----------------------------------+--------+-------------------------+---------------------------------------------------------------
      49 | jrey        | 125bccb62bdxxxxxxxxxxxxxxxxxxxxx | Javier | [email protected]           | xxxxxxxxx                 |   1

Re: Email alerts not send for a new contact

Posted: Tue Apr 22, 2014 9:06 am
by tmcdonald
Did you X out all those fields or is it actually displaying that for some reason? lmiltchev was asking you to compare the email in the output of that command to the one in your config file.

Re: Email alerts not send for a new contact

Posted: Tue Apr 22, 2014 9:18 am
by SistemesLRC
The X is sensitive information , I only replace the real values for "X" , the user is added correctly in the SQL database"

Re: Email alerts not send for a new contact

Posted: Tue Apr 22, 2014 9:22 am
by SistemesLRC
The email is correct.

Re: Email alerts not send for a new contact

Posted: Tue Apr 22, 2014 12:33 pm
by lmiltchev
Go to:

Core Config Manager->Hosts->View Text Config and copy/paste the config of the "test" host

Core Config Manager->Contacts->View Text Config and copy/paste the config of the contact in question

Note: Hide sensitive info.

Re: Email alerts not send for a new contact

Posted: Wed Apr 23, 2014 2:16 am
by SistemesLRC
The relevant information about host, service and contact in text file.

###############################################################################
#
# Host configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2014-04-23 09:13:02
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define host {
host_name LRXXXXX
use xiwizard_windowsserver_host
alias BCK_VC_ESX_5_XXX
address 192.168.XXX.XXX
max_check_attempts 5
check_interval 5
retry_interval 1
check_period xi_timeperiod_24x7
contacts jrey,nagiosadmin
contact_groups admins
notification_interval 60
notification_period xi_timeperiod_24x7
notification_options d,r,f,
notifications_enabled 1
icon_image win_server.png
statusmap_image win_server.png
_xiwizard windowsserver
register 1
}

###############################################################################
#
# Host configuration file
#
# END OF FILE
#
###############################################################################

define service {
host_name LRXXXX
service_description Drive E: Disk Usage
use xiwizard_windowsserver_nsclient_service
check_command check_xi_service_nsclient!!USEDDISKSPACE!-l E -w 80 -c 95!!!!!
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_interval 60
first_notification_delay 0
notification_period xi_timeperiod_24x7
notification_options w,u,r,c,f,s
notifications_enabled 1
contacts jrey,nagiosadmin
contact_groups admins
_xiwizard windowsserver
register 1
}

###############################################################################
#
# Contact configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date: 2014-04-23 09:17:30
# Version: Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define contact {
contact_name jrey
alias XXXX
contactgroups admins,xi_contactgroup_all
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period nagiosadmin_notification_times
service_notification_period nagiosadmin_notification_times
host_notification_options d,u,r,
service_notification_options w,c,r,
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
email [email protected]
}

Re: Email alerts not send for a new contact

Posted: Wed Apr 23, 2014 9:59 am
by lmiltchev
It seems you changed the "default" notification handlers. In the contact's definition, you have:

Code: Select all

host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
Try changing it to:

Code: Select all

host_notification_commands    		xi_host_notification_handler
service_notification_commands 		xi_service_notification_handler
Let me know if this fixed your issue.

Re: Email alerts not send for a new contact

Posted: Mon Apr 28, 2014 1:16 am
by SistemesLRC
The change fixed the error, we received the alarms email now.
Thank you