Module: check_mk
Branch: master
Commit: 75ead9b33539b90b47cdcc84f3c86e4bb3139ec2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=75ead9b33539b9…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Mar 12 18:26:29 2014 +0100
dell_poweredge_pci: new check for pci devices on dell PowerEdge Servers
---
.werks/592 | 8 +++++
ChangeLog | 1 +
checkman/dell_poweredge_mem | 8 ++---
checkman/dell_poweredge_pci | 27 +++++++++++++++
checks/dell_poweredge_pci | 80 +++++++++++++++++++++++++++++++++++++++++++
5 files changed, 120 insertions(+), 4 deletions(-)
diff --git a/.werks/592 b/.werks/592
new file mode 100644
index 0000000..8fe436a
--- /dev/null
+++ b/.werks/592
@@ -0,0 +1,8 @@
+Title: dell_poweredge_pci: new check for pci devices on dell PowerEdge Servers
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1394645145
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 70fec53..c35d1d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -106,6 +106,7 @@
* 0588 dell_poweredge_amperage.current, dell_poweredge_amperage.power, dell_poweredge_cpu, dell_poweredge_status, dell_poweredge_temp: new checks for the Dell PowerEdge Blade Server
* 0589 brocade_tm: new check monitoring traffic manager statistics for interfaces of brocade devices
* 0591 dell_poweredge_mem: new check to monitor memory modules of Dell PowerEdge Servers
+ * 0592 dell_poweredge_pci: new check for pci devices on dell PowerEdge Servers
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/dell_poweredge_mem b/checkman/dell_poweredge_mem
index e22f890..cc1068a 100644
--- a/checkman/dell_poweredge_mem
+++ b/checkman/dell_poweredge_mem
@@ -9,19 +9,19 @@ description:
{memoryDeviceStatus}.
The state of the check is {OK} when the device returns a state of {OK}.
- The state of the cehck is {WARN} when the device returns a state of {other},
+ The state of the check is {WARN} when the device returns a state of {other},
{unknown} or {nonCritical}. The state of the check is {CRIT} otherwise.
No limits are set in the check.
- In addition to the state the following information of the memory modules
- is retrieved and displayed in the check output: size, speed, manufacturer,
+ In addition to the state the following information of the PCI devices is
+ retrieved and displayed in the check output: size, speed, manufacturer,
part number and serial number
item:
The name of the location variable configured for the memory module
inventory:
- All memory module of the device are detected
+ All memory modules of the device are detected
diff --git a/checkman/dell_poweredge_pci b/checkman/dell_poweredge_pci
new file mode 100644
index 0000000..dfaf065
--- /dev/null
+++ b/checkman/dell_poweredge_pci
@@ -0,0 +1,27 @@
+title: Dell PowerEdge Server: State of PCI Devices
+agents: snmp
+catalog: hw/network/dell
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of the PCI devices of Dell PowerEdge Servers.
+ The state is extracted from the device via SNMP from the parameter
+ {pCIDeviceStatus}.
+
+ The state of the check is {OK} when the device returns a state of {OK}.
+ The state of the cehck is {WARN} when the device returns a state of {other},
+ {unknown} or {nonCritical}. The state of the check is {CRIT} otherwise.
+
+ No limits are set in the check.
+
+ In addition to the state the following information of the memory modules
+ is retrieved and displayed in the check output: width of the data bus,
+ description of the device and manufacturer,
+
+item:
+ The name of the fqdd variable for the device
+
+inventory:
+ All PCI devices of the device are detected
+
+
diff --git a/checks/dell_poweredge_pci b/checks/dell_poweredge_pci
new file mode 100644
index 0000000..fdc22cd
--- /dev/null
+++ b/checks/dell_poweredge_pci
@@ -0,0 +1,80 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+dell_poweredge_pci_info = ( ".1.3.6.1.4.1.674.10892.5.4.1100.80.1", [
+ #"1", # pCIDevicechassisIndex 0
+ #"2", # pCIDeviceIndex 1
+ #"3", # pCIDeviceStateCapabilities
+ #"4", # pCIDeviceStateSettings 0
+ "5", # pCIDeviceStatus 0
+ "7", # pCIDeviceDataBusWidth 1
+ "8", # pCIDeviceManufacturerName 2
+ "9", # pCIDeviceDescriptionName 3
+ "12", # pCIDeviceFQDD 4
+ ])
+
+dell_poweredge_pci_scan = lambda oid: oid('.1.3.6.1.2.1.1.2.0') == ".1.3.6.1.4.1.674.10892.5"
+
+def inventory_dell_poweredge_pci(info):
+ inventory = []
+ for line in info:
+ fqdd = line[4]
+ if fqdd != "":
+ inventory.append( ( fqdd, None ) )
+ return inventory
+
+def check_dell_poweredge_pci(item, _no_params, info):
+ di = dict()
+ for status, di['BusWidth'], di['Manufacturer'], di['Description'], fqdd in info:
+
+ if item == fqdd:
+ state_table = {
+ "1" : ( "other", 1 ),
+ "2" : ( "unknown", 1 ),
+ "3" : ( "", 0 ),
+ "4" : ( "nonCritical", 1 ),
+ "5" : ( "Critical", 2 ),
+ "6" : ( "NonRecoverable", 2 ),
+ }
+ infotext, state = state_table.get(status, "2")
+ for parameter, value in di.items():
+ infotext += ", %s: %s" % ( parameter, value )
+
+ infotext = re.sub("^, ","", infotext)
+
+ return state, infotext
+
+ return 3, "Memory Device not found"
+
+check_info["dell_poweredge_pci"] = {
+ "check_function" : check_dell_poweredge_pci,
+ "inventory_function" : inventory_dell_poweredge_pci,
+ "service_description" : "%s",
+ "has_perfdata" : False,
+ "snmp_info" : dell_poweredge_pci_info,
+ "snmp_scan" : dell_poweredge_pci_scan,
+}
+
Module: check_mk
Branch: master
Commit: 9f903cce255fec5c202f488cdb78594cd15eb7e9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9f903cce255fec…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Mar 12 15:27:46 2014 +0100
FIX: dell_poweredge_cpu not correctly detects when cpus are not present
---
checkman/dell_poweredge_cpu | 5 +----
checks/dell_poweredge_cpu | 8 +++-----
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/checkman/dell_poweredge_cpu b/checkman/dell_poweredge_cpu
index 52e7b59..3e16658 100644
--- a/checkman/dell_poweredge_cpu
+++ b/checkman/dell_poweredge_cpu
@@ -15,10 +15,7 @@ description:
No limits are set in the check.
item:
- Either the name of the location variable configured for the CPU, or
- the chassis index and sensor index seperated by a dash.
+ The name of the location variable configured for the CPU
inventory:
All CPUs of the device are detected
-
-
diff --git a/checks/dell_poweredge_cpu b/checks/dell_poweredge_cpu
index ff9ea56..de91938 100644
--- a/checks/dell_poweredge_cpu
+++ b/checks/dell_poweredge_cpu
@@ -46,15 +46,13 @@ dell_poweredge_cpu_scan = lambda oid: oid('.1.3.6.1.2.1.1.2.0') == ".1.3.6.1.4.
def inventory_dell_poweredge_cpu(info):
inventory = []
for line in info[0]:
- if line[5] != "":
+ if line[5] != "" and line[2] != "1":
inventory.append( ( line[5], None ) )
- else:
- inventory.append( ( line[0]+"-"+line[1], None ) )
return inventory
def check_dell_poweredge_cpu(item, _no_params, info):
for chassisIndex, Index, StateSettings, Status, Reading, LocationName in info[0]:
- if item == LocationName or item == chassisIndex + "-" + Index:
+ if item == LocationName:
for line in info[1]:
if line[0] == chassisIndex and line[1] == Index:
BrandName = line[2]
@@ -72,7 +70,7 @@ def check_dell_poweredge_cpu(item, _no_params, info):
return state, infotext
- return 3, "Temp Sensor not found"
+ return 3, "CPU not found"
check_info["dell_poweredge_cpu"] = {
"check_function" : check_dell_poweredge_cpu,
Module: check_mk
Branch: master
Commit: a8551898ca3f5cebfc0cdb013f197f07e110a56a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a8551898ca3f5c…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Wed Mar 12 15:08:25 2014 +0100
dell_poweredge_mem: new check to monitor memory modules of Dell PowerEdge Servers
---
.werks/591 | 8 ++++
ChangeLog | 1 +
checkman/dell_poweredge_mem | 27 ++++++++++++++
checks/dell_poweredge_mem | 87 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 123 insertions(+)
diff --git a/.werks/591 b/.werks/591
new file mode 100644
index 0000000..f443b4a
--- /dev/null
+++ b/.werks/591
@@ -0,0 +1,8 @@
+Title: dell_poweredge_mem: new check to monitor memory modules of Dell PowerEdge Servers
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1394633291
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index e71ac16..70fec53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -105,6 +105,7 @@
* 0731 mk_postgres: improved support for versions postgres < 9.2...
* 0588 dell_poweredge_amperage.current, dell_poweredge_amperage.power, dell_poweredge_cpu, dell_poweredge_status, dell_poweredge_temp: new checks for the Dell PowerEdge Blade Server
* 0589 brocade_tm: new check monitoring traffic manager statistics for interfaces of brocade devices
+ * 0591 dell_poweredge_mem: new check to monitor memory modules of Dell PowerEdge Servers
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/dell_poweredge_mem b/checkman/dell_poweredge_mem
new file mode 100644
index 0000000..e22f890
--- /dev/null
+++ b/checkman/dell_poweredge_mem
@@ -0,0 +1,27 @@
+title: Dell PowerEdge Server: State of Memory Modules
+agents: snmp
+catalog: hw/network/dell
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of the memory modules of Dell PowerEdge Servers.
+ The state is extracted from the device via SNMP from the parameter
+ {memoryDeviceStatus}.
+
+ The state of the check is {OK} when the device returns a state of {OK}.
+ The state of the cehck is {WARN} when the device returns a state of {other},
+ {unknown} or {nonCritical}. The state of the check is {CRIT} otherwise.
+
+ No limits are set in the check.
+
+ In addition to the state the following information of the memory modules
+ is retrieved and displayed in the check output: size, speed, manufacturer,
+ part number and serial number
+
+item:
+ The name of the location variable configured for the memory module
+
+inventory:
+ All memory module of the device are detected
+
+
diff --git a/checks/dell_poweredge_mem b/checks/dell_poweredge_mem
new file mode 100644
index 0000000..50e9748
--- /dev/null
+++ b/checks/dell_poweredge_mem
@@ -0,0 +1,87 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+dell_poweredge_mem_info = ( ".1.3.6.1.4.1.674.10892.5.4.1100.50.1", [
+ #"1", # memoryDevicechassisIndex 0
+ #"2", # memoryDeviceIndex 1
+ #"3", # memoryDeviceStateCapabilities
+ #"4", # memoryDeviceStateSettings 0
+ "5", # memoryDeviceStatus 0
+ #"6", # memoryDeviceReading
+ #"7", # memoryDeviceType
+ "8", # memoryDeviceLocationName 1
+ #"10", # memoryDeviceBankLocationName
+ "14", # memoryDeviceSize
+ "15", # memoryDeviceSpeed
+ "21", # memoryDeviceManufacturerName
+ "22", # memoryDevicePartNumberName
+ "23", # memoryDeviceSerialNumberName
+ #"26", # memoryDeviceFQDD
+ ])
+
+dell_poweredge_mem_scan = lambda oid: oid('.1.3.6.1.2.1.1.2.0') == ".1.3.6.1.4.1.674.10892.5"
+
+def inventory_dell_poweredge_mem(info):
+ inventory = []
+ for line in info:
+ location = line[1]
+ if location != "":
+ inventory.append( ( location, None ) )
+ return inventory
+
+def check_dell_poweredge_mem(item, _no_params, info):
+ di = dict()
+ for status, location, di['Size'], di['Speed'], di['Manufacturer'], di['PartNumber'], \
+ di['SerialNumber'] in info:
+
+ if item == location:
+ state_table = {
+ "1" : ( "other", 1 ),
+ "2" : ( "unknown", 1 ),
+ "3" : ( "", 0 ),
+ "4" : ( "nonCritical", 1 ),
+ "5" : ( "Critical", 2 ),
+ "6" : ( "NonRecoverable", 2 ),
+ }
+ infotext, state = state_table.get(status, "2")
+ for parameter, value in di.items():
+ infotext += ", %s: %s" % ( parameter, value )
+
+ infotext = re.sub("^, ","", infotext)
+
+ return state, infotext
+
+ return 3, "Memory Device not found"
+
+check_info["dell_poweredge_mem"] = {
+ "check_function" : check_dell_poweredge_mem,
+ "inventory_function" : inventory_dell_poweredge_mem,
+ "service_description" : "%s",
+ "has_perfdata" : False,
+ "snmp_info" : dell_poweredge_mem_info,
+ "snmp_scan" : dell_poweredge_mem_scan,
+}
+
Module: check_mk
Branch: master
Commit: c1ca2a3c2bd99a24d1dd8c6b70981d29e56a48e5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c1ca2a3c2bd99a…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Mar 11 15:40:39 2014 +0100
FIX mkeventd: fixed encoding of unicode characters in the snmptrap receiver
Messages coming in via the build-in snmptrap receiver and containing unicode characters
never matched any rule because the matching algorithm threw an exception. This
has been fixed.
---
.werks/590 | 10 ++++++++++
ChangeLog | 1 +
mkeventd/bin/mkeventd | 8 +++++++-
3 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/590 b/.werks/590
new file mode 100644
index 0000000..20753cf
--- /dev/null
+++ b/.werks/590
@@ -0,0 +1,10 @@
+Title: mkeventd: fixed encoding of unicode characters in the snmptrap receiver
+Level: 2
+Component: ec
+Version: 1.2.5i1
+Date: 1394548319
+Class: fix
+
+Messages coming in via the build-in snmptrap receiver and containing unicode characters
+never matched any rule because the matching algorithm threw an exception. This
+has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 8ea63d9..e71ac16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -345,6 +345,7 @@
* 0679 FIX: Allow non-Ascii characters in generated events
* 0680 FIX: Do not allow spaces in host names in event simulator...
* 0672 FIX: Service item of "Check event state in event console" checks can now be configured...
+ * 0590 FIX: mkeventd: fixed encoding of unicode characters in the snmptrap receiver...
Livestatus:
* 0337 New header for limiting the execution time of a query...
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index b00f40f..c9673a1 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -957,13 +957,19 @@ class EventServer:
return # dropping unhandled snmp version
# once we got here we have a real parsed trap which we convert to an event now
+ text = ', '.join([ '%s: %s' % (item[0], str(item[1]).replace('\n', '')) for item in trap ])
+ # Convert to Unicode, first assume UTF-8, then latin-1
+ try:
+ text = text.decode("utf-8")
+ except:
+ text = text.decode("latin-1")
event = {
'time' : time.time(),
'host' : host.replace('\n', ''),
'priority' : 5, # notice
'facility' : 31, # not used by syslog -> we use this for all traps
'application' : application.replace('\n', ''),
- 'text' : ', '.join([ '%s: %s' % (item[0], str(item[1]).replace('\n', '')) for item in trap ])
+ 'text' : text
}
self.process_event(event)