Skip to content

Instantly share code, notes, and snippets.

@nook24
Created May 3, 2022 09:06
Show Gist options
  • Save nook24/7f6be82ac51c62750a928bfb33a89fdf to your computer and use it in GitHub Desktop.
Save nook24/7f6be82ac51c62750a928bfb33a89fdf to your computer and use it in GitHub Desktop.
define command{
command_name check_true
command_line /bin/true
}
; Time period
define timeperiod{
timeperiod_name 24x7
alias 24x7
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
sunday 00:00-24:00
}
; Contact
define contact{
contact_name info
alias info contact
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
host_notification_commands check_true
service_notification_commands check_true
host_notification_options r,d,u
service_notification_options r,w,c,u
email foobar@example.org
}
; Servicegroup
define servicegroup{
servicegroup_name my_servicegroup_test
alias Test service group
}
; Host template
define host{
register 0
host_name default host
name default host
display_name default host
alias default host
;Check settings:
check_command check_true
initial_state u
check_period 24x7
check_interval 7200
retry_interval 60
max_check_attempts 3
active_checks_enabled 1
passive_checks_enabled 1
check_freshness 0
;Notification settings:
notifications_enabled 1
contacts info
notification_interval 7200
notification_period 24x7
notification_options r,d,u
;Flap detection settings:
flap_detection_enabled 0
;Everything else:
process_perf_data 0
;Custom variables:
_FOO abc
}
; Define host
define host{
use default host
host_name Host_1
display_name Host_1
address 127.0.0.1
}
define host{
use default host
host_name Host_2
display_name Host_2
address 127.0.0.1
}
define host{
use default host
host_name Host_3
display_name Host_3
address 127.0.0.1
}
define host{
use default host
host_name Host_4
display_name Host_4
address 127.0.0.1
}
; Service template
define service{
register 0
name CHECK_PING
display_name CHECK_PING
service_description CHECK_PING
;Check settings:
check_command check_true
initial_state u
check_period 24x7
check_interval 60
retry_interval 60
max_check_attempts 1
active_checks_enabled 1
passive_checks_enabled 1
;Notification settings:
notifications_enabled 1
notification_interval 7200
notification_period 24x7
notification_options r,c
;Flap detection settings:
flap_detection_enabled 0
;Everything else:
process_perf_data 1
is_volatile 0
}
; Define Services
define service{
use CHECK_PING
host_name Host_1
name CHECK_PING_1
display_name CHECK_PING_1
service_description CHECK_PING_1
servicegroups my_servicegroup_test
}
define service{
use CHECK_PING
host_name Host_2
name CHECK_PING_2
display_name CHECK_PING_2
service_description CHECK_PING_2
servicegroups my_servicegroup_test
}
define service{
use CHECK_PING
host_name Host_3
name CHECK_PING_3
display_name CHECK_PING_3
service_description CHECK_PING_3
servicegroups my_servicegroup_test
}
define service{
use CHECK_PING
host_name Host_4
name CHECK_PING_4
display_name CHECK_PING_4
service_description CHECK_PING_4
servicegroups my_servicegroup_test
}
; You can "fix" this error, if you define the service down here
; By doing so, Host_2,CHECK_PING_2 will become the "first service" - so you can no longer exclude this one in the service escalation. Not a real fix :)
;define service{
; use CHECK_PING
; host_name Host_1
; name CHECK_PING_1
; display_name CHECK_PING_1
; service_description CHECK_PING_1
; servicegroups my_servicegroup_test
;}
; It will only break with Host_1, !CHECK_PING_1 you can exclude any other service. Probably because it is the first one?
define serviceescalation{
host_name Host_1
service_description !CHECK_PING_1
servicegroup_name my_servicegroup_test
contacts info
first_notification 1
last_notification 5
notification_interval 7200
escalation_period 24x7
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment