Module: check_mk
Branch: master
Commit: 623f0b252aa5d1003bed1ad79056d383d46e0d96
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=623f0b252aa5d1…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jan 11 15:20:44 2017 +0100
4289 FIX mysql.innodb_io: fixed incomplete data handling
If the values 'Innodb_data_read' and 'Innodb_data_written' are missing
the check no longer crashes but reports 'Incomplete agent output'
Change-Id: I03ef752864ad354382b731613a3ef6c210ae9754
---
.werks/4289 | 11 +++++++++++
ChangeLog | 1 +
checks/mysql | 4 ++++
3 files changed, 16 insertions(+)
diff --git a/.werks/4289 b/.werks/4289
new file mode 100644
index 0000000..7cc79f5
--- /dev/null
+++ b/.werks/4289
@@ -0,0 +1,11 @@
+Title: mysql.innodb_io: fixed incomplete data handling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i4
+Date: 1484144358
+
+If the values 'Innodb_data_read' and 'Innodb_data_written' are missing
+the check no longer crashes but reports 'Incomplete agent output'
diff --git a/ChangeLog b/ChangeLog
index 73347dd..54dd049 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -41,6 +41,7 @@
* 4287 FIX: job: fixed incomplete data handling...
* 4268 FIX: cisco_vpn_tunnel: Reporting zero traffic in case the tunnel is down...
* 4288 FIX: sentry_pdu: fixed data handling if power value is missing
+ * 4289 FIX: mysql.innodb_io: fixed incomplete data handling...
Multisite:
* 4169 View action: Default values of sticky, notification and persistent options can
now be configured via global settings....
diff --git a/checks/mysql b/checks/mysql
index 42d68c6..5f51084 100644
--- a/checks/mysql
+++ b/checks/mysql
@@ -184,6 +184,10 @@ def inventory_mysql_iostat(parsed):
def check_mysql_iostat(item, params, parsed):
if item in parsed:
values = parsed[item]
+
+ if not ("Innodb_data_read" in values and
"Innodb_data_written" in values):
+ return 3, "Incomplete agent output"
+
line = [ None, None, values["Innodb_data_read"] / 512,
values["Innodb_data_written"] / 512]
return check_diskstat_line(time.time(), 'innodb_io'+item, params, line)