Not getting Email alerts

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Not getting Email alerts

Post by shamrozkadiwal »

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 219 times
Host_Info.docx
(12.09 KiB) Downloaded 176 times
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Not getting Email alerts

Post by benjaminsmith »

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.
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!
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Re: Not getting Email alerts

Post by shamrozkadiwal »

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
Email received after I sent custom notification service
Email received after I sent custom notification service
Search Inbox
Search Inbox
Contacts.txt
(14.02 KiB) Downloaded 205 times
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Not getting Email alerts

Post by benjaminsmith »

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.
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!
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Re: Not getting Email alerts

Post by shamrozkadiwal »

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.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Not getting Email alerts

Post by benjaminsmith »

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
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!
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Re: Not getting Email alerts

Post by shamrozkadiwal »

Please find the attached file
Attachments
nagios_check.txt
(23.43 KiB) Downloaded 210 times
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Not getting Email alerts

Post by benjaminsmith »

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
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
Former Nagios Staff
Posts: 13587
Joined: Mon May 23, 2011 12:15 pm

Re: Not getting Email alerts

Post by lmiltchev »

@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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
shamrozkadiwal
Posts: 74
Joined: Thu Jan 25, 2018 1:13 am

Re: Not getting Email alerts

Post by shamrozkadiwal »

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
Locked