From 0779d2c44b36cafd3cc48c39cd33b596606ee234 Mon Sep 17 00:00:00 2001 From: Louis Sautier Date: Fri, 27 Mar 2015 12:48:45 +0100 Subject: [PATCH] Add all missing UPS check parameters fixes #8881 Signed-off-by: Gunnar Beutner --- doc/7-icinga-template-library.md | 10 +++++++-- itl/command-plugins.conf | 36 ++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index d2c696cf3..7b32c2720 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -760,8 +760,14 @@ Custom Attributes: Name | Description ----------------|-------------- -ups_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. -ups_name | **Optional.** The UPS name. Defaults to `ups`. +ups_address | **Required.** The address of the host running upsd. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ups_name | **Required.** The UPS name. Defaults to `ups`. +ups_port | **Optional.** The port to which to connect. Defaults to 3493. +ups_variable | **Optional.** The variable to monitor. Must be one of LINE, TEMP, BATTPCT or LOADPCT. If this is not set, the check only relies on the value of `ups.status`. +ups_warning | **Optional.** The warning threshold for the selected variable. +ups_critical | **Optional.** The critical threshold for the selected variable. +ups_celsius | **Optional.** Display the temperature in degrees Celsius instead of Fahrenheit. Defaults to `false`. +ups_timeout | **Optional.** The number of seconds before the connection times out. Defaults to 10. ## users diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 6df1ad744..bdd838f3b 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -932,8 +932,40 @@ object CheckCommand "ups" { command = [ PluginDir + "/check_ups" ] arguments = { - "-H" = "$ups_address$" - "-u" = "$ups_name$" + "-H" = { + value = "$ups_address$" + description = "Address of the upsd server" + required = true + } + "-u" = { + value = "$ups_name$" + description = "Name of the UPS to monitor" + required = true + } + "-p" = { + value = "$ups_port"$ + description = "Port number (default: 3493)" + } + "-v" = { + value = "$ups_variable$" + description = "Variable to monitor, valid strings are LINE, TEMP, BATTPCT or LOADPCT" + } + "-w" = { + value = "$ups_warning$" + description = "Warning threshold for the selected variable" + } + "-c" = { + value = "$ups_critical$" + description = "Critical threshold for the selected variable" + } + "-T" = { + set_if = "$ups_celsius$" + description = "Display temperature in degrees Celsius instead of Fahrenheit" + } + "-t" = { + value = "$ups_timeout$" + description = "Seconds before the connection times out (default: 10)" + } } vars.ups_address = "$check_address$"