From 5f58414aea39eec869095f709b6257484e99b01d Mon Sep 17 00:00:00 2001 From: BarbUk Date: Sat, 22 Dec 2018 11:01:30 +0400 Subject: [PATCH] Add proxysql CheckCommand definition --- doc/10-icinga-template-library.md | 22 ++++++++++ itl/plugins-contrib.d/databases.conf | 61 ++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index e8f48ab28..4f6283d29 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -2492,6 +2492,28 @@ redis_memory_utilization | **Optional.** This calculates percent of total memory redis_total_memory | **Optional.** Amount of memory on a system for memory utilization calculation. Use system memory or max_memory setting of redis. redis_replication_delay | **Optional.** Allows to set threshold on replication delay info. +#### proxysql + +The [check_proxysql](https://github.com/sysown/proxysql-nagios) plugin, +uses the `proxysql` binary to monitor [proxysql](https://proxysql.com/). + +Custom attributes passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +-----------------------------|---------------------------------------------------------------------------------- +proxysql_user | **Optional.** ProxySQL admin username (default=admin) +proxysql_password | **Optional.** ProxySQL admin password (default=admin) +proxysql_host | **Optional.** ProxySQL hostname / IP (default=127.0.0.1) +proxysql_port | **Optional.** ProxySQL admin port (default=6032) +proxysql_defaultfile | **Optional.** ProxySQL defaults file +proxysql_type | **Required.** ProxySQL check type (one of conns,hg,rules,status,var) +proxysql_name | **Optional.** ProxySQL variable name to check +proxysql_lower | **Optional.** Alert if ProxySQL value are LOWER than defined WARN / CRIT thresholds (only applies to 'var' check type) +proxysql_runtime | **Optional.** Force ProxySQL Nagios check to query the runtime_mysql_XXX tables rather than the mysql_XXX tables +proxysql_warning | **Optional.** Warning threshold +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) ### Hardware diff --git a/itl/plugins-contrib.d/databases.conf b/itl/plugins-contrib.d/databases.conf index c12475d19..18ddc7311 100644 --- a/itl/plugins-contrib.d/databases.conf +++ b/itl/plugins-contrib.d/databases.conf @@ -842,3 +842,64 @@ object CheckCommand "redis" { vars.redis_perfparse = false vars.redis_prev_perfdata = false } + +object CheckCommand "proxysql" { + import "plugin-check-command" + command = [ PluginDir + "/check_proxysql" ] + + arguments = { + "--user" = { + value = "$proxysql_user$" + description = "ProxySQL admin username (default=admin)" + } + "--password" = { + value = "$proxysql_password$" + description = "ProxySQL admin password (default=admin)" + } + "--host" = { + value = "$proxysql_host$" + description = "ProxySQL hostname / IP (default=127.0.0.1)" + } + "--port" = { + value = "$proxysql_port$" + description = "ProxySQL admin port (default=6032)" + } + "--defaults-file" = { + value = "$proxysql_defaultfile$" + description = "ProxySQL defaults file" + } + "--type" = { + value = "$proxysql_type$" + description = "ProxySQL check type (one of conns,hg,rules,status,var)" + required = true + } + "--name" = { + value = "$proxysql_name$" + description = "ProxySQL variable name to check" + } + "--lower" = { + value = "$proxysql_lower$" + description = "Alert if ProxySQL value are LOWER than defined WARN / CRIT thresholds (only applies to 'var' check type)" + } + "--runtime" = { + value = "$proxysql_runtime$" + description = "Force ProxySQL Nagios check to query the runtime_mysql_XXX tables rather than the mysql_XXX tables" + } + "--warning" = { + value = "$proxysql_warning$" + description = "Warning threshold" + } + "--critical" = { + value = "$proxysql_critical$" + description = "Critical threshold" + } + "--include-hostgroup" = { + value = "$proxysql_include_hostgroup$" + description = "ProxySQL hostgroup(s) to include (only applies to '--type hg' checks, accepts comma-separated list)" + } + "--ignore-hostgroup" = { + value = "$proxysql_ignore_hostgroup$" + description = "ProxySQL hostgroup(s) to ignore (only applies to '--type hg' checks, accepts comma-separated list)" + } + } +}