Page 1 of 1

nagiosxi not generating alerts for me

Posted: Mon Mar 14, 2016 1:18 pm
by aiqbal0612
Hi,
our company is using gmail as mail client.
I have been struggling with nagios alerts.
I have been able to send nagiosxi custom alerts to myself but nagiosxi is not sending alerts automatically to me when a state on some hosts changes.
can some please help me what files to look at and what setting are there that need to be changed

thanks

Re: nagiosxi not generating alerts for me

Posted: Mon Mar 14, 2016 1:27 pm
by rkennedy
Can you please post the host definition for us to look at? You may not have all of the notification_options selected.
notification_options This directive is used to determine when notifications for the host should be sent out. Valid options are a combination of one or more of the following: d = send notifications on a DOWN state, u = send notifications on an UNREACHABLE state, r = send notifications on recoveries (OK state), f = send notifications when the host starts and stops flapping, and s = send notifications when scheduled downtime starts and ends. If you specify n (none) as an option, no host notifications will be sent out. If you do not specify any notification options, Nagios will assume that you want notifications to be sent out for all possible states. Example: If you specify d,r in this field, notifications will only be sent out when the host goes DOWN and when it recovers from a DOWN state.
(https://assets.nagios.com/downloads/nag ... tions.html)

Also - when you go to Home -> Notifications - do you see anything there for that specific host?

Re: nagiosxi not generating alerts for me

Posted: Mon Mar 14, 2016 2:13 pm
by aiqbal0612
Thanks for your reply
Please see my host definition

define host {
host_name XXXXXXXXX
address XXXXXXXXX
check_command check-host-alive!!!!!!!!
initial_state o
max_check_attempts 5
check_interval 5
retry_interval 1
active_checks_enabled 1
check_period 24x7
check_freshness 1
retain_status_information 1
contacts ahsan iqbal
notification_interval 60
notification_period xi_timeperiod_24x7
first_notification_delay 1
notification_options d,u,r,f,
notifications_enabled 1
icon_image redhat.png
statusmap_image redhat.png
_xiwizard linux-server
register 1
}

Re: nagiosxi not generating alerts for me

Posted: Tue Mar 15, 2016 9:54 am
by rkennedy
rkennedy wrote: Also - when you go to Home -> Notifications - do you see anything there for that specific host?
Can you please answer the above? Also, please post the definition for the contact 'ahsan iqbal'.

In your environment, are you using SMTP or sendmail?

Re: nagiosxi not generating alerts for me

Posted: Tue Mar 15, 2016 10:03 am
by bwallace
Thanks for the host definition file = everything looks good there.

Do you see any errors in mail.log (assuming you're using sendmail) or nagios.log around the times you'd expect to receive an alert?
/var/log/mail.log
/usr/local/nagios/var/nagios.log

Also, take a look at the Contact configuration file for 'ahsan iqbal' -- make sure there is not an "n" listed for host_notification_options or for service_notification_options.

If in any doubt, please post all of the sanitized files here so we can have a look.