Module: check_mk
Branch: master
Commit: 72c60391f5f0d42bd4640e5c76336b407a90620b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=72c60391f5f0d4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Jan 1 23:10:11 2016 +0100
Updated bug entries #2417
---
.bugs/2417 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/.bugs/2417 b/.bugs/2417
new file mode 100644
index 0000000..3f30004
--- /dev/null
+++ b/.bugs/2417
@@ -0,0 +1,10 @@
+Title: mem.linux: ignore cma_total and cma_free in case CMA is not enabled
+Component: checks
+State: open
+Date: 2016-01-01 23:09:11
+Targetversion: future
+Class: nastiness
+
+if CMA is not being used (CmaTotal is 0), then no performance data should be output.
+More important: no graph should be drawn. Also create a graph template for CMA
+memory.
Module: check_mk
Branch: master
Commit: e89b7f2f95f46677f672fe9eac46e02aec519a6a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e89b7f2f95f466…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jan 7 10:20:22 2016 +0100
Fixed bug which made the GENERIC agent always same as the VANILLA agent in the agent bakery
---
modules/check_mk.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index bc96596..438c505 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -688,7 +688,10 @@ def host_extra_conf(hostname, ruleset):
entries = []
for item, hostname_list in ruleset:
- if hostname in hostname_list:
+ # Hack for the agent bakery: The hostname may be "True" which is used
+ # for the generic agent. When the hostname is True it should match
+ # without conditions.
+ if hostname == True or hostname in hostname_list:
entries.append(item)
return entries
Module: check_mk
Branch: master
Commit: 48fdc66d1af62641229d5adcfa28629ed96d7e46
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=48fdc66d1af626…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Jan 7 09:47:17 2016 +0100
updated #2818
---
doc/treasures/active_checks/check_mail_loop | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/doc/treasures/active_checks/check_mail_loop b/doc/treasures/active_checks/check_mail_loop
old mode 100755
new mode 100644
index 8f5217c..97a8587
--- a/doc/treasures/active_checks/check_mail_loop
+++ b/doc/treasures/active_checks/check_mail_loop
@@ -205,6 +205,7 @@ socket.setdefaulttimeout(conn_timeout)
g_expected = {}
g_mails = {}
+g_obsolete = {}
g_M = None
def load_expected_mails():
@@ -241,7 +242,7 @@ def add_starttls_support(self, keyfile = None, certfile = None):
self.capabilities = tuple(self.untagged_responses[cap][-1].upper().split())
def fetch_mails():
- global g_M
+ global g_M, g_obsolete
if not g_expected:
return # not expecting any mail, do not check for mails
@@ -293,8 +294,6 @@ def fetch_mails():
ts = matches.group(1).strip()
key = matches.group(2).strip()
- if "%s-%s" % (ts, key) not in g_expected:
- continue
# extract received time
rx = msg.get('Received')
@@ -304,6 +303,12 @@ def fetch_mails():
# use current time as fallback where no Received header could be found
rx_ts = int(time.time())
+ if "%s-%s" % (ts, key) not in g_expected:
+ # Delete any "Check_MK-Mail-Loop" messages older than 24 hours, even if they are not in our list
+ if delete_messages and int(time.time()) - rx_ts > 24 * 3600:
+ g_obsolete[ts+'-'+key] = (index, rx_ts)
+ continue
+
g_mails[ts+'-'+key] = (index, rx_ts)
except Exception, e:
@@ -402,7 +407,7 @@ def cleanup_mailbox():
try:
# Do not delete all messages in the inbox. Only the ones which were
# processed before! In the meantime there might be occured new ones.
- for ident, (mail_index, recv_ts) in g_mails.items():
+ for ident, (mail_index, recv_ts) in g_mails.items() + g_obsolete.items():
if fetch_proto == 'POP3':
response = g_M.dele(mail_index + 1)
if not response.startswith("+OK"):
Module: check_mk
Branch: master
Commit: 58bc07514bb4ce06ffd855d504db12b9708cad8b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=58bc07514bb4ce…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Jan 7 09:48:15 2016 +0100
updated #2818
---
.werks/2818 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.werks/2818 b/.werks/2818
index 77cdf13..4f8c9fc 100644
--- a/.werks/2818
+++ b/.werks/2818
@@ -7,4 +7,4 @@ Date: 1450346972
Class: fix
If configured, the mail loop check deleted any received mails matching the pattern "Check_MK-Mail-Loop 1450346942 269".
-With this fix it only deletes mails it was actually expecting.
+With this fix it only deletes mails it was actually expecting and any left over mails older than 24 hours.
Module: check_mk
Branch: master
Commit: 46018410bbc71570a4821d1bf60ab68131dc9cef
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=46018410bbc715…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Jan 4 17:41:23 2016 +0100
#2872 supermicro, supermicro.sensors: New check to monitor health on snmp-enabled devices by supermicro
---
.werks/2872 | 9 +++
ChangeLog | 1 +
checkman/supermicro | 15 ++++
checkman/supermicro.sensors | 19 +++++
checks/supermicro | 161 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 205 insertions(+)
diff --git a/.werks/2872 b/.werks/2872
new file mode 100644
index 0000000..0470ca7
--- /dev/null
+++ b/.werks/2872
@@ -0,0 +1,9 @@
+Title: supermicro, supermicro.sensors: New check to monitor health on snmp-enabled devices by supermicro
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1451925621
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index c012bfa..63410f4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,6 +72,7 @@
* 1318 cisco_asa_svcsessions: New Check to monitor VPN Connections on Cisco ASA devices
* 2886 solaris_fmadm: new check monitors the severity and name of the fault class on Solaris systems using the 'fmadm faulty' command
* 2871 msexch_database: New check to monitor access latencies to MS Exchange Databases
+ * 2872 supermicro, supermicro.sensors: New check to monitor health on snmp-enabled devices by supermicro
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checkman/supermicro b/checkman/supermicro
new file mode 100644
index 0000000..1d7e288
--- /dev/null
+++ b/checkman/supermicro
@@ -0,0 +1,15 @@
+title: Supermicro Health
+agents: snmp
+catalog: hw/other
+license: GPL
+distribution: check_mk
+description:
+ This check tests the overall health status reported by snmp-enabled
+ devices from supermicro. Currently this has only been tested with
+ data from a mainboard on windows. In this case an agent has to be
+ enabled through the SuperDoctor III software.
+
+ Status {OK}, {WARN} and {CRIT} are taken directly from the device.
+
+inventory:
+ Exactly one item is generated on supported devices.
diff --git a/checkman/supermicro.sensors b/checkman/supermicro.sensors
new file mode 100644
index 0000000..14d6735
--- /dev/null
+++ b/checkman/supermicro.sensors
@@ -0,0 +1,19 @@
+title: Supermicro Health Sensors
+agents: snmp
+catalog: hw/other
+license: GPL
+distribution: check_mk
+description:
+ This check tests individual sensors (Fan speeds, voltages,
+ temperatures) reported by snmp-enabled devices from supermicro.
+ Currently this has only been tested with data from a mainboard on
+ windows. In this case an agent has to be enabled through the
+ SuperDoctor III software.
+
+ Status {OK}, {WARN} and {CRIT} are determined based on upper and
+ lower levels reported by the device. On top of that, the device
+ itself reports a status which is applied if it's worse than the
+ calculated one.
+
+inventory:
+ One item is reported per sensor.
diff --git a/checks/supermicro b/checks/supermicro
new file mode 100644
index 0000000..17de2a3
--- /dev/null
+++ b/checks/supermicro
@@ -0,0 +1,161 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2016 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.
+
+
+# .1.3.6.1.4.1.10876.2.1.1.1.1.2.1 Fan1 Fan Speed
+# .1.3.6.1.4.1.10876.2.1.1.1.1.2.2 Fan2 Fan Speed
+# ...
+# .1.3.6.1.4.1.10876.2.1.1.1.1.2.6 Vcore Voltage
+# .1.3.6.1.4.1.10876.2.1.1.1.1.2.7 CPU VTT Voltage
+# .1.3.6.1.4.1.10876.2.1.1.1.1.3.1 0
+# .1.3.6.1.4.1.10876.2.1.1.1.1.3.2 0
+# ...
+# .1.3.6.1.4.1.10876.2.1.1.1.1.3.6 1
+# .1.3.6.1.4.1.10876.2.1.1.1.1.3.7 1
+# .1.3.6.1.4.1.10876.2.1.1.1.1.4.1 3760
+# .1.3.6.1.4.1.10876.2.1.1.1.1.4.2 1909
+# ...
+# .1.3.6.1.4.1.10876.2.1.1.1.1.4.6 1080
+# .1.3.6.1.4.1.10876.2.1.1.1.1.4.7 1056
+# ...
+# .1.3.6.1.4.1.10876.2.1.1.1.1.5.6 1488
+# .1.3.6.1.4.1.10876.2.1.1.1.1.5.7 1344
+# .1.3.6.1.4.1.10876.2.1.1.1.1.6.1 291
+# .1.3.6.1.4.1.10876.2.1.1.1.1.6.2 291
+# ...
+# .1.3.6.1.4.1.10876.2.1.1.1.1.11.1 RPM
+# .1.3.6.1.4.1.10876.2.1.1.1.1.11.2 RPM
+# ...
+# .1.3.6.1.4.1.10876.2.1.1.1.1.11.6 mV
+# .1.3.6.1.4.1.10876.2.1.1.1.1.11.7 mV
+# .1.3.6.1.4.1.10876.2.1.1.1.1.12.1 0
+# .1.3.6.1.4.1.10876.2.1.1.1.1.12.2 0
+# ...
+# .1.3.6.1.4.1.10876.2.1.1.1.1.12.6 0
+# .1.3.6.1.4.1.10876.2.1.1.1.1.12.7 0
+# .1.3.6.1.4.1.10876.2.2 0
+# .1.3.6.1.4.1.10876.2.3 No problem.
+
+
+def inventory_supermicro_health(info):
+ if info[1]:
+ return [(None, None)]
+
+
+def check_supermicro_health(_no_item, _no_params, info):
+ return int(info[1][0][0]), info[1][0][1]
+
+
+check_info['supermicro'] = {
+ 'check_function' : check_supermicro_health,
+ 'inventory_function' : inventory_supermicro_health,
+ 'service_description' : "Health",
+ 'has_perfdata' : False,
+ 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0") == ".1.3.6.1.4.1.311.1.1.3.1.2",
+ 'snmp_info' : [
+ (".1.3.6.1.4.1.10876.2.1.1.1.1", [2, # smHealthMonitorName
+ 3, # smHealthMonitorType
+ 4, # smHealthMonitorReading
+ 5, # smHealthMonitorHighLimit
+ 6, # smHealthMonitorLowLimit
+ 11, # smHealthMonitorReadingUnit
+ 12, # smHealthMonitorStatus
+ ]),
+ (".1.3.6.1.4.1.10876.2", [2, # smHealthAllinoneStatus
+ 3, # smHealthAllinoneMsg
+ ]),
+ ]
+}
+
+
+def inventory_supermicro_sensors(info):
+ for name, sensor_type, reading, high, low, unit, status in info[0]:
+ yield name, None
+
+def check_supermicro_sensors(item, _no_params, info):
+ class Type:
+ Fan, Voltage, Temperature, Status = ('0', '1', '2', '3')
+
+ def worst_status(*args):
+ order = [0,1,3,2]
+ return sorted(args, key=lambda x: order[x], reverse=True)[0]
+
+ def expect_order(*args):
+ return max([abs(x[0] - x[1][0])
+ for x in enumerate(
+ sorted(enumerate(args), key=lambda x: x[1]))
+ ])
+
+ for name, sensor_type, reading, high, low, unit, dev_status in info[0]:
+ if name == item:
+ reading = float(reading)
+ dev_status = int(dev_status)
+
+ crit_upper = warn_upper = None
+ status_high = status_low = 0
+ if high:
+ crit_upper = float(high)
+ warn_upper = crit_upper * 0.95
+ status_high = expect_order(reading, warn_upper, crit_upper)
+ if low:
+ crit_lower = float(low)
+ warn_lower = crit_lower * 1.05
+ status_low = expect_order(crit_lower, warn_lower, reading)
+
+ perfvar = None
+
+ # normalize values depending on sensor type
+ if sensor_type == Type.Temperature:
+ unit = u"°%s" % unit
+ perfvar = "temp"
+ elif sensor_type == Type.Voltage:
+ if unit == "mV":
+ reading, warn_upper, crit_upper =\
+ map(lambda x: x / 1000.0, (reading, warn_upper, crit_upper))
+ unit = "V"
+ perfvar = "voltage"
+ elif sensor_type == Type.Status:
+ reading = "State %d" % int(reading)
+ unit = ""
+
+ perfdata = []
+
+ if perfvar:
+ if crit_upper is not None:
+ perfdata = [(perfvar, reading, warn_upper, crit_upper)]
+ else:
+ perfdata = [(perfvar, reading)]
+
+ return (worst_status(status_high, status_low, dev_status),
+ "%s%s" % (reading, unit), perfdata)
+
+check_info['supermicro.sensors'] = {
+ 'check_function' : check_supermicro_sensors,
+ 'inventory_function' : inventory_supermicro_sensors,
+ 'service_description' : "Sensor %s",
+ 'has_perfdata' : True,
+}
+