Module: check_mk
Branch: master
Commit: 4b71709456bfc2ffc27a3583f13cc2ac0e726709
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b71709456bfc2…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 5 10:02:32 2014 +0200
akcp_daisy_temp: fix detection of first port, add perfdata
---
checks/akcp_daisy_temp | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/checks/akcp_daisy_temp b/checks/akcp_daisy_temp
index 89aa267..15cd6bf 100644
--- a/checks/akcp_daisy_temp
+++ b/checks/akcp_daisy_temp
@@ -23,21 +23,20 @@
# 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.
+
akcp_daisy_temp_defaultlevels = (28, 32)
+
def inventory_akcp_daisy_temp(info):
inventory = []
- pass_first = True
for port, subport, name, temp in info:
+ # Ignore sensors that are found by the non-daisychaining-version of
+ # this check (akcp_sensor_temp)
if subport != '-1' and subport != '0':
- # We have to ignore the first item, because it will be also reported
- # by akcp_sensor_temp on the port were this sensor chain is connected
- if pass_first:
- pass_first = False
- continue
inventory.append((name, 'akcp_daisy_temp_defaultlevels' ))
return inventory
+
def check_akcp_daisy_temp(item, params, info):
for port, subport, name, temp in info:
if name == item:
@@ -50,9 +49,10 @@ def check_akcp_daisy_temp(item, params, info):
return 2, infotext + levels, perfdata
if temp > warn:
return 1, infotext + levels, perfdata
- return 0, infotext
+ return 0, infotext, perfdata
return 3, "Sensor not found"
+
check_info["akcp_daisy_temp"] = {
'check_function': check_akcp_daisy_temp,
'inventory_function': inventory_akcp_daisy_temp,
@@ -68,7 +68,7 @@ check_info["akcp_daisy_temp"] = {
"2.1.14", # Degree Celsius
]
),
- 'snmp_scan_function': lambda oid: oid(".1.3.6.1.2.1.1.2.0") in\
+ 'snmp_scan_function': lambda oid: oid(".1.3.6.1.2.1.1.2.0") in \
[ ".1.3.6.1.4.1.3854.1.2.2.1.1",
".1.3.6.1.4.1.3854.1" ],
'group' : 'room_temperature',
}