Module: check_mk
Branch: master
Commit: 76d2c1ef82944ea57b83eb2955584df9dac2d8d8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=76d2c1ef82944e…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Mar 10 13:23:00 2015 +0100
#1227 mysql_ping: New Check to detect misconfiguration of the mk_mysql plugin
---
.werks/1227 | 9 +++++++++
ChangeLog | 1 +
checkman/mysql_ping | 19 +++++++++++++++++++
checks/mysql_ping | 42 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 71 insertions(+)
diff --git a/.werks/1227 b/.werks/1227
new file mode 100644
index 0000000..d71a51a
--- /dev/null
+++ b/.werks/1227
@@ -0,0 +1,9 @@
+Title: mysql_ping: New Check to detect misconfiguration of the mk_mysql plugin
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1425990122
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 14b1041..8258a59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,7 @@
* 2056 winperf_processor: additionally reports user and privileged(system) time...
* 1226 mysql: New check to show the version of the mysql deamon
* 2100 if64: check can now impose limits on the number of outgoing and incoming
non-unicast packets per second
+ * 1227 mysql_ping: New Check to detect misconfiguration of the mk_mysql plugin
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checkman/mysql_ping b/checkman/mysql_ping
new file mode 100644
index 0000000..328cd6e
--- /dev/null
+++ b/checkman/mysql_ping
@@ -0,0 +1,19 @@
+title: MySQL Deamon: Staus
+agents: linux
+catalog: app/mysql
+license: GPL
+distribution: check_mk
+description:
+ This check checks if the MySQL deamon is alive and a connection is possible.
+ Otherwiese it returns {CRIT}. This check can also be used to detect wrong or
+ unconfigured mk_mysql plugins.
+
+ This check needs the agent plugin {mk_mysql} to be installed.
+ Further details about this plugin and monitoring of MySQL can be
+ found in the Check_MK online documentation in the article
+ "Monitoring MySQL with Check_MK".
+
+inventory:
+ On each host where the agent plugin {mk_mysql} is being installed
+ one service is being generated.
+
diff --git a/checks/mysql_ping b/checks/mysql_ping
new file mode 100644
index 0000000..72b090f
--- /dev/null
+++ b/checks/mysql_ping
@@ -0,0 +1,42 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+def inventory_mysql_ping(info):
+ return [( None, None )]
+
+def check_mysql_ping(_no_item, _no_params, info):
+ message = " ".join(info[0])
+ if message == "mysqld is alive":
+ return 0, "MySQL Deamon is alive"
+ else:
+ return 2, message
+
+check_info['mysql_ping'] = {
+ "check_function" : check_mysql_ping,
+ "inventory_function" : inventory_mysql_ping,
+ "service_description" : "MySQL Deamon ",
+}
+