I'm not getting an email alerting me that a monitored host is critical. I thought I wasn't understanding inheritance properly so I setup a new host and used the wizard to monitor it using ping. The host isn't in any other groups, and no other templates are applied to it so whatever the host settings are should be what Nagios follows - right?
Nagios XI 2026R1.3
grep enable_notifications /usr/local/nagios/etc/nagios.cfg
enable_notifications=1
define contact {
contact_name SNIP
alias Gagel, Kevin
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period SNIP_notification_times
service_notification_period SNIP_notification_times
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
service_notification_commands check_acknowledgement_notify
email SNIP
use xi_contact_generic
}
###############################################################################
#
# Hosts configuration file
#
# Created by: Nagios CCM 3.1.9
# Date: 2026-03-30 11:23:51
# Version: Nagios Core 4.x
#
# --- 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 NAGIOSTEST.SNIP
address SNIP
check_command check_ping!100.0,50%!110.0,100%!!!!!!
initial_state u
max_check_attempts 1
check_interval 1
retry_interval 1
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
contacts SNIP (contact defined above)
notification_interval 4
notification_period 24x7
notification_options d,u,r,
notifications_enabled 1
icon_image nsclient.png
statusmap_image nsclient.png
_xiwizard nsclient
register 1
}
###############################################################################
#
# Hosts configuration file
#
# END OF FILE
#
###############################################################################
/usr/local/nagios/var/nagios.log
[1774903795] HOST NOTIFICATION: SNIP;NAGIOSTEST.SNIP;DOWN;check_acknowledgement_notify;CRITICAL - Host Unreachable (SNIP)
Not getting email alert
Not getting email alert
Last edited by KWGagel on Tue Mar 31, 2026 10:52 am, edited 2 times in total.
Kevin W. Gagel
Senior Technical Analyst
Canfor
Senior Technical Analyst
Canfor
-
DoubleDoubleA
- Posts: 290
- Joined: Thu Feb 09, 2017 5:07 pm
Re: Not getting email alert
Host settings are an important aspect. https://assets.nagios.com/downloads/nag ... tions.html
Is Nagios configured to send notifications? Is the host sending notifications? If so, is it sending them to you? If so, are you receiving them?
Is Nagios configured to send notifications? Is the host sending notifications? If so, is it sending them to you? If so, are you receiving them?
Re: Not getting email alert
Here is a more complete picture (I've been fighting with Copilot trying to figure out what is wrong):DoubleDoubleA wrote: ↑Mon Mar 30, 2026 2:22 pm Host settings are an important aspect. https://assets.nagios.com/downloads/nag ... tions.html
Is Nagios configured to send notifications? Is the host sending notifications? If so, is it sending them to you? If so, are you receiving them?
grep enable_notifications /usr/local/nagios/etc/nagios.cfg
enable_notifications=1
define contact {
contact_name SNIP
alias Gagel, Kevin
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period SNIP_notification_times
service_notification_period SNIP_notification_times
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
service_notification_commands check_acknowledgement_notify
email SNIP
use xi_contact_generic
}
###############################################################################
#
# Hosts configuration file
#
# Created by: Nagios CCM 3.1.9
# Date: 2026-03-30 11:23:51
# Version: Nagios Core 4.x
#
# --- 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 NAGIOSTEST.SNIP
address SNIP
check_command check_ping!100.0,50%!110.0,100%!!!!!!
initial_state u
max_check_attempts 1
check_interval 1
retry_interval 1
active_checks_enabled 1
passive_checks_enabled 1
check_period 24x7
contacts SNIP (contact defined above)
notification_interval 4
notification_period 24x7
notification_options d,u,r,
notifications_enabled 1
icon_image nsclient.png
statusmap_image nsclient.png
_xiwizard nsclient
register 1
}
###############################################################################
#
# Hosts configuration file
#
# END OF FILE
#
###############################################################################
/usr/local/nagios/var/nagios.log
[1774903795] HOST NOTIFICATION: SNIP;NAGIOSTEST.SNIP;DOWN;check_acknowledgement_notify;CRITICAL - Host Unreachable (SNIP)
Note: the rapid checks above are just for testing purposes. Once this is working to notify me by email, I'll adapt the settings for the targeted set of servers we need to be alerted about.
Kevin W. Gagel
Senior Technical Analyst
Canfor
Senior Technical Analyst
Canfor
Re: Not getting email alert
1. Make sure the Nagios Server has a valid DNS entry
2. In your NagiosXI Settings make sure your "sender" email address for notifications is a valid email address. 3. Watch the logs and see if your error message explains the issue.
NOTE: Use the "test email" settings without having to modify an object to be a canary.
Docs: https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Happy Monitoring!
--SN
2. In your NagiosXI Settings make sure your "sender" email address for notifications is a valid email address. 3. Watch the logs and see if your error message explains the issue.
NOTE: Use the "test email" settings without having to modify an object to be a canary.
Docs: https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Happy Monitoring!
--SN
You do not have the required permissions to view the files attached to this post.
Re: Not getting email alert
Okay, progress. I implemented a check to test if an alert was already acknowledged. If not acknowledged then proceed with the alert otherwise ignore it. I tested this check manually and found the source of the problem.
This should send me an email about the test server because there are no acknowledgements of the issue (its off, so it should be alerting me).
Code: Select all
/usr/local/nagios/libexec/check_acknowledgment.sh "nagiostest" "ping" "notify"Code: Select all
/usr/local/nagios/libexec/check_acknowledgment.sh: line 19: /usr/local/nagios/libexec/send_email_alert.sh: No such file or directory
I'll go through the backup and see if I can find the missing script.
Kevin W. Gagel
Senior Technical Analyst
Canfor
Senior Technical Analyst
Canfor
Re: Not getting email alert
In instances where I use a lot of custom scripts, I create a subdirectory in the working path for XI specifically for those scripts.I recently updated Nagios from Nagios XI 2026R1.1 to R1.3. It was sending alerts, at least up till then.
I'll go through the backup and see if I can find the missing script.
Example:
Code: Select all
/usr/local/nagios/libexec/customCode: Select all
$USER3$=/usr/local/nagios/libexec/customCode: Select all
$USER3$/waketheded.py2. Add directory to backup/import strategies
3. Set enhanced permissions on custom scripts
4. Home python .venv if needed for PEP
--SN
Re: Not getting email alert
Thanks. I'll be sure to do that in the future. For the time being I have restored default Nagios XI behaviour and removed the custom action. I'll rebuild it in the future, and I'll make sure to follow your recommendations.
Kevin W. Gagel
Senior Technical Analyst
Canfor
Senior Technical Analyst
Canfor