Page 1 of 1
5 minute notifications
Posted: Sat Dec 01, 2018 11:26 am
by t3dus
What's the best way for me to set notifications for all hosts to 5 minutes?
We currently have a server and 1 site down but nagios has quit sending out notifications for some unknown reason and this is pretty frustrating.
Re: 5 minute notifications
Posted: Mon Dec 03, 2018 5:09 pm
by ssax
You would want to set notification_interval to 5 on them:
notification_interval: This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still down or unreachable. Unless you've changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this host - only one problem notification will be sent out.
What does your objects.cache show for the host/service that isn't continuing to notify? Please post the definition.
Re: 5 minute notifications
Posted: Mon Dec 03, 2018 5:20 pm
by t3dus
ssax wrote:You would want to set notification_interval to 5 on them:
notification_interval: This directive is used to define the number of "time units" to wait before re-notifying a contact that this service is still down or unreachable. Unless you've changed the interval_length directive from the default value of 60, this number will mean minutes. If you set this value to 0, Nagios will not re-notify contacts about problems for this host - only one problem notification will be sent out.
What does your objects.cache show for the host/service that isn't continuing to notify? Please post the definition.
This is one of the definitions for the host that failed to continue to notify. It only told us about it maybe 3 times tops and then stopped all together.
Code: Select all
define service{
service_description HTTP
check_command custom_check_http
use generic-service
host_name webissues.foodchainid.com
notifications_enabled 1
check_freshness 1
check_interval 5
notification_interval 5
}
Re: 5 minute notifications
Posted: Mon Dec 03, 2018 5:27 pm
by ssax
Please post the service definition from your /usr/local/nagios/var/objects.cache so that we can see the final calculated service definition.
Re: 5 minute notifications
Posted: Mon Dec 03, 2018 5:32 pm
by t3dus
ssax wrote:Please post the service definition from your /usr/local/nagios/var/objects.cache so that we can see the final calculated service definition.
I think this is what you are after?
Code: Select all
define host {
host_name webissues.foodchainid.com
alias webissues.foodchainid.com
address webissues.foodchainid.com
parents webissues
check_period 24x7
check_command check-host-alive
contact_groups sysadmins
notification_period workhours
initial_state o
importance 0
check_interval 5.000000
retry_interval 1.000000
max_check_attempts 10
active_checks_enabled 1
passive_checks_enabled 1
obsess 1
event_handler_enabled 1
low_flap_threshold 0.000000
high_flap_threshold 0.000000
flap_detection_enabled 1
flap_detection_options a
freshness_threshold 0
check_freshness 1
notification_options r,d,u
notifications_enabled 1
notification_interval 5.000000
first_notification_delay 0.000000
stalking_options n
process_perf_data 1
icon_image internet.gif
statusmap_image internet.gd2
retain_status_information 1
retain_nonstatus_information 1
}
Re: 5 minute notifications
Posted: Mon Dec 03, 2018 5:52 pm
by scottwilkerson
This should send notifications every 5 minutes, but only during the time period
workhours
If this is not all the times you want you would need to change the notification_period to be one that covers all of the desired times (like 24x7)
Re: 5 minute notifications
Posted: Mon Dec 03, 2018 5:54 pm
by t3dus
Yeah after I saw "workhours" I knew what the issue was instantly. Thanks for the advice.
Re: 5 minute notifications
Posted: Tue Dec 04, 2018 8:26 am
by scottwilkerson
t3dus wrote:Yeah after I saw "workhours" I knew what the issue was instantly. Thanks for the advice.
Great!
Locking thread