Not getting Email alerts

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Not getting Email alerts

Postby shamrozkadiwal » Thu Nov 29, 2018 12:17 pm

I have setup a "Disk Space Data" alert for a specific hosts which is supposed to send email alerts for W,C,U and SMS alerts just only for C. SMS alert is working like charm, but we are not getting email alerts. However, I compared the configuration with other hosts which are sending email alerts, and didn't find any errors or differences.

I have attached the doc which can give you host and service details.

Sample Server: adx800
Issuer Server: adxp011a

W = warning
C = Critical
U = Unknown
Attachments
Service_Info.txt
(2.43 KiB) Downloaded 19 times
Host_Info.docx
(12.09 KiB) Downloaded 11 times
shamrozkadiwal
 
Posts: 42
Joined: Thu Jan 25, 2018 1:13 am

Re: Not getting Email alerts

Postby benjaminsmith » Thu Nov 29, 2018 3:57 pm

Hello @shamrozkadiwal

Let's verify that you are able to send and receive a custom service notification for the Disk Space Data service. From the Nagios Core homepage go to Services > Find the adxp011a server > click on Disk Space Data > Send Custom Service Notification. Let me know if this is working or not.

Can you send over the contact/contact group definitions, and the definition for the generic-data host template. Also are there any error messages in the mail log for errors /var/log/maillog. Thank you.
User avatar
benjaminsmith
 
Posts: 241
Joined: Wed Aug 22, 2018 4:39 pm

Re: Not getting Email alerts

Postby shamrozkadiwal » Mon Dec 03, 2018 10:26 am

Hey Benjamin,

You asked me couple of things. First, I have attached the contact.cfg file and paste generic-data host template.

Code: Select all
# TEMPLATE
define host{
        name                    generic-data
        hostgroups              data-servers
        check_command           check-host-alive
        check_period            24x7
        max_check_attempts      10
        notification_options    d,u,r
        notification_interval   90
        notification_period     no-sun
        parents                 aus-fwv-wh-5540a
        contact_groups          ets-pager
        register                0
}


Second, I tried Custom Service Notification and it worked. I mean I received the email [Picture attached]. However, If you noticed that I sent another picture of my inbox which indicates that I had never received adxp011a alert email before , so It means email part is working when we commit service notification.

In addition, I didn't find any errors in the /var/log/maillog, but I found few records after I ran the Custom Service Notification with no errors.

Thanks,
Attachments
Capture.JPG
Email received after I sent custom notification service
Search.JPG
Search Inbox
Contacts.txt
(14.02 KiB) Downloaded 7 times
shamrozkadiwal
 
Posts: 42
Joined: Thu Jan 25, 2018 1:13 am

Re: Not getting Email alerts

Postby benjaminsmith » Mon Dec 03, 2018 2:41 pm

Hello @shamrozkadiwal,

To summarize:

1. You receive the correct SMS notifications for disk space data on adxp011a
2. You are not receiving the correct email notification for disk space data on adxp011a.
3. You are able to send a Customer Service Notification, so email is working.

There's an error somewhere in the configuration definitions. For the hostgroup, data-servers, can you verify the notification period is correct? You have no-sun set, but the generic-contact template is set for 24x7 notification period. Also, take a look at the generic-data template for any issues.
User avatar
benjaminsmith
 
Posts: 241
Joined: Wed Aug 22, 2018 4:39 pm

Re: Not getting Email alerts

Postby shamrozkadiwal » Tue Dec 04, 2018 11:45 am

1. You receive the correct SMS notifications for disk space data on adxp011a YES
2. You are not receiving the correct email notification for disk space data on adxp011a. YES
3. You are able to send a Customer Service Notification, so email is working. YES

I checked these two below files for notification setting, but found only in one file.

/etc/nagios/host/hostgroups.cfg
Code: Select all
define hostgroup{
        hostgroup_name  data-servers
        alias           Data Servers
}


/etc/nagios/host/data.cfg
Code: Select all
# TEMPLATE
define host{
        name                    generic-data
        hostgroups              data-servers
        check_command           check-host-alive
        check_period            24x7
        max_check_attempts      10
        notification_options    d,u,r
        notification_interval   90
        notification_period     no-sun
        parents                 aus-fwv-wh-5540a
        contact_groups          ets-pager
        register                0
}


I don't see any errors or issue, but not sure why we are not getting emails for adxp011a. Whereas sample server (adx800) has the same setting, host and service groups and it is getting all kind of alerts.
shamrozkadiwal
 
Posts: 42
Joined: Thu Jan 25, 2018 1:13 am

Re: Not getting Email alerts

Postby benjaminsmith » Tue Dec 04, 2018 2:49 pm

Please verify your configuration by running the following command and post any errors or warning messages:
Code: Select all
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

You have 3 different service definitions for Disk Space Data, and this can be problematic as no two services associated with the same host can have the same description. Services are uniquely identified with their host_name and service_description directives.
https://assets.nagios.com/downloads/nag ... ml#service
User avatar
benjaminsmith
 
Posts: 241
Joined: Wed Aug 22, 2018 4:39 pm

Re: Not getting Email alerts

Postby shamrozkadiwal » Wed Dec 05, 2018 12:59 pm

Please find the attached file
Attachments
nagios_check.txt
(23.43 KiB) Downloaded 6 times
shamrozkadiwal
 
Posts: 42
Joined: Thu Jan 25, 2018 1:13 am

Re: Not getting Email alerts

Postby benjaminsmith » Wed Dec 05, 2018 3:48 pm

Hello shamrozkadiwal,

Let's change the debug level settings to capture notification data, and then put adxp011a into a down state and then back up (recovery state). We will then take a look at the log file for this host and review the state changes and whether or not notifications were sent.

1. Open up the nagios configuration file /usr/local/nagios/etc/nagios.cfg, and set debug_level=32, and then re-start Nagios.

2. Put the adxpo11a into a down state and then a recovery.

2. Post or PM the nagios log data or the contents of the log file at /usr/local/nagios/var
nagios.log
. You'll want to search the log data for host notification entries for adxp011a. The perl statement at the end will convert the unix timestamp into human readable text. Are notifications beings sent? If so, to the correct contacts?
Code: Select all
cat nagios.log | grep adxp011a  |  perl -pe 's/(\d+)/localtime($1)/e'

Let me know what you find out.

Main Configuration File Options
https://assets.nagios.com/downloads/nag ... gmain.html
User avatar
benjaminsmith
 
Posts: 241
Joined: Wed Aug 22, 2018 4:39 pm

Re: Not getting Email alerts

Postby lmiltchev » Wed Dec 05, 2018 4:47 pm

@shamrozkadiwal, can you zip up the /usr/local/nagios directory and PM the zip file to me or any other member of the Nagios Support team? Thank you!
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
QA Manager
 
Posts: 11239
Joined: Mon May 23, 2011 12:15 pm

Re: Not getting Email alerts

Postby shamrozkadiwal » Fri Dec 07, 2018 12:16 pm

lmiltchev wrote:@shamrozkadiwal, can you zip up the /usr/local/nagios directory and PM the zip file to me or any other member of the Nagios Support team? Thank you!

Please check your inbox
shamrozkadiwal
 
Posts: 42
Joined: Thu Jan 25, 2018 1:13 am

Next

Return to Nagios Core

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 22 guests