From 66d2e968a9ed22952bb62d053fa79108e7d4e0c6 Mon Sep 17 00:00:00 2001 From: BarbUk Date: Fri, 28 Jun 2019 16:37:56 +0400 Subject: [PATCH] Add memcached CheckCommand definition --- doc/10-icinga-template-library.md | 21 +++++++++++ itl/plugins-contrib.d/databases.conf | 56 ++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 23ae6ab46..19bea7b4c 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -2559,6 +2559,27 @@ proxysql_critical | **Optional.** Critical threshold proxysql\_include\_hostgroup | **Optional.** ProxySQL hostgroup(s) to include (only applies to '--type hg' checks, accepts comma-separated list) proxysql\_ignore\_hostgroup | **Optional.** ProxySQL hostgroup(s) to ignore (only applies to '--type hg' checks, accepts comma-separated list) +#### memcached + +The [check_memcached](https://packages.debian.org/stretch/nagios-plugins-contrib) plugin +is provided by the `nagios-plugin-contrib` package on Debian/Ubuntu. + +Custom attributes passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------------------|---------------------------------------------------------------------------------- +memcached_hostname | **Required.** Hostname or IP address (required) optional ':port' overrides -p +memcached_port | **Optional.** Port number (default: 11211) +memcached_verbose | **Optional.** verbose messages +memcached_keep | **Optional.** Keep up to this many items in the history object in memcached (default: 30) +memcached_minimum_stat_interval | **Optional.** Minimum time interval (in minutes) to use to analyse stats. (default: 30) +memcached_warning_hits_misses | **Optional.** Generate warning if quotient of hits/misses falls below this value (default: 2.0) +memcached_warning_evictions | **Optional.** Generate warning if number of evictions exceeds this threshold. 0=disable. (default: 10) +memcached_timeout | **Optional.** timeout in seconds (default: 1.0) +memcached_key | **Optional.** key name for history object (default: check_memcached) +memcached_expiry | **Optional.** expiry time in seconds for history object (default: 7200) +memcached_performance_output | **Optional.** output performance statistics as rate-per-minute figures (better suited to pnp4nagios) + ### Hardware This category includes all plugin check commands for various hardware checks. diff --git a/itl/plugins-contrib.d/databases.conf b/itl/plugins-contrib.d/databases.conf index a9671eb81..b8b9c2052 100644 --- a/itl/plugins-contrib.d/databases.conf +++ b/itl/plugins-contrib.d/databases.conf @@ -886,3 +886,59 @@ object CheckCommand "proxysql" { } } } + +object CheckCommand "memcached" { + command = [ PluginDir + "/check_memcached" ] + + arguments = { + "-H" = { + value = "$memcached_hostname$" + required = true + description = "Hostname or IP address (required) optional ':port' overrides -p" + } + "-p" = { + value = "$memcached_port$" + description = "Port number (default: 11211)" + } + "-v" = { + set_if = "$memcached_verbose$" + description = "verbose messages" + } + "-n" = { + value = "$memcached_keep$" + description = "Keep up to this many items in the history object in memcached (default: 30)" + } + "-T" = { + value = "$memcached_minimum_stat_interval$" + description = "Minimum time interval (in minutes) to use to analyse stats. (default: 30)" + } + "-w" = { + value = "$memcached_warning_hits_misses$" + description = "Generate warning if quotient of hits/misses falls below this value (default: 2.0)" + } + "-E" = { + value = "$memcached_warning_evictions$" + description = "Generate warning if number of evictions exceeds this threshold. 0=disable. (default: 10)" + } + "-t" = { + value = "$memcached_timeout$" + description = "timeout in seconds (default: 1.0)" + } + "-k" = { + value = "$memcached_key$" + description = "key name for history object (default: check_memcached)" + } + "-K" = { + value = "$memcached_expiry$" + description = "expiry time in seconds for history object (default: 7200)" + } + "-r" = { + set_if = "$memcached_performance_output$" + description = "output performance statistics as rate-per-minute figures (better suited to pnp4nagios)" + } + } + + vars.memcached_hostname = "127.0.0.1" + vars.memcached_minimum_stat_interval = "10" + vars.memcached_performance_output = true +}