diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 838ac8f8d..44eba797f 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -3406,6 +3406,25 @@ iostat\_ctps | **Required.** Critical threshold for tps (default: 200). iostat\_cread | **Required.** Critical threshold for KB/s reads (default: 200). iostat\_cwrite | **Required.** Critical threshold for KB/s writes (default: 200). +#### systemd + +The [check_systemd.py](https://github.com/Josef-Friedrich/check_systemd) plugin +will report a degraded system to your monitoring solution. It requires only the [nagiosplugin](https://nagiosplugin.readthedocs.io/en/stable) library. + +Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------- +systemd\_unit | **Optional.** Name of the systemd unit that is being tested. +systemd\_exclude\_unit | **Optional.** Exclude a systemd unit from the checks. This option can be applied multiple times. Also supports regular expressions. +systemd\_no\_startup\_time | **Optional.** Don’t check the startup time. Using this option the options `systemd_warning` and `systemd_critical` have no effect. (Default: `false`) +systemd\_warning | **Optional.** Startup time in seconds to result in a warning status. (Default: `60s`) +systemd\_critical | **Optional.** Startup time in seconds to result in a critical status. (Default: `120s`) +systemd\_dead\_timers | **Optional.** Detect dead / inactive timers. (Default: `false`) +systemd\_dead\_timers\_warning | **Optional.** Time ago in seconds for dead / inactive timers to trigger a warning state (by default 6 days). +systemd\_dead\_timers\_critical | **Optional.** Time ago in seconds for dead / inactive timers to trigger a critical state (by default 7 days). +systemd\_verbose\_level | **Optional.** Increase verbosity level (Accepted values: `1`, `2` or `3`). (Defaults to none) + #### yum The [check_yum](https://github.com/calestyo/check_yum) plugin checks the YUM package diff --git a/itl/plugins-contrib.d/CMakeLists.txt b/itl/plugins-contrib.d/CMakeLists.txt index 6f94404b9..b6386b887 100644 --- a/itl/plugins-contrib.d/CMakeLists.txt +++ b/itl/plugins-contrib.d/CMakeLists.txt @@ -1,6 +1,6 @@ # Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ install( - FILES big-data.conf databases.conf hardware.conf icingacli.conf ipmi.conf logmanagement.conf metrics.conf network-components.conf network-services.conf operating-system.conf raid-controller.conf smart-attributes.conf storage.conf virtualization.conf vmware.conf web.conf + FILES big-data.conf databases.conf hardware.conf icingacli.conf ipmi.conf logmanagement.conf metrics.conf network-components.conf network-services.conf operating-system.conf raid-controller.conf smart-attributes.conf storage.conf systemd.conf virtualization.conf vmware.conf web.conf DESTINATION ${ICINGA2_INCLUDEDIR}/plugins-contrib.d ) diff --git a/itl/plugins-contrib.d/systemd.conf b/itl/plugins-contrib.d/systemd.conf new file mode 100644 index 000000000..4c0bbca17 --- /dev/null +++ b/itl/plugins-contrib.d/systemd.conf @@ -0,0 +1,51 @@ +/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */ + +object CheckCommand "systemd" { + command = [ PluginContribDir + "/check_systemd.py" ] + + arguments = { + "--unit" = { + value = "$systemd_unit$" + description = "Name of the systemd unit that is being tested." + } + "--exclude" = { + value = "$systemd_exclude_unit$" + description = "Exclude a systemd unit from the checks. This option can be applied multiple times. Also supports regular expressions." + repeat_key = true + } + "--no-startup-time" = { + set_if = "$systemd_no_startup_time$" + description = "Don’t check the startup time. Using this option the options `systemd_warning` and `systemd_critical` have no effect. (Default: `false`)" + } + "--warning" = { + value = "$systemd_warning$" + description = "Startup time in seconds to result in a warning status. (Default: `60s`)" + } + "--critical" = { + value = "$systemd_critical$" + description = "Startup time in seconds to result in a critical status. (Default: `120s`)" + } + "--dead-timers" = { + set_if = "$systemd_dead_timers$" + description = "Detect dead / inactive timers. (Default: `false`)" + } + "--dead-timers-warning" = { + value = "$systemd_dead_timers_warning$" + description = "Time ago in seconds for dead / inactive timers to trigger a warning state (by default 6 days)." + } + "--dead-timers-critical" = { + value = "$systemd_dead_timers_critical$" + description = "Time ago in seconds for dead / inactive timers to trigger a critical state (by default 7 days)." + } + "-v" = { + set_if = {{ macro("$systemd_verbose_level$") == 1 }} + description = "Increase verbosity level (Accepted values: `1`, `2` or `3`). Defaults to none." + } + "-vv" = { + set_if = {{ macro("$systemd_verbose_level$") == 2 }} + } + "-vvv" = { + set_if = {{ macro("$systemd_verbose_level$") == 3 }} + } + } +}