Module: check_mk
Branch: master
Commit: 1eb297ba3be6dd4422c3486db4305d0e883899ba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1eb297ba3be6dd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 14 11:07:14 2014 +0200
FIX mysql_slave: Fixed detecting CRIT states when IO/SQL slaves are not running
---
.werks/1055 | 8 ++++++++
ChangeLog | 1 +
checks/mysql_slave | 4 +++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/1055 b/.werks/1055
new file mode 100644
index 0000000..4a41a3e
--- /dev/null
+++ b/.werks/1055
@@ -0,0 +1,8 @@
+Title: mysql_slave: Fixed detecting CRIT states when IO/SQL slaves are not running
+Level: 1
+Component: checks
+Version: 1.2.5i5
+Date: 1405328815
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 37de5fc..e7dc726 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -46,6 +46,7 @@
* 1075 FIX: if, if64: Fixed PNP template in order to correctly scale Y axis
* 0631 FIX: fc_port: several fixes for the perfometer to display the right values...
* 0632 FIX: brocade_fcport: fix perfometer output of out bandwidth when averaging is
switched on
+ * 1055 FIX: mysql_slave: Fixed detecting CRIT states when IO/SQL slaves are not
running
Multisite:
* 1013 Sort host names naturally, e.g. foobar11 comes after foobar2...
diff --git a/checks/mysql_slave b/checks/mysql_slave
index 657cfa2..33cc4d4 100644
--- a/checks/mysql_slave
+++ b/checks/mysql_slave
@@ -59,6 +59,7 @@ def check_mysql_slave(_unused, params, info):
output.append('Slave-IO: running')
else:
output.append('Slave-IO: not running(!!)')
+ state = 2
if data['Slave_SQL_Running']:
output.append('Slave-SQL: running')
@@ -70,12 +71,13 @@ def check_mysql_slave(_unused, params, info):
state = 2
out += '(!!)'
elif warn != None and data['Seconds_Behind_Master'] > warn:
- state = 1
+ state = max(state, 1)
out += '(!)'
output.append(out)
perfdata.append(('seconds_behind_master',
data['Seconds_Behind_Master'], warn, crit))
else:
output.append('Slave-SQL: not running(!!)')
+ state = 2
return state, ', '.join(output), perfdata