From: Lennart Betz Date: Mon, 6 Jul 2015 08:09:39 +0000 (+0200) Subject: ITL: Add CheckCommand ntp_peer X-Git-Tag: v2.4.0~541 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1a06333b8690795f0616d97ceaa9fa7b3b6b94e7;p=icinga2 ITL: Add CheckCommand ntp_peer fixes #9523 Signed-off-by: Michael Friedrich --- diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index 75ad81851..11b48e40c 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -534,6 +534,27 @@ Name | Description ntp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +## ntp_peer + +Check command object for the `check_ntp_peer` plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ntp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ntp_port | **Optional.** The port to use. Default to 123. +ntp_warning | **Optional.** Offset to result in warning status (seconds). +ntp_critical | **Optional.** Offset to result in critical status (seconds). +ntp_wstratum | **Optional.** Warning threshold for stratum of server's synchronization peer. +ntp_cstratum | **Optional.** Critical threshold for stratum of server's synchronization peer. +ntp_wjitter | **Optional.** Warning threshold for jitter. +ntp_cjitter | **Optional.** Critical threshold for jitter. +ntp_wsource | **Optional.** Warning threshold for number of usable time sources. +ntp_csource | **Optional.** Critical threshold for number of usable time sources. +ntp_timeout | **Optional.** Seconds before connection times out (default: 10). + + ## passive Specialised check command object for passive checks executing the `check_dummy` plugin with appropriate default values. diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 7a2f6a9e4..56c717efe 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -604,6 +604,29 @@ object CheckCommand "ntp_time" { vars.ntp_address = "$check_address$" } +object CheckCommand "ntp_peer" { + import "plugin-check-command" + import "ipv4-or-ipv6" + + command = [ PluginDir + "/check_ntp_peer" ] + + arguments = { + "-H" = "$ntp_address$" + "-p" = "$ntp_port$" + "-w" = "$ntp_warning$" + "-c" = "$ntp_critical$" + "-W" = "$ntp_wstratum$" + "-C" = "$ntp_cstratum$" + "-j" = "$ntp_wjitter$" + "-k" = "$ntp_cjitter$" + "-m" = "$ntp_wsource$" + "-n" = "$ntp_csource$" + "-t" = "$ntp_timeout$" + } + + vars.ntp_address = "$check_address$" +} + object CheckCommand "ssh" { import "plugin-check-command" import "ipv4-or-ipv6"