define service {
name passive_service
service_description Passive Service
check_command core_check_dummy!0!"No data received yet."!!!!!!
is_volatile 1
initial_state o
max_check_attempts 1
active_checks_enabled 0
passive_checks_enabled 1
flap_detection_enabled 0
contact_groups admins
stalking_options o,w,c,u
register 0
}
Set host notification
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: Set host notification
We service definition as below, this is useful to achieve expected alarms.
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Set host notification
Hi @sandeeptail,
Make sure you have freshness enabled in the main configuration file. Also, check_dummy with a 0 argument will return OK state? Is this what you want?
Make sure you have freshness enabled in the main configuration file. Also, check_dummy with a 0 argument will return OK state? Is this what you want?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: Set host notification
I am confuse, above template set for service check, how can use for host down as explained before.
What you mean by main configuration.
What you mean by main configuration.
Re: Set host notification
You will need two checks - one for the host and one for the service. The host check is an active check and would be what you have already:
The second check will be a passive check and look like:
The freshness_threshold will cause the check_command(check_dummy in this case) to run if a passive result isn't received within the last 5 minutes.
Does this help?
Code: Select all
define host{
host_name new-host
alias Sample Host Config
address 192.168.1.10
check_command check-host-alive
check_interval 15
max_check_attempts 1
check_period 24x7
process_perf_data 0
retain_nonstatus_information 0
contact_groups network-admins
notification_interval 30
notification_period 24x7
notification_options d,u,r
active_checks_enabled 1
passive_checks_enabled 1
notifications_enabled 1
flap_detection_enabled 0
event_handler_enabled 1
process_perf_data 1
}
Code: Select all
define service {
host_name new-host
service_description Passive Service
check_command check_dummy!0!"No data received yet."!!!!!!
is_volatile 1
initial_state o
max_check_attempts 1
active_checks_enabled 0
passive_checks_enabled 1
flap_detection_enabled 0
contact_groups admins
stalking_options o,w,c,u
register 0
freshness_threshold 300
}
Does this help?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: Set host notification
Please confirm this change will not impact on existing service monitoring flow. Service monitoring shared as before.
Re: Set host notification
These are separate configuration files and shouldn't have an impact on other configurations.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: Set host notification
Will check this configuration,
Below definition first show, SOFT sate and alert after 15 min.
1) Server down alarm in 1 min (Hard State)
2) recheck every 15 minutes.
3) If server still down repeat alarm after 30 minutes.
Below definition first show, SOFT sate and alert after 15 min.
Except below flow,define host{
name passive_host
check_interval 1
max_check_attempts 1
retry_interval 15
check_period 24x7
notification_options d,u,r
active_checks_enabled 1
passive_checks_enabled 1
register 0
}
1) Server down alarm in 1 min (Hard State)
2) recheck every 15 minutes.
3) If server still down repeat alarm after 30 minutes.
Re: Set host notification
retry_interval does not apply to passive checks. With max_check_attempts set to 1 it will send a notifications for down, unreachable, and and recoveries(notification_options). "notification_period 30" needs to be added to send notifications every 30 minutes for this check.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 211
- Joined: Tue Dec 27, 2016 3:12 am
Re: Set host notification
Below host template configured in template.cfg. After set this, host monitoring is flapping and 20-30 host frequently up and down among 500 hosts.
Need your help to fix the flapping host issue.
Except below flow,
1) Server down alarm in 1 min (Hard State)
2) recheck every 15 minutes.
3) If server still down repeat alarm after 30 minutes.
Need your help to fix the flapping host issue.
define host {
name generic-host
max_check_attempts 5
check_interval 5
check_period 24x7
event_handler_enabled 1
flap_detection_enabled 0
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_interval 30
notification_period 24x7
notifications_enabled 1
contact_groups admins
register 0
}
######################################################################
# Core passive host template
define host {
name passive_host
use generic-host
max_check_attempts 15
check_interval 1
active_checks_enabled 0
passive_checks_enabled 1
check_period 24x7
check_freshness 1
freshness_threshold 60
register 0
}
Except below flow,
1) Server down alarm in 1 min (Hard State)
2) recheck every 15 minutes.
3) If server still down repeat alarm after 30 minutes.
Re: Set host notification
Flapping has a specific meaning in Nagios:
https://assets.nagios.com/downloads/nag ... pping.html
flap_detection_enabled is currently disabled on the host so you'll receving notification each time there is a state change. You can enable it by setting it:
To find out why it is changing states you'll need to look into the checks and see why they may be going from OK to WARNING or CRITICAL and address that.
https://assets.nagios.com/downloads/nag ... pping.html
flap_detection_enabled is currently disabled on the host so you'll receving notification each time there is a state change. You can enable it by setting it:
Code: Select all
flap_detection_enabled 1
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.