Module: check_mk
Branch: master
Commit: d797f5a8efc7a1c1cfd15f41d60a7e24066cb44c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d797f5a8efc7a1…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jun 26 13:34:44 2017 +0200
4838 FIX netapp_api_volumes: No longer shows service descriptions with UUIDs
The datasource program rule for the netapp agent offers an option to skip
the performance counters for volumes. When this option was set (default off)
the service description changed from a <i>vserver_name.volume_name</i> style
to the <i>uuid</i>. This has been fixed. You can now set the counters
"off"
without the risk of a changed service description.
Change-Id: I40c2c67f1f33ebc0766585024c44ed2bf406f6f5
---
.werks/4838 | 14 ++++++++++++++
agents/special/agent_netapp | 20 +++++++++++---------
checks/netapp_api_volumes | 6 +++++-
3 files changed, 30 insertions(+), 10 deletions(-)
diff --git a/.werks/4838 b/.werks/4838
new file mode 100644
index 0000000..83227a3
--- /dev/null
+++ b/.werks/4838
@@ -0,0 +1,14 @@
+Title: netapp_api_volumes: No longer shows service descriptions with UUIDs
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.5.0i1
+Date: 1498476639
+Class: fix
+
+The datasource program rule for the netapp agent offers an option to skip
+the performance counters for volumes. When this option was set (default off)
+the service description changed from a <i>vserver_name.volume_name</i> style
+to the <i>uuid</i>. This has been fixed. You can now set the counters
"off"
+without the risk of a changed service description.
diff --git a/agents/special/agent_netapp b/agents/special/agent_netapp
index 0722baf..334093d 100755
--- a/agents/special/agent_netapp
+++ b/agents/special/agent_netapp
@@ -1037,22 +1037,24 @@ try:
config_report = [
"volume-space-attributes.size-available",
"volume-space-attributes.size-total",
"volume-state-attributes.state",
+
"volume-id-attributes.owning-vserver-name",
"volume-id-attributes.name",
"volume-id-attributes.node",
"volume-id-attributes.msid",
"volume-inode-attributes.files-total",
"volume-inode-attributes.files-used" ],
- config_rename = {
"volume-space-attributes.size-available": "size-available",
-
"volume-space-attributes.size-total" : "size-total",
-
"volume-state-attributes.state" : "state",
-
"volume-id-attributes.name" : "name",
-
"volume-id-attributes.msid" : "msid",
-
"volume-id-attributes.node" : "node",
-
"volume-inode-attributes.files-total" : "files-total",
-
"volume-inode-attributes.files-used" : "files-used" },
+ config_rename = {
"volume-space-attributes.size-available" : "size-available",
+
"volume-space-attributes.size-total" : "size-total",
+
"volume-state-attributes.state" : "state",
+
"volume-id-attributes.owning-vserver-name" : "vserver_name",
+
"volume-id-attributes.name" : "name",
+
"volume-id-attributes.msid" : "msid",
+
"volume-id-attributes.node" : "node",
+
"volume-inode-attributes.files-total" : "files-total",
+
"volume-inode-attributes.files-used" : "files-used" },
extra_info = create_dict(volume_counters,
custom_key = [ "instance_uuid" ]),
extra_info_report = sum(map(lambda x:
["%s" % x, "nfs_%s" % x, "cifs_%s" % x, "san_%s" %
x, "fcp_%s" % x, "iscsi_%s" % x],
- sum(map(lambda x:
["read_%s" % x, "write_%s" % x], ["data",
"latency", "ops"]), [])), []) + [ "instance_name",
"vserver_name" ],
+ sum(map(lambda x:
["read_%s" % x, "write_%s" % x], ["data",
"latency", "ops"]), [])), []) + [ "instance_name" ],
skip_missing_config_key = True
)
diff --git a/checks/netapp_api_volumes b/checks/netapp_api_volumes
index 74d5709..c6e6a41 100644
--- a/checks/netapp_api_volumes
+++ b/checks/netapp_api_volumes
@@ -52,7 +52,11 @@ def check_netapp_api_volumes(item, params, parsed):
volume = parsed.get(item)
if not volume:
- return 3, "Volume not found in agent output"
+ # Specific error message for legacy checks with an uuid as item
+ if len(item.split("-")) > 4:
+ return 3, "The service description with an UUID is no longer supported.
Please do a rediscovery."
+ else:
+ return 3, "Volume not found in agent output"
if volume.get("state") != "online":
return 1, "Volume is %s" % volume.get("state")