Module: check_mk
Branch: master
Commit: 1f038183b3cb8b06bceedd54d2f6f541d17a4980
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1f038183b3cb8b…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Sep 7 11:48:57 2015 +0200
fixed naming of check added in werk 2572
---
.werks/2572 | 2 +-
ChangeLog | 2 +-
checkman/{omreport_vdisk => dell_om_vdisks} | 0
checks/dell_om.include | 37 +++++++++++++++++
checks/{omreport_vdisk => dell_om_vdisks} | 2 +-
checks/omreport.include | 60 ---------------------------
6 files changed, 40 insertions(+), 63 deletions(-)
diff --git a/.werks/2572 b/.werks/2572
index d2b9f5a..8ab1781 100644
--- a/.werks/2572
+++ b/.werks/2572
@@ -1,4 +1,4 @@
-Title: omreport_vdisk: New check for virtual disks on Dell OpenManage supported devices
+Title: dell_om_vdisks: New check for virtual disks on Dell OpenManage supported devices
Level: 1
Component: checks
Compatible: compat
diff --git a/ChangeLog b/ChangeLog
index f0da4e0..8e27100 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -72,7 +72,7 @@
* 2563 ipr400_temp, ipr400_in_voltage: New checks for the Omnitronics IPR400
* 2583 new check datapower_tcp: monitors the number of TCP connections in the various
possible states
* 2565 dell_om_disks now warns if SMART predicts disk failure
- * 2572 omreport_vdisk: New check for virtual disks on Dell OpenManage supported
devices
+ * 2572 dell_om_vdisks: New check for virtual disks on Dell OpenManage supported
devices
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/checkman/omreport_vdisk b/checkman/dell_om_vdisks
similarity index 100%
rename from checkman/omreport_vdisk
rename to checkman/dell_om_vdisks
diff --git a/checks/dell_om.include b/checks/dell_om.include
index ea3bd08..fa57c66 100644
--- a/checks/dell_om.include
+++ b/checks/dell_om.include
@@ -28,7 +28,44 @@
# 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")
+
+
+def parse_omreport(info):
+ result = {}
+ current_obj = {}
+
+ def insert(obj):
+ result[obj["ID"]] = obj.copy()
+ obj.clear()
+
+ for line in info:
+ try:
+ idx = line.index(":")
+ except ValueError:
+ # no colon in the line
+ continue
+ key = " ".join(line[:idx])
+ value = " ".join(line[idx + 1:])
+ if key == "ID" and current_obj:
+ insert(current_obj)
+
+ current_obj[key] = value
+
+ insert(current_obj)
+ return result
+
+
+def status_translate_omreport(code):
+ return {
+ "ok" : 0,
+ "non-critical" : 1,
+ "critical" : 2,
+ "not found" : 3
+ }.get(code.lower(), 2)
+
diff --git a/checks/omreport_vdisk b/checks/dell_om_vdisks
similarity index 98%
rename from checks/omreport_vdisk
rename to checks/dell_om_vdisks
index 9b608ac..5158137 100644
--- a/checks/omreport_vdisk
+++ b/checks/dell_om_vdisks
@@ -68,6 +68,6 @@ check_info["omreport_vdisk"] = {
"inventory_function" : inventory_omreport_vdisk,
"parse_function" : parse_omreport,
"service_description" : "Virtual Disk %s",
- "includes" : ["omreport.include"]
+ "includes" : ["dell_om.include"]
}
diff --git a/checks/omreport.include b/checks/omreport.include
deleted file mode 100644
index 8d8ea5a..0000000
--- a/checks/omreport.include
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/python
-# -*- encoding: utf-8; py-indent-offset: 4 -*-
-# +------------------------------------------------------------------+
-# | ____ _ _ __ __ _ __ |
-# | / ___| |__ ___ ___| | __ | \/ | |/ / |
-# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-# | | |___| | | | __/ (__| < | | | | . \ |
-# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-# | |
-# | Copyright Mathias Kettner 2015 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.
-
-
-def parse_omreport(info):
- result = {}
- current_obj = {}
-
- def insert(obj):
- result[obj["ID"]] = obj.copy()
- obj.clear()
-
- for line in info:
- try:
- idx = line.index(":")
- except ValueError:
- # no colon in the line
- continue
- key = " ".join(line[:idx])
- value = " ".join(line[idx + 1:])
- if key == "ID" and current_obj:
- insert(current_obj)
-
- current_obj[key] = value
-
- insert(current_obj)
- return result
-
-
-def status_translate_omreport(code):
- return {
- "ok" : 0,
- "non-critical" : 1,
- "critical" : 2,
- "not found" : 3
- }.get(code.lower(), 2)
-