diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 0708c9760..6e8d22baa 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -3278,6 +3278,147 @@ printer_health_oids | **Optional.** A list of oids which are downloaded and wri printer_health_offline | **Optional.** The maximum number of seconds since the last update of cache file before it is considered too old. printer_health_multiline | **Optional.** Multiline output +#### Thola + +The [Thola](https://thola.io) plugin +is a tool for monitoring network devices, that mainly uses SNMP. + +To run these commands you need a server that is running the Thola API. +If you don't know how to do this, you can have a look at the plugin's +[documentation](https://docs.thola.io). Also, you have to +put the Thola-client binary into the `PluginContribDir`. + +##### thola-cpu-load + +Checks the CPU load of a network device. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------------------------|-------------------------------------------------------- +thola_api_address | **Required.** Address of the Thola API to connect to +thola_device_address | **Required.** The host's address. Defaults to "$address$" if the host's address attribute is set, “$address6$” otherwise. +thola_device_snmp_community | **Optional.** SNMP community of the device +thola_device_snmp_protocol | **Optional.** SNMP version to use +thola_cpu_load_critical | **Optional.** Critical threshold for the CPU load in % +thola_cpu_load_warning | **Optional.** Warning threshold for the CPU load in % + +##### thola-interface-metrics + +Checks the interface metrics of a network device. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------------------|----------------------------------------------------- +thola_api_address | **Required.** Address of the Thola API to connect to +thola_device_address | **Required.** The host's address. Defaults to "$address$" if the host's address attribute is set, “$address6$” otherwise +thola_device_snmp_community | **Optional.** SNMP community of the device + +##### thola-hardware-health + +Checks the hardware health of a network device. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------------|----------------------------------------------------- +thola_api_address | **Required.** Address of the Thola API to connect to +thola_device_address | **Required.** The host's address. Defaults to "$address$" if the host's address attribute is set, “$address6$” otherwise +thola_device_snmp_community | **Optional.** SNMP community of the device + +##### thola-identify + +Checks if a device can be identified by the given properties. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +-----------------------------------|-------------------------------------------------------------------------------- +thola_api_address | **Required.** Address of the Thola API to connect to +thola_device_address | **Required.** The host's address. Defaults to "$address$" if the host's address attribute is set, “$address6$” otherwise +thola_device_snmp_community | **Optional.** SNMP community of the device +thola_identify_model | **Optional.** Model that is compared to the actual model of the device +thola_identify_os_version | **Optional.** OS-version that is compared to the actual OS-version of the device +thola_identify_vendor | **Optional.** Vendor that is compared to the actual vendor of the device +thola_identify_serial_number | **Optional.** Serial number that is compared to the actual serial number of the device +thola_identify_discover_retries | **Optional.** The number of discover retries before aborting +thola_identify_discover_timeouts | **Optional.** The number of discover timeouts before aborting + +> **Note**: +> +> One of the variables `thola_identify_model`, `thola_identify_os_version`, +> `thola_identify_vendor` or `thola_identify_serial_number` must be set + +##### thola-memory-usage + +Checks the memory usage of a device. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------------------------|----------------------------------------------------- +thola_api_address | **Required.** Address of the Thola API to connect to +thola_device_address | **Required.** The host's address. Defaults to "$address$" if the host's address attribute is set, “$address6$” otherwise +thola_device_snmp_community | **Optional.** SNMP community of the device +thola_memory_usage_critical | **Optional.** Critical threshold for the memory usage in % +thola_memory_usage_warning | **Optional.** Warning threshold for the memory usage in % + +##### thola-sbc + +Checks special metrics from sbc network devices. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +-----------------------------------------|----------------------------------------------------------- +thola_api_address | **Required.** Address of the Thola API to connect to +thola_device_address | **Required.** The host's address. Defaults to "$address$" if the host's address attribute is set, “$address6$” otherwise +thola_device_snmp_community | **Optional.** SNMP community of the device +thola_sbc_system_health_score_critical | **Optional.** Critical threshold for the health score in % +thola_sbc_system_health_score_warning | **Optional.** Warning threshold for the health score in % + +##### thola-thola-server + +Checks if a Thola API is running on a given server. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------|----------------------------------------------------- +thola_api_address | **Required.** Address of the Thola API to connect to + +##### thola-ups + +Checks whether a UPS device has its main voltage applied. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------------------------------|----------------------------------------------------------------- +thola_api_address | **Required.** Address of the Thola API to connect to +thola_device_address | **Required.** The host's address. Defaults to "$address$" if the host's address attribute is set, “$address6$” otherwise +thola_device_snmp_community | **Optional.** SNMP community of the device +thola_ups_batt_current_critical_max | **Optional.** High critical threshold for the battery current in Volt +thola_ups_batt_current_critical_min | **Optional.** Low critical threshold for the battery current in Volt +thola_ups_batt_current_warning_max | **Optional.** High warning threshold for the battery current in Volt +thola_ups_batt_current_warning_min | **Optional.** Low warning threshold for the battery current in Volt +thola_ups_batt_temperature_critical_max | **Optional.** High critical threshold for the battery temperature in degree celsius +thola_ups_batt_temperature_critical_min | **Optional.** Low critical threshold for the battery temperature in degree celsius +thola_ups_batt_temperature_warning_max | **Optional.** High warning threshold for the battery temperature in degree celsius +thola_ups_batt_temperature_warning_min | **Optional.** Low warning threshold for the battery temperature in degree celsius +thola_ups_current_load_critical_max | **Optional.** High critical threshold for the current load in percent +thola_ups_current_load_critical_min | **Optional.** Low critical threshold for the current load in percent +thola_ups_current_load_warning_max | **Optional.** High warning threshold for the current load in percent +thola_ups_current_load_warning_min | **Optional.** Low warning threshold for the current load in percent +thola_ups_rectifier_current_critical_max | **Optional.** High critical threshold for the current rectifier in Volt +thola_ups_rectifier_current_critical_min | **Optional.** Low critical threshold for the current rectifier in Volt +thola_ups_rectifier_current_warning_max | **Optional.** High warning threshold for the current rectifier in Volt +thola_ups_rectifier_current_warning_min | **Optional.** Low warning threshold for the current rectifier in Volt +thola_ups_system_voltage_critical_max | **Optional.** High critical threshold for the system voltage in Volt +thola_ups_system_voltage_critical_min | **Optional.** Low critical threshold for the system voltage in Volt +thola_ups_system_voltage_warning_max | **Optional.** High warning threshold for the system voltage in Volt +thola_ups_system_voltage_warning_min | **Optional.** Low warning threshold for the system voltage in Volt ### Network Services diff --git a/itl/plugins-contrib.d/network-components.conf b/itl/plugins-contrib.d/network-components.conf index e6fdba7d2..333a82c59 100644 --- a/itl/plugins-contrib.d/network-components.conf +++ b/itl/plugins-contrib.d/network-components.conf @@ -833,3 +833,231 @@ object CheckCommand "printer_health" { vars.printer_health_hostname = "$check_address$" vars.printer_health_mode = "supplies-status" } + +template CheckCommand "generic-thola-check-command" { + command = [ PluginContribDir + "/thola-client", "check" ] + + arguments = { + "--target-api" = { + required = true + value = "$thola_api_address$" + description = "Address of the thola API" + } + } +} + +template CheckCommand "generic-thola-device-check-command" { + import "generic-thola-check-command" + import "ipv4-or-ipv6" + + arguments += { + "thola_device_address" = { + order = 0 + required = true + skip_key = true + value = "$thola_device_address$" + description = "IP address of target device" + } + "--snmp-community" = { + value = "$thola_device_snmp_community$" + description = "SNMP Community of target device" + } + "--snmp-version" = { + value = "$thola_device_snmp_protocol$" + description = "SNMP Version of target device" + } + } + + vars.thola_device_address = "$check_address$" +} + +object CheckCommand "thola-cpu-load" { + import "generic-thola-device-check-command" + + command += [ "cpu-load" ] + + arguments += { + "--critical" = { + value = "$thola_cpu_load_critical$" + description = "Critical threshold for the CPU load in %" + } + "--warning" = { + value = "$thola_cpu_load_warning$" + description = "Warning threshold for the CPU load in %" + } + } +} + +object CheckCommand "thola-interface-metrics" { + import "generic-thola-device-check-command" + + command += [ "interface-metrics" ] +} + +object CheckCommand "thola-hardware-health" { + import "generic-thola-device-check-command" + + command += [ "hardware-health" ] +} + +object CheckCommand "thola-identify" { + import "generic-thola-device-check-command" + + command += [ "identify" ] + + arguments += { + "--model" = { + value = "$thola_identify_model$" + description = "Model that is compared to the actual model of the device" + } + "--os-version" = { + value = "$thola_identify_os_version$" + description = "OS-version that is compared to the actual OS-version of the device" + } + "--vendor" = { + value = "$thola_identify_vendor$" + description = "Vendor that is compared to the actual vendor of the device" + } + "--serial-number" = { + value = "$thola_identify_serial_number$" + description = "Serial number that is compared to the actual serial number of the device" + } + "--snmp-discover-retries" = { + value = "$thola_identify_discover_retries$" + description = "Number of discover retries" + } + "--snmp-discover-timeout" = { + value = "$thola_identify_discover_timeouts$" + description = "Number of discover timeouts" + } + } +} + +object CheckCommand "thola-memory-usage" { + import "generic-thola-device-check-command" + + command += [ "memory-usage" ] + + arguments += { + "--critical" = { + value = "$thola_memory_usage_critical$" + description = "Critical threshold for the memory usage in %" + } + "--warning" = { + value = "$thola_memory_usage_warning$" + description = "Warning threshold for the memory usage in %" + } + } +} + +object CheckCommand "thola-sbc" { + import "generic-thola-device-check-command" + + command += [ "sbc" ] + + arguments += { + "--system-health-score-critical" = { + value = "$thola_sbc_system_health_score_critical$" + description = "Critical threshold for the health score in %" + } + "--system-health-score-warning" = { + value = "$thola_sbc_system_health_score_warning$" + description = "Warning threshold for the health score in %" + } + } +} + +object CheckCommand "thola-thola-server" { + import "generic-thola-check-command" + + command += [ "thola-server" ] +} + +object CheckCommand "thola-ups" { + import "generic-thola-device-check-command" + + command += [ "ups" ] + + arguments += { + "--batt-current-critical-max" = { + value = "$thola_ups_batt_current_critical_max$" + description = "High critical threshold for the battery current in Volt" + } + "--batt-current-critical-min" = { + value = "$thola_ups_batt_current_critical_min$" + description = "Low critical threshold for the battery current in Volt" + } + "--batt-current-warning-max" = { + value = "$thola_ups_batt_current_warning_max$" + description = "High warning threshold for the battery current in Volt" + } + "--batt-current-warning-min" = { + value = "$thola_ups_batt_current_warning_min$" + description = "Low warning threshold for the battery current in Volt" + } + "--batt-temperature-critical-max" = { + value = "$thola_ups_batt_temperature_critical_max$" + description = "High critical threshold for the battery temperature in degree celsius" + } + "--batt-temperature-critical-min" = { + value = "$thola_ups_batt_temperature_critical_min$" + description = "Low critical threshold for the battery temperature in degree celsius" + } + "--batt-temperature-warning-max" = { + value = "$thola_ups_batt_temperature_warning_max$" + description = "High warning threshold for the battery temperature in degree celsius" + } + "--batt-temperature-warning-min" = { + value = "$thola_ups_batt_temperature_warning_min$" + description = "Low warning threshold for the battery temperature in degree celsius" + } + "--current-load-critical-max" = { + value = "$thola_ups_current_load_critical_max$" + description = "High critical threshold for the current load in %" + } + "--current-load-critical-min" = { + value = "$thola_ups_current_load_critical_min$" + description = "Low critical threshold for the current load in %" + } + "--current-load-warning-max" = { + value = "$thola_ups_current_load_warning_max$" + description = "High warning threshold for the current load in %" + } + "--current-load-warning-min" = { + value = "$thola_ups_current_load_warning_min$" + description = "Low warning threshold for the current load in %" + } + "--rectifier-current-critical-max" = { + value = "$thola_ups_rectifier_current_critical_max$" + description = "High critical threshold for the current rectifier in Volt" + } + "--rectifier-current-critical-min" = { + value = "$thola_ups_rectifier_current_critical_min$" + description = "Low critical threshold for the current rectifier in Volt" + } + "--rectifier-current-warning-max" = { + value = "$thola_ups_rectifier_current_warning_max$" + description = "High warning threshold for the current rectifier in Volt" + } + "--rectifier-current-warning-min" = { + value = "$thola_ups_rectifier_current_warning_min$" + description = "Low warning threshold for the current rectifier in Volt" + } + "--system-voltage-critical-max" = { + value = "$thola_ups_system_voltage_critical_max$" + description = "High critical threshold for the system voltage in Volt" + } + "--system-voltage-critical-min" = { + value = "$thola_ups_system_voltage_critical_min$" + description = "Low critical threshold for the system voltage in Volt" + } + "--system-voltage-warning-max" = { + value = "$thola_ups_system_voltage_warning_max$" + description = "High warning threshold for the system voltage in Volt" + } + "--system-voltage-warning-min" = { + value = "$thola_ups_system_voltage_warning_min$" + description = "Low warning threshold for the system voltage in Volt" + } + } +}