Module: check_mk
Branch: master
Commit: ba1f520ebfc5187011b1b9c30ca851fb7507d1d0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba1f520ebfc518…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 3 17:03:13 2014 +0100
#1484 dell_om_sensors: Use sensor name as item
The checks of the type <tt>dell_om_sensors</tt> now use the sensor
name rather then its index as the item. Also the check now allows to
set levels that are more strict than the builtin critical level.
This is done by using the same code now as in all other temperature
checks. Also the check output is compatible now.
Because of the renaming of the item a re-inventory will create
one new item for each sensor.
---
.werks/1484 | 16 +++++++++++++
ChangeLog | 2 ++
checks/dell_om_sensors | 58 +++++++++++++++++++++++++++++-------------------
3 files changed, 53 insertions(+), 23 deletions(-)
diff --git a/.werks/1484 b/.werks/1484
new file mode 100644
index 0000000..93b6a34
--- /dev/null
+++ b/.werks/1484
@@ -0,0 +1,16 @@
+Title: dell_om_sensors: Use sensor name as item
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.5i7
+Date: 1415030487
+Class: feature
+
+The checks of the type <tt>dell_om_sensors</tt> now use the sensor
+name rather then its index as the item. Also the check now allows to
+set levels that are more strict than the builtin critical level.
+This is done by using the same code now as in all other temperature
+checks. Also the check output is compatible now.
+
+Because of the renaming of the item a re-inventory will create
+one new item for each sensor.
diff --git a/ChangeLog b/ChangeLog
index 13f68ef..db55c3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
* 1167 citrix_license/esx_license: Can now be configured to always show OK as state
* 1198 climaveneta_fan: New check for fan speed on Climaveneta devices
* 1199 climaveneta_alarm: New check to display the alarm states on Climaveneta devcies
+ * 1484 dell_om_sensors: Use sensor name as item...
+ NOTE: Please refer to the migration notes!
* 1478 FIX: kernel.util, statgrab_cpu: fix computation of utilization...
* 1480 FIX: brocade_vdx_status: disable check on some devices that do not support it...
diff --git a/checks/dell_om_sensors b/checks/dell_om_sensors
index 643a8af..5b9f94c 100644
--- a/checks/dell_om_sensors
+++ b/checks/dell_om_sensors
@@ -24,10 +24,18 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+dell_om_sensors_default_levels = (50, 60)
+
+
+def dell_om_sensors_item(name):
+ return name.replace("Temp", "").strip()
+
+
def inventory_dell_om_sensors(info):
- return [ (x[0], None) for x in info ]
+ return [ (dell_om_sensors_item(line[4]), "dell_om_sensors_default_levels") for line in info ]
-def check_dell_om_sensors(item, _no_params, info):
+
+def check_dell_om_sensors(item, params, info):
#Probetypes found in check_openmanage3.pl
probe_types = {
1 : 'Other', # type is other than following values
@@ -35,36 +43,40 @@ def check_dell_om_sensors(item, _no_params, info):
3 : 'AmbientESM', # type is Ambient Embedded Systems Management temperature probe
16 : 'Discrete', # type is temperature probe with discrete reading
}
- for line in info:
- if line[0] == item:
- reading = int(line[2]) / 10.0
- msg = "Current: %.2fC Sensor: %s (Type: %s) " % \
- ( reading, line[4], probe_types[int(line[3])] )
- perf = [ ('temp', reading )]
- if int(line[1]) != 3:
- return 2, msg, perf
- return 0, msg, perf
+ for idx, sensor_state, reading, sensor_type, location_name in info:
+ if item == idx or dell_om_sensors_item(location_name) == item:
+ if params == None:
+ params = dell_om_sensors_default_levels # compatibility with old autochecks
+ temp = int(reading) / 10.0
+
+ yield check_temperature(temp, params)
+
+ if item == idx: # old style item: output location name
+ yield 0, "%s, Type: %s" % (location_name, probe_types[int(sensor_type)])
+
+ if int(sensor_state) != 3:
+ yield 2, "in critical state"
- return 3, "probe not found in SNMP tree"
check_info["dell_om_sensors"] = {
"check_function" : check_dell_om_sensors,
"inventory_function" : inventory_dell_om_sensors,
- "service_description" : "Sensor %s",
+ "service_description" : "Temperature %s",
"has_perfdata" : True,
+ "group" : "room_temperature",
# There is no other way to find out that openmanage is present.
"snmp_scan_function" : scan_dell_om,
"snmp_info" : ( ".1.3.6.1.4.1.674.10892.1.700.20.1", [
- '2', #ProbeIndex
- '5', #ProbeStatus
- '6', #ProbeReading
- '7', #ProbeType
- '8', #ProbeLocationName
- #'10.1', #ProbeUpperCriticalThreshold',
- #'11.1', #ProbeUpperNonCriticalThreshold',
- #'12.1', #ProbeLowerNonCriticalThreshold',
- #'13.1', #ProbeLowerCriticalThreshold',
- #'16.1', #ProbeDiscreteReading',
+ '2', # ProbeIndex
+ '5', # ProbeStatus
+ '6', # ProbeReading
+ '7', # ProbeType
+ '8', # ProbeLocationName
+ #'10.1', # ProbeUpperCriticalThreshold',
+ #'11.1', # ProbeUpperNonCriticalThreshold',
+ #'12.1', # ProbeLowerNonCriticalThreshold',
+ #'13.1', # ProbeLowerCriticalThreshold',
+ #'16.1', # ProbeDiscreteReading',
]),
"includes" : [ "dell_om.include", "temperature.include" ],
}
Module: check_mk
Branch: master
Commit: 796a2dcde14ea60f5f2fd921d95731107c1aa83b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=796a2dcde14ea6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 3 17:00:03 2014 +0100
dell_om_* checks: better scan function, find more devices
---
checks/dell_om.include | 34 ++++++++++++++++++++++++++++++++++
checks/dell_om_disks | 3 ++-
checks/dell_om_esmlog | 3 ++-
checks/dell_om_mem | 3 ++-
checks/dell_om_processors | 3 ++-
checks/dell_om_sensors | 3 ++-
6 files changed, 44 insertions(+), 5 deletions(-)
diff --git a/checks/dell_om.include b/checks/dell_om.include
new file mode 100644
index 0000000..ea3bd08
--- /dev/null
+++ b/checks/dell_om.include
@@ -0,0 +1,34 @@
+#!/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.
+
+# The OpenManage module attaches itself to the SNMP agent of the
+# operating system. We trigger on all Windows and Linux systems.
+# This is not optimal but still enough for excluding network
+# devices and similar stuff
+def scan_dell_om(oid):
+ return "Open Manage" in oid(".1.3.6.1.2.1.1.1.0") or \
+ "Linux" in oid(".1.3.6.1.2.1.1.1.0") or \
+ "Software: Windows" in oid(".1.3.6.1.2.1.1.1.0")
diff --git a/checks/dell_om_disks b/checks/dell_om_disks
index 51d01a2..916fd23 100644
--- a/checks/dell_om_disks
+++ b/checks/dell_om_disks
@@ -116,7 +116,7 @@ check_info["dell_om_disks"] = {
"service_description" : "Physical Disk %s",
"has_perfdata" : False,
# There is no other way to find out that openmanage is present.
- "snmp_scan_function" : lambda oid: oid('.1.3.6.1.4.1.674.10893.1.20.1.0'),
+ "snmp_scan_function" : scan_dell_om,
"snmp_info" : ( ".1.3.6.1.4.1.674.10893.1.20.130.4.1", [
2, # arrayDiskName
4, # arrayDiskState
@@ -131,5 +131,6 @@ check_info["dell_om_disks"] = {
#31, #arrayDiskSmartAlertIndication
35, # arrayDiskMediaType
]),
+ "includes" : [ "dell_om.include" ],
}
diff --git a/checks/dell_om_esmlog b/checks/dell_om_esmlog
index 14df4e0..59576a3 100644
--- a/checks/dell_om_esmlog
+++ b/checks/dell_om_esmlog
@@ -50,9 +50,10 @@ check_info["dell_om_esmlog"] = {
"service_description" : "ESM Log",
"has_perfdata" : False,
# There is no other way to find out that openmanage is present.
- "snmp_scan_function" : lambda oid: oid('.1.3.6.1.4.1.674.10893.1.20.1.0'),
+ "snmp_scan_function" : scan_dell_om,
"snmp_info" : ( ".1.3.6.1.4.1.674.10892.1.200.10.1.41", [
1, # eventlogStatus
]),
+ "includes" : [ "dell_om.include" ],
}
diff --git a/checks/dell_om_mem b/checks/dell_om_mem
index 8a663dc..3ed4562 100644
--- a/checks/dell_om_mem
+++ b/checks/dell_om_mem
@@ -67,12 +67,13 @@ check_info["dell_om_mem"] = {
"service_description" : "Module %s",
"has_perfdata" : False,
# There is no other way to find out that openmanage is present.
- "snmp_scan_function" : lambda oid: oid('.1.3.6.1.4.1.674.10893.1.20.1.0'),
+ "snmp_scan_function" : scan_dell_om,
"snmp_info" : ( ".1.3.6.1.4.1.674.10892.1.1100.50.1", [
"8.1", #Location
"5.1", #Status
"14.1", #Size
"20.1", #FailureMode
]),
+ "includes" : [ "dell_om.include" ],
}
diff --git a/checks/dell_om_processors b/checks/dell_om_processors
index 6ae3e30..ebf1cc7 100644
--- a/checks/dell_om_processors
+++ b/checks/dell_om_processors
@@ -72,7 +72,7 @@ check_info["dell_om_processors"] = {
"service_description" : "Processor %s",
"has_perfdata" : False,
# There is no other way to find out that openmanage is present.
- "snmp_scan_function" : lambda oid: oid('.1.3.6.1.4.1.674.10893.1.20.1.0'),
+ "snmp_scan_function" : scan_dell_om,
"snmp_info" : ( ".1.3.6.1.4.1.674.10892.1.1100", [
"30.1.2", # Index
"30.1.5", # Device Status
@@ -80,5 +80,6 @@ check_info["dell_om_processors"] = {
"30.1.9", # DeviceStatus State
"32.1.6", # Deive Status reading
]),
+ "includes" : [ "dell_om.include" ],
}
diff --git a/checks/dell_om_sensors b/checks/dell_om_sensors
index 77509a9..643a8af 100644
--- a/checks/dell_om_sensors
+++ b/checks/dell_om_sensors
@@ -53,7 +53,7 @@ check_info["dell_om_sensors"] = {
"service_description" : "Sensor %s",
"has_perfdata" : True,
# There is no other way to find out that openmanage is present.
- "snmp_scan_function" : lambda oid: oid('.1.3.6.1.4.1.674.10893.1.20.1.0'),
+ "snmp_scan_function" : scan_dell_om,
"snmp_info" : ( ".1.3.6.1.4.1.674.10892.1.700.20.1", [
'2', #ProbeIndex
'5', #ProbeStatus
@@ -66,5 +66,6 @@ check_info["dell_om_sensors"] = {
#'13.1', #ProbeLowerCriticalThreshold',
#'16.1', #ProbeDiscreteReading',
]),
+ "includes" : [ "dell_om.include", "temperature.include" ],
}
Module: check_mk
Branch: master
Commit: 8c153704c4a49b504f38ad8b31b4cca284029f79
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8c153704c4a49b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Nov 3 15:05:14 2014 +0100
Updated Dell OpenManage manpages
---
checkman/dell_om_disks | 8 +++++---
checkman/dell_om_esmlog | 7 +++++--
checkman/dell_om_mem | 5 ++++-
checkman/dell_om_processors | 9 ++++++---
checkman/dell_om_sensors | 3 ++-
5 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/checkman/dell_om_disks b/checkman/dell_om_disks
index d854875..105fd4c 100644
--- a/checkman/dell_om_disks
+++ b/checkman/dell_om_disks
@@ -1,16 +1,18 @@
-title: Dell Open Manage: Disks
+title: Dell OpenManage: Disks
agents: snmp
catalog: hw/server/dell
license: GPL
distribution: check_mk
description:
This check monitors the health and current Status of
- Hardisks attached to a Dell server which have the open_manage packet
- installed.
+ Hardisks attached to a Dell server.
The check returns a {CRIT} in case of an error state reported
by the device. The check also reports the model number, size,
bus type, spare state and media type for each disk.
+ For this check you need to install the Dell OpenManage Server Administrator
+ (OMSA) on your target server. This is available for Linux and Windows.
+
item:
The compination of EnclosureID, Channel and TargetID seperated by colums
diff --git a/checkman/dell_om_esmlog b/checkman/dell_om_esmlog
index f1f3dd7..8b001f6 100644
--- a/checkman/dell_om_esmlog
+++ b/checkman/dell_om_esmlog
@@ -1,15 +1,18 @@
-title: Dell Open Manage: ESM log
+title: Dell OpenManage: ESM log
agents: snmp
catalog: hw/server/dell
license: GPL
distribution: check_mk
description:
This check monitors the current health state of the ESM log
- on a Dell server which have the open_manage packet installed.
+ on a Dell server which have the OpenManage packet installed.
The check returns a {CRIT} state in case the log file is 100% full.
In case that the logfile more then 80% full, the check returns
a {WARN} state/
+ For this check you need to install the Dell OpenManage Server Administrator
+ (OMSA) on your target server. This is available for Linux and Windows.
+
inventory:
One check will be created
diff --git a/checkman/dell_om_mem b/checkman/dell_om_mem
index 044520f..946a3ae 100644
--- a/checkman/dell_om_mem
+++ b/checkman/dell_om_mem
@@ -1,4 +1,4 @@
-title: Dell Open Manage: Physical Memory
+title: Dell OpenManage: Physical Memory
agents: snmp
catalog: hw/server/dell
license: GPL
@@ -10,6 +10,9 @@ description:
The check returns a {CRIT} in case of an error state reported
by the device. The check also reports the size of the module.
+ For this check you need to install the Dell OpenManage Server Administrator
+ (OMSA) on your target server. This is available for Linux and Windows.
+
item:
The name of the module port
diff --git a/checkman/dell_om_processors b/checkman/dell_om_processors
index f115b0b..424260c 100644
--- a/checkman/dell_om_processors
+++ b/checkman/dell_om_processors
@@ -1,14 +1,17 @@
-title: Dell Open Manage: Processor health
+title: Dell OpenManage: Processor health
agents: snmp
catalog: hw/server/dell
license: GPL
distribution: check_mk
description:
This check monitors the health of processors
- attached to a Dell server which have the open_manage packet
- installed.
+ attached to a Dell server.
The check returns a {CRIT} in case of an error state reported.
+ For this check you need to install the Dell OpenManage Server Administrator
+ (OMSA) on your target server. This is available for Linux and Windows.
+
+
item:
The numeric id of the processor reported by its position in the mib
diff --git a/checkman/dell_om_sensors b/checkman/dell_om_sensors
index f2dc59f..f978c03 100644
--- a/checkman/dell_om_sensors
+++ b/checkman/dell_om_sensors
@@ -1,4 +1,4 @@
-title: Dell Open Manage: Sensors (Fan, Temperature)
+title: Dell OpenManage: Sensors (Fan, Temperature)
agents: snmp
catalog: hw/server/dell
license: GPL
@@ -7,6 +7,7 @@ description:
This check monitors the current Status of
each Sensor Module on a Dell server which have the open_manage packet
installed.
+
The check returns a {CRIT} in case of an error state reported
by the sensor and also reports the current reading of the sensor as perfdata.