Page 1 of 1

Do not receive alert email

Posted: Thu May 23, 2013 2:35 pm
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$
}

Re: Do not receive alert email

Posted: Thu May 23, 2013 3:18 pm
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.

Re: Do not receive alert email

Posted: Thu May 23, 2013 5:26 pm
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.

Re: Do not receive alert email

Posted: Thu May 23, 2013 5:32 pm
by NagiosNewbis
I disable the retention_status_information, then restart the service, looks like it recheck all service and reset all attempts.

Re: Do not receive alert email

Posted: Fri May 24, 2013 12:20 pm
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?

Re: Do not receive alert email

Posted: Fri May 24, 2013 5:04 pm
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.

Re: Do not receive alert email

Posted: Tue May 28, 2013 12:56 pm
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.