Update example configuration

This commit is contained in:
Markus Opolka 2025-04-11 15:45:06 +02:00
parent 4e0d4e873b
commit 039cb0adb6

View File

@ -1,4 +1,6 @@
object CheckCommand "http_json" { object CheckCommand "http_json" {
// Example configuration for Icinga
import "plugin-check-command" import "plugin-check-command"
command = [ PluginDir + "/check_http_json.py" ] command = [ PluginDir + "/check_http_json.py" ]
@ -53,6 +55,13 @@ object CheckCommand "http_json" {
value = "$http_json_headers$" value = "$http_json_headers$"
description = "additional http headers in JSON format to send with the request" description = "additional http headers in JSON format to send with the request"
} }
"--unreachable-state" = {
value = "$http_json_unreachable_state$"
description = "Exit with specified code when the URL is unreachable."
}
"--invalid-json-state" = {
value = "$http_json_invalid_json_state$"
description = "Exit with specified code when no valid JSON is returned."
"--field_separator" = { "--field_separator" = {
value = "$http_json_field_separator$" value = "$http_json_field_separator$"
description = "JSON Field separator, defaults to '.'; Select element in an array with '(' ')'" description = "JSON Field separator, defaults to '.'; Select element in an array with '(' ')'"
@ -64,46 +73,62 @@ object CheckCommand "http_json" {
"--warning" = { "--warning" = {
value = "$http_json_warning$" value = "$http_json_warning$"
description = "Warning threshold for these values, WarningRange is in the format [@]start:end" description = "Warning threshold for these values, WarningRange is in the format [@]start:end"
repeat_key = true
} }
"--critical" = { "--critical" = {
value = "$http_json_critical$" value = "$http_json_critical$"
description = "Critical threshold for these values, CriticalRange is in the format [@]start:end" description = "Critical threshold for these values, CriticalRange is in the format [@]start:end"
repeat_key = true
} }
"--key_exists" = { "--key_exists" = {
value = "$http_json_key_exists$" value = "$http_json_key_exists$"
description = "Checks existence of these keys to determine status. Return warning if key is not present." description = "Checks existence of these keys to determine status. Return warning if key is not present."
repeat_key = true
} }
"--key_exists_critical" = { "--key_exists_critical" = {
value = "$http_json_key_exists_critical$" value = "$http_json_key_exists_critical$"
description = "Checks existence of these keys to determine status. Return critical if key is not present." description = "Checks existence of these keys to determine status. Return critical if key is not present."
repeat_key = true
} }
"--key_equals" = { "--key_equals" = {
value = "$http_json_key_equals$" value = "$http_json_key_equals$"
description = "Checks equality of these keys and values. Return warning if equality check fails" description = "Checks equality of these keys and values. Return warning if equality check fails"
repeat_key = true
} }
"--key_equals_critical" = { "--key_equals_critical" = {
value = "$http_json_key_equals_critical$" value = "$http_json_key_equals_critical$"
description = "Checks equality of these keys and values. Return critical if equality check fails" description = "Checks equality of these keys and values. Return critical if equality check fails"
repeat_key = true
} }
"--key_equals_unknown" = { "--key_equals_unknown" = {
value = "$http_json_key_equals_unknown$" value = "$http_json_key_equals_unknown$"
description = "Checks equality of these keys and values. Return unknown if equality check fails" description = "Checks equality of these keys and values. Return unknown if equality check fails"
} repeat_key = true
"--unreachable-state" = {
value = "$http_json_unreachable_state$"
description = "Exit with specified code if URL unreachable. Examples: 1 for Warning, 2 for Critical, 3 for Unknown (default: 3)"
} }
"--key_not_equals" = { "--key_not_equals" = {
value = "$http_json_key_not_equals$" value = "$http_json_key_not_equals$"
description = "Checks equality of these keys and values (key[>alias],value key2,value2) to determine status. Multiple key values can be delimited with colon (key,value1:value2). Return warning if equality check succeeds." description = "Checks equality of these keys and values (key[>alias],value key2,value2) to determine status. Multiple key values can be delimited with colon (key,value1:value2). Return warning if equality check succeeds."
repeat_key = true
} }
"--key_not_equals_critical" = { "--key_not_equals_critical" = {
value = "$http_json_key_not_equals_critical$" value = "$http_json_key_not_equals_critical$"
description = "Checks equality of these keys and values (key[>alias],value key2,value2) to determine status. Multiple key values can be delimited with colon (key,value1:value2). Return critical if equality check succeeds." description = "Checks equality of these keys and values (key[>alias],value key2,value2) to determine status. Multiple key values can be delimited with colon (key,value1:value2). Return critical if equality check succeeds."
repeat_key = true
} }
"--key_metric" = { "--key_metric" = {
value = "$http_json_key_metric$" value = "$http_json_key_metric$"
description = "Gathers the values of these keys" description = "Gathers the values of these keys"
repeat_key = true
}
"--key_time" = {
value = "$http_json_key_time$"
description = " Checks a Timestamp of these keys and values (key[>alias],value key2,value2) to determine status."
repeat_key = true
}
"--key_time_critical" = {
value = "$http_json_key_time_critical$"
description = "Same as --key_time but return critical if Timestamp age fails."
repeat_key = true
} }
} }
} }