Module: check_mk
Branch: master
Commit: 7d0ddcdcc6b1b0f17dc85102ac119948d4320fc2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d0ddcdcc6b1b0…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Apr 12 17:07:54 2017 +0200
4617 FIX 3par: several fixes for 3PAR Storage Services
This werk includes several fixes for 3par checkplugins. Details are listed below:
- 3par_cpgs: CPGs are only discovered if their have at least one VV
- 3par_ports: Ports are only discoverd if not marked as free
- 3par_hosts: Checks do not crash anymore if the OS type is not delivered in output
- 3par_volumes: Checks to not crash anymore if there is no information about efficiency at all
This Bugfix is compatible although it is recommended to rediscover your host
to get rid of some useless Services.
Change-Id: Iefe71a63abe54807968a99ffe7979765965e936a
---
.werks/4617 | 18 ++++++++++++++++++
checks/3par_cpgs | 13 ++++++++-----
checks/3par_hosts | 4 +++-
checks/3par_ports | 13 ++++++++-----
checks/3par_volumes | 12 +++++++-----
5 files changed, 44 insertions(+), 16 deletions(-)
diff --git a/.werks/4617 b/.werks/4617
new file mode 100644
index 0000000..046b7fc
--- /dev/null
+++ b/.werks/4617
@@ -0,0 +1,18 @@
+Title: 3par: several fixes for 3PAR Storage Services
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1492008730
+Class: fix
+
+This werk includes several fixes for 3par checkplugins. Details are listed below:
+- 3par_cpgs: CPGs are only discovered if their have at least one VV
+- 3par_ports: Ports are only discoverd if not marked as free
+- 3par_hosts: Checks do not crash anymore if the OS type is not delivered in output
+- 3par_volumes: Checks to not crash anymore if there is no information about efficiency at all
+
+This Bugfix is compatible although it is recommended to rediscover your host
+to get rid of some useless Services.
+
diff --git a/checks/3par_cpgs b/checks/3par_cpgs
index 95ba516..7bc9fde 100644
--- a/checks/3par_cpgs
+++ b/checks/3par_cpgs
@@ -24,10 +24,12 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+def count_3par_vvs(line):
+ return line['numFPVVs'] + line['numTDVVs'] + line['numTPVVs']
def inventory_3par_cpgs(parsed):
for entry in parsed['members']:
- if "name" in entry:
+ if "name" in entry and count_3par_vvs(entry) > 0:
yield (entry['name'], {})
@@ -44,8 +46,8 @@ def check_3par_cpgs(item, params, parsed):
if entry['name'] == item:
state, state_readable = states[entry['state']]
- yield state, "%s, %s VVs" % (state_readable, \
- entry['numFPVVs'] + entry['numTDVVs'] + entry['numTPVVs'])
+ yield state, "%s, %s VVs" % (state_readable,
+ count_3par_vvs(entry))
check_info['3par_cpgs'] = {
@@ -59,8 +61,9 @@ check_info['3par_cpgs'] = {
def inventory_3par_cpgs_usage(parsed):
for entry in parsed['members']:
- for fs in ["SAUsage", "SDUsage", "UsrUsage"]:
- yield ("%s %s" % (entry['name'], fs), {})
+ if count_3par_vvs(entry) > 0:
+ for fs in ["SAUsage", "SDUsage", "UsrUsage"]:
+ yield ("%s %s" % (entry['name'], fs), {})
def check_3par_cpgs_usage(item, params, parsed):
for entry in parsed['members']:
diff --git a/checks/3par_hosts b/checks/3par_hosts
index 36f0675..c851674 100644
--- a/checks/3par_hosts
+++ b/checks/3par_hosts
@@ -37,7 +37,9 @@ def check_3par_hosts(item, _no_params, parsed):
continue
if item == entry['name']:
- yield 0, "ID: %s, OS: %s" % (entry['id'], entry['descriptors']['os'])
+ yield 0, "ID: %s" % entry['id']
+ if "descriptors" in entry:
+ yield 0, "OS: %s" % entry['descriptors']['os']
if len(entry['FCPaths']) > 0:
yield 0, "FC Paths: %s" % len(entry['FCPaths'])
elif len(entry['iSCSIPaths']) > 0:
diff --git a/checks/3par_ports b/checks/3par_ports
index fddc894..e24e8a0 100644
--- a/checks/3par_ports
+++ b/checks/3par_ports
@@ -63,11 +63,14 @@ def translate_protocol_3par_ports(number):
def inventory_3par_ports(parsed):
for entry in parsed['members']:
- item = "%s Node %s Slot %s Port %s" % (translate_protocol_3par_ports(entry['protocol']), \
- entry['portPos']['node'],
- entry['portPos']['slot'],
- entry['portPos']['cardPort'])
- yield (item, {})
+ # Only create an item if not "FREE" (type = 3)
+ if not entry['type'] == 3:
+ item = "%s Node %s Slot %s Port %s" % \
+ (translate_protocol_3par_ports(entry['protocol']), \
+ entry['portPos']['node'],
+ entry['portPos']['slot'],
+ entry['portPos']['cardPort'])
+ yield (item, {})
def check_3par_ports(item, params, parsed):
diff --git a/checks/3par_volumes b/checks/3par_volumes
index 698f08c..04a941f 100644
--- a/checks/3par_volumes
+++ b/checks/3par_volumes
@@ -59,11 +59,13 @@ def check_3par_volumes(item, params, parsed):
usr_free = total - entry['userSpace']['usedMiB']
yield df_check_filesystem_list(item, params, [ (item, total, usr_free, 0) ])
- # These sections are not always existend. Only add them if available.
- if "deduplication" in entry['capacityEfficiency']:
- yield 0, "Dedup: %s" % entry['capacityEfficiency']['deduplication']
- if "compaction" in entry['capacityEfficiency']:
- yield 0, "Compact: %s" % entry['capacityEfficiency']['compaction']
+ # This section seems not always to be present...
+ if "capacityEfficiency" in entry:
+ # Even these sections are not always existend. Only add them if available.
+ if "deduplication" in entry['capacityEfficiency']:
+ yield 0, "Dedup: %s" % entry['capacityEfficiency']['deduplication']
+ if "compaction" in entry['capacityEfficiency']:
+ yield 0, "Compact: %s" % entry['capacityEfficiency']['compaction']
# Add some additional information and the performance data about Provisioning
provisioning = entry['userSpace']['rawReservedMiB'] * 1024 * 1024