NagiosCustom Alarm Time
When you encounter the need to customize check and alarm time, summarize. We all brainstorm, and constantly improve.
commonly-invokedtemplate configuration file:
Efine service{
name Generic-service; Define a service name
Active_checks_enabled 1; Activeservice Checks is enabled
Passive_checks_enabled 1; Passiveservice Checks is enabled/accepted
Parallelize_check 1; Activeservice checks should be parallelized;
; (Disabling this can leads to major performance problems)
Obsess_over_service 1; Weshould obsess over this service (if necessary)
Check_freshness 0; Defaultis to not check service ' freshness '
Notifications_enabled 1; Servicenotifications is enabled
Event_handler_enabled 1; Serviceevent handler is enabled
Flap_detection_enabled 1; Flapdetection is enabled
Failure_prediction_enabled 1; Failureprediction is enabled
Process_perf_data 1; Processperformance data
Retain_status_information 1; Retainstatus Information across program restarts
Retain_nonstatus_information 1; Retainnon-status Information across program restarts
Is_volatile 0; Theservice is not volatile
Check_period 24x7 ; the check_period here tells Nagios to check the service's time period.
max_check_attempts 3; Nagios The maximum number of checks on the service.
Normal_check_interval 5; This option is used to set the service check interval, that is, the time between Nagios this check and the next check;
; This is 5 minutes.
Retry_check_interval 2; Retry the check interval, in minutes.
contact_groups admin ; specify Contact Group
Notification_options W,u,c,r ; &NBSP ; ; U is unknown, indicating unknown state;
&NBSP ; ; C is criticle, indicating a state of emergency, R is recover, indicating the status of recovery;
&NBSP ; ; This means that notifications are sent to the consumer after the service has a warning state, an unknown state, an emergency, and a re-recovery.
Notification_interval 10; Re-notify aboutservice problems every hour
notification_period 24x7 ; specifies the time period when notifications are sent, that is, when notifications can be sent to the consumer.
Register 0; DONT registerthis definition-its not A REAL SERVICE, JUST A template!
}
Define Service{
Name Local-service ; The name of this service template
Use Generic-service; Inherit default values from Thegeneric-service definition
Max_check_attempts 4; Re-check theservice up to 4 times in order to determine it final (hard) state
Normal_check_interval 5; Check the service every 5 minutes undernormal conditions
Retry_check_interval 1; Re-check Theservice every minute until a hard state can be determined
Register 0; DONT REGISTER thisdefinition-its not a REAL SERVICE, JUST a template!
}
[Email protected] objects]# cattimeperiods.cfg
......................
Define Timeperiod{
Timeperiod_name 24x7
Alias Hours a day, 7Days a Week
Sunday 00:00-24:00
Monday 00:00-24:00
Tuesday 00:00-24:00
Wednesday 00:00-24:00
Thursday 00:00-24:00
Friday 00:00-24:00
Saturday 00:00-24:00
}
custom Check and alarm time:
Define Timeperiod{
Timeperiod_name Rd_bus_engine_time
Alias Rd_bus_engine_time
Monday 07:55-08:05
Tuesday 07:55-08:05
Wednesday 07:55-08:05
Thursday 07:55-08:05
Friday 07:55-08:05
Saturday 07:55-08:05
Sunday 07:55-08:05
}
defineservice{
Use Local-service
HOST_NAME 10.19.190.22_bus_engine
Service_description Compile_critical_log
Contact_groups Rd-bus-engine-group
Check_period Rd_bus_engine_time
Notification_period Rd_bus_engine_time
Notification_options W,u,c,r
Check_command Check_nrpe!check_log
}
Check the restart.
This article is from the "Love Stupid Blog" blog, please be sure to keep this source http://6622951.blog.51cto.com/6612951/1413510