Hi,
Perfect, thank you. The host and service configurations look good, but I noticed some of the contacts have different motivation handlers. Depending on how you have
configured the SMS alerts, this would cause a different behavior between the contacts assigned the services (associated with this host).
For example, this contact has the default xi notification handlers set.
Code: Select all
define contact {
contact_name stefanc
service_notification_period stefanc_notification_times
host_notification_period stefanc_notification_times
service_notification_options r,w,u,c,f,s
host_notification_options r,d,u,f,s
service_notification_commands xi_service_notification_handler
host_notification_commands xi_host_notification_handler
While this contact has those handlers plus the default core commands (Sendmail) along with SMS notification handlers.
Code: Select all
define contact {
contact_name erico
service_notification_period xi_timeperiod_24x7
host_notification_period xi_timeperiod_24x7
service_notification_options r,w,u,c,f,s
host_notification_options r,d,u,f,s
service_notification_commands xi_service_event_handler,service-notify-by-sms,notify-service-by-email
host_notification_commands xi_host_event_handler,notify-host-by-email,Host-notify-by-sms
After making changes, you can test the notifications by sending passive check results to the service and forcing a notification by putting the service in a non-ok state ( see below). Run the following command to watch the nagios.log and mail logs for the appropriate entries.
Code: Select all
tail -F /var/log/maillog /usr/local/nagiosxi/tmp/phpmailer.log /usr/local/nagiosxi/var/eventman.log
passive-checks.png
How to submit passive results for testing:
For Hosts
------------
Go to Home > Service Status:
- Find the Service and click on it
- Click the + tab
- Click the "Submit passive check result" link
- Select the Check Result and type in some text for the Check Output
- Click the Submit button
NOTE: By default, passive_host_checks_are_soft=0 is set in your /usr/local/nagios/etc/nagios.cfg, this differs from services in that when you submit a passive host check result it immediately goes into a HARD state (and should send a notification if configured to) instead of going into a SOFT state like services do. (notifications are only sent on HARD states).
For Services
----------------
Go to Home > Service Status:
- Find the Service and click on it
- Click the + tab
- Note these two rows:
State Type: Hard
Current Check: 1 of 4
Those columns tell the current State Type and the Current Check number. In order to generate a notification for a service, you will need to submit MULTIPLE problem check results (the number that you need to submit is determined by the last number in the Current Check column, which is the max_check_attempts setting). For services, when you submit a passive check result, each result that you submit will be a SOFT state until you submit enough to hit the Max Check Attempts setting that you've defined on the service, only then will the service enter a HARD problem state which will generate the notification (just remember, notifications are only sent on HARD states).
- Click the "Submit passive check result" link
- Select the Check Result and type in some text for the Check Output
- Click the Submit button
- Submit as many as you need, right after another, until the service enters the HARD state so that a notification will be sent