Do not receive alert email

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.
Locked
NagiosNewbis
Posts: 24
Joined: Thu May 02, 2013 5:13 pm

Do not receive alert email

Post by NagiosNewbis »

Hi;

I changed the "max_check_attempts" to 10 but I do not receive any alert email. I saw the alerts 3 times yesterday then it stopped, I want to continue send alert until the problem solved. So, what should I check here?

define service{
name generic-service ; The 'name' of this service template
active_checks_enabled 1 ; Active service checks are enabled
passive_checks_enabled 1 ; Passive service checks are enabled/accepted
parallelize_check 1 ; Active service checks should be parallelized (disabling this can$
obsess_over_service 1 ; We should obsess over this service (if necessary)
check_freshness 0 ; Default is to NOT check service 'freshness'
notifications_enabled 1 ; Service notifications are enabled
event_handler_enabled 1 ; Service event handler is enabled
flap_detection_enabled 1 ; Flap detection is enabled
failure_prediction_enabled 1 ; Failure prediction is enabled
process_perf_data 1 ; Process performance data
retain_status_information 1 ; Retain status information across program restarts
retain_nonstatus_information 1 ; Retain non-status information across program restarts
is_volatile 0 ; The service is not volatile
check_period 24x7 ; The service can be checked at any time of the day
max_check_attempts 10 ; Re-check the service up to 10 times in order to determine its fin$
normal_check_interval 10 ; Check the service every 10 minutes under normal conditions
retry_check_interval 5 ; Re-check the service every two minutes
contact_groups admins ; Notifications get sent out to everyone in the 'admins' group
notification_options w,u,c,r ; Send notifications about warning, unknown, critical, and recover$
notification_interval 60 ; Re-notify about service problems every hour
notification_period 24x7 ; Notifications can be sent out at any time
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A T$
}
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Do not receive alert email

Post by slansing »

So currently this service will alert you when the following happens:

It reaches a hard Critical, Warning, or Unknown state, or it Recovers.

The service will be checked every 10 minutes, when a problem is detected it will check every 5 minutes instead, once it has re checked the service every 5 minutes, 10 times it will generate a notification.

When it sends a notification, it will send another every 60 minutes until the problem is resolved, or the state changes "at this point the notifications are stopped until it runs through the above again due to a state change."

This could be why you only saw it a handful of times you may want to change some of these settings around to lessen the time it takes to notify you.

Take a look at this page:

http://nagios.sourceforge.net/docs/3_0/ ... tions.html

Under the Directive Descriptions: section you will be able to see all the options available to you, and what they control.
NagiosNewbis
Posts: 24
Joined: Thu May 02, 2013 5:13 pm

Re: Do not receive alert email

Post by NagiosNewbis »

I found that the attempts is 10/10, how can I reset it? i tried to do it under the webpage of Nagios but I got the error like like ...

Error: Could not open command file '/usr/local/nagios/var/rw/nagios.cmd' for update!

The permissions on the external command file and/or directory may be incorrect. Read the FAQs on how to setup proper permissions.

An error occurred while attempting to commit your command for processing.
NagiosNewbis
Posts: 24
Joined: Thu May 02, 2013 5:13 pm

Re: Do not receive alert email

Post by NagiosNewbis »

I disable the retention_status_information, then restart the service, looks like it recheck all service and reset all attempts.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Do not receive alert email

Post by sreinhardt »

Yes clearing retention.dat will remove all check information. 2 questions, was this original issue ever acknowledged or do you have any escalations set for that service?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
NagiosNewbis
Posts: 24
Joined: Thu May 02, 2013 5:13 pm

Re: Do not receive alert email

Post by NagiosNewbis »

after checking the /var/spool/mail/nagios log file, I found that the email was blocked by RBL due to the reply domain is [email protected], but after I changed the host name and the domain in hosts file, I still not able to see my email yet. Also, I cannot see my new nagios mail files in /var/spool/mail generated.

1. I tried to search it but no luck to find such file, where can I locate the nagios mail file again?
2. where can I modify the $CONTACTEMAIL$ variable to show my real email address.
3. Can I test nagios email thru command line.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Do not receive alert email

Post by sreinhardt »

1) This should always be /var/spool/mail/nagios unless your local mta has changed this setting. can you run the following command:

Code: Select all

tail /var/spool/mail/nagios
2)This is the email address variable under each contact.
3) Yes look at the notify-[host\service]-by-email in the commands.cfg file. This will show exactly how nagios core sends email.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked