Page 1 of 2
Nagios XI Mail delivery
Posted: Fri Mar 20, 2015 1:57 pm
by emartine
What is the best way to tell that nagios has failed to deliver a notification? I'm noticing that notifications are going out to folks but I am being told that they never received the alerts. Checking to ensure that their contact information was correct was the first think I am doing, pending the accuracy of that, is there a way to tell if delivery has failed to the recipients?
Re: Nagios XI Mail delivery
Posted: Fri Mar 20, 2015 2:12 pm
by tgriep
If you are using sendmail / postfix on the nagios server, you can check the following log file for errors.
If you using SMTP to send email from the nagios server, you would have to check the SMTP server's error logs.
Re: Nagios XI Mail delivery
Posted: Wed Mar 25, 2015 3:20 pm
by emartine
If I have a contact that doesn't have an account will they receive notifications?
Re: Nagios XI Mail delivery
Posted: Wed Mar 25, 2015 3:26 pm
by jdalrymple
That depends on what you mean by "receive"
A notification is just Nagios running a command. If the command that you specify for that particular contact (it is a contact object directive) is as follows:
then yes they will "receive" a notification. Similarly if the command is:
That notification will take place and that command will be run - however no person will actually "receive" anything.
Does this make sense?
Re: Nagios XI Mail delivery
Posted: Wed Mar 25, 2015 4:02 pm
by emartine
I get the alerts when I send through the command line individually. So I guess there may be something wrong with the contact I've created.
In core under Reports --> NOTIFICATIONS I see that the contacts i've created were apparently getting alerts but when I check our mail server logs only those with XI accounts are getting emails. Those contacts with no account are not.
I switched the settings to use Sendmail Instead of SMTP and looked at /var/log/maillog sure enough I noticed that it was only sending to those contacts that had accounts. even though Reports said contacts too. Accounts never received pages however and this concerns me. Are Accounts setup as contacts not supposed to receive both email and page if configured?
I created the following contact and Service
ACCOUNT
COMMON SETTINGS
Contact Name
testcontact
Description
testcontact
Email address
mine@mymailbox
pager number
mypager@mycompany
Active is Checked
ALERT SETTINGS
Host Notifications Enabled
24x7 Time period
Host notification options
d u r f
Host notification command
xi_host_notification_handler
retain status information
ON
Retain Non-status information
ON
Service Notifications Enabled
ON
Service Notifications Timeperiod
24x7 Time period
Service notification Options
u c f r
Service notification command
xi_service_notification_handler
Can Submit Commands
ON
HOST SETTINGS
Hostname
testserver
Description
testserver
address
testserver
displayname
testserver
Check Command
check-host-alive
Check Settings
Check interval min 1
Retry interval min 1
Max check attempts 1
Active checks enabled
ON
Passive checks enabled
OFF
Check period *
xi_timeperiod_24x7
Freshness threshold
300 sec
Check freshness on off skip null
ON
Flap detection enabled
ON
Flap detection options
d o u
Retain status information
ON
Retain non-status information
ON
Process perf data
ON
Alert Settings
Manage contacts --> testcontact
Notification period
xi_timepriod_24x7
Notification options:
d u r f
Notification interval min
30
First notification delay min
0
Notifications enabled:
ON
Re: Nagios XI Mail delivery
Posted: Wed Mar 25, 2015 4:05 pm
by emartine
Nagios XI 2014R2.6 is the version I am using.
Re: Nagios XI Mail delivery
Posted: Wed Mar 25, 2015 4:20 pm
by jdalrymple
Your contact notification commands have to match up with the type of mail service you're trying to use.
If using sendmail - use notify-service-by-email
If using snmp - use xi_service_notification_handler
Review this document:
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
Particularly the bit about Notification Commands
Re: Nagios XI Mail delivery
Posted: Wed Mar 25, 2015 4:56 pm
by emartine
yes they do match.
using smtp and xi_service_notification_handler and xi_host_notification_handler
Re: Nagios XI Mail delivery
Posted: Wed Mar 25, 2015 5:06 pm
by tgriep
This is from the manual
If you are using Users, which are also Contacts (you've added a Contact to them),
select: xi_host_notification_handler (via the Manage Host Notification Commands button)
and
xi_service_notification_handler (via the Manage Service Notification Commands button)
If you are using Contacts only, select:
notify-host-by-email (via the Manage Host Notification Commands button)
and
notify-service-by-email (via the Manage Service Notification Commands button)
There is another way to setup notifications. Here is the link to it.
http://assets.nagios.com/downloads/nagi ... Mailer.pdf
Re: Nagios XI Mail delivery
Posted: Wed Mar 25, 2015 5:38 pm
by emartine
I am using a mixture of both accounts with contacts and contacts only. So just to be clear. I have a service where I want
Entity 1:
Account userAaccount
Contact userAacount
Which uses:
use xi_service_notification_handler
use xi_host_notification_handler
and
Entity2:
Contact userBcontactonly
Should be using
notify-service-by-email
notify-host-by-email
I want both to receive notifications. Entity 1 should receive email and pager but at this time does not get pages only email.
Per what you just sent me I can't use entity 2 with entity 1. Is this correct?