]> granicus.if.org Git - icinga2/commitdiff
ITL: Add CheckCommand ntp_peer
authorLennart Betz <lennart.betz@netways.de>
Mon, 6 Jul 2015 08:09:39 +0000 (10:09 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 6 Jul 2015 14:59:58 +0000 (16:59 +0200)
fixes #9523

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
doc/7-icinga-template-library.md
itl/command-plugins.conf

index 75ad81851c6ce21161b3d28a65d324624e11c01b..11b48e40c430e086268561bfdfe9e85f661d772d 100644 (file)
@@ -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.
 
 
+## <a id="plugin-check-command-ntp-peer"></a> 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).
+
+
 ## <a id="plugin-check-command-passive"></a> passive
 
 Specialised check command object for passive checks executing the `check_dummy` plugin with appropriate default values.
index 7a2f6a9e4d1e4c55df314230d09ab055527aaa2d..56c717efe07db04740d4715efa0dc04e67e0ea89 100644 (file)
@@ -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"