From: Dirk Goetz Date: Mon, 20 Jul 2015 08:14:10 +0000 (+0200) Subject: Add check_yum to ITL X-Git-Tag: v2.4.0~449 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e4adf4126d81433379f8f7e58415da5b0f502e7;p=icinga2 Add check_yum to ITL fixes #9671 --- diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index 4e2cb46a8..2d3ebdb51 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -1735,13 +1735,30 @@ mem_cache | **Optional.** If set to true plugin will count cache as free memo mem_warning | **Required.** Specifiy the warning threshold as number interpreted as percent. mem_critical | **Required.** Specifiy the critical threshold as number interpreted as percent. -## running_kernel +### running_kernel Check command object for the `check_running_kernel` plugin provided by the `nagios-plugins-contrib` package on Debian. The `running_kernel` check command does not support any vars. +### yum + +The plugin `yum` is used to check the YUM package management system for package updates. To differentiate between security and normal updates it requires the YUM security plugin installed. It is provied by `Christoph Anton Mitterer` on [https://github.com](https://github.com/calestyo/check_yum). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +yum_all_updates | **Optional.** Set to true to not distinguish between security and non-security updates, but returns critical for any available update. This may be used if the YUM security plugin is absent or you want to maintain every single package at the latest version. You may want to use **yum_warn_on_any_update** instead of this option. Defaults to false. +yum_warn_on_any_update | **Optional.** Set to true to warn if there are any (non-security) package updates available. Defaults to false. +yum_cache_only | **Optional.** If set to true plugin runs entirely from cache and does not update the cache when running YUM. Useful if you have `yum makecache` cronned. Defaults to false. +yum_no_warn_on_lock | **Optional.** If set to true returns OK instead of WARNING when YUM is locked and fails to check for updates due to another instance running. Defaults to false. +yum_no_warn_on_updates | **Optional.** If set to true returns OK instead of WARNING even when updates are available. The plugin output still shows the number of available updates. Defaults to false. +yum_enablerepo | **Optional.** Explicitly enables a reposity when calling YUM. Can take a comma separated list of repositories. Note that enabling repositories can lead to unexpected results, for example when protected repositories are enabled. +yum_disablerepo | **Optional.** Explicitly disables a reposity when calling YUM. Can take a comma separated list of repositories. Note that enabling repositories can lead to unexpected results, for example when protected repositories are enabled. +yum_installroot | **Optional.** Specifies another installation root directory (for example a chroot). +yum_timeout | **Optional.** Set a timeout in seconds after which the plugin will exit (defaults to 55 seconds). ## Virtualization diff --git a/itl/plugins-contrib.d/operating-system.conf b/itl/plugins-contrib.d/operating-system.conf index eee67a5f3..05bc2bb15 100644 --- a/itl/plugins-contrib.d/operating-system.conf +++ b/itl/plugins-contrib.d/operating-system.conf @@ -56,3 +56,53 @@ object CheckCommand "running_kernel" { command = [ "sudo", PluginContribDir + "/check_running_kernel" ] } +object CheckCommand "yum" { + import "plugin-check-command" + + command = [ PluginContribDir + "/check_yum" ] + + arguments = { + "--all-updates" = { + set_if = "$yum_all_updates$" + description = "Do not distinguish between security and non-security updates. This may be used if the YUM security plugin is absent." + } + "--warn-on-any-update" = { + set_if = "$yum_warn_on_any_update$" + description = "Warns if there are any (non-security) package updates available." + } + "--cache-only" = { + set_if = "$yum_cache_only$" + description = "Run entirely from cache and do not update the cache." + } + "--no-warn-on-lock" = { + set_if = "$yum_no_warn_on_lock$" + description = "Return OK instead of WARNING when YUM is locked." + } + "--no-warn-on-updates" = { + set_if = "$yum_no_warn_on_updates$" + description = "Return OK instead of WARNING even when updates are available." + } + "--enablerepo" = { + value = "$yum_enablerepo$" + description = "Explicitly enables a reposity when calling YUM. Can take a comma separated list of repositories." + } + "--disablerepo" = { + value = "$yum_disablerepo$" + description = "Explicitly disables a reposity when calling YUM. Can take a comma separated list of repositories." + } + "--installroot" = { + value = "$yum_installroot$" + description = "Specifies another installation root directory" + } + "--timeout" = { + value = "$yum_timeout$" + description = "Sets a timeout in seconds after which the plugin will exit (defaults to 55 seconds)." + } + } + + vars.yum_all_updates = false + vars.yum_warn_on_any_update = false + vars.yum_cache_only = false + vars.yum_no_warn_on_lock = false + vars.yum_no_warn_on_updates = false +}