Module: check_mk
Branch: master
Commit: 4cd460b9b59ea9e223d18638f545718a273cf449
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4cd460b9b59ea9…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Nov 11 17:20:26 2015 +0100
#2787 netapp_api_snapvaults: Clustermode supported, netapp_api_disks: fixed invalid total
disk space
<i>netapp_api_snapvaults</i>: You can now monitor the Snapmirror Lag Time with
NetApp Clustermode.
<i>netapp_api_disks</i>: Total disk space was incorrectly reported by the
agent.
---
.werks/2787 | 12 +++++++++++
ChangeLog | 1 +
agents/special/agent_netapp | 21 +++++++++++++++++--
checkman/netapp_api_snapvault | 2 +-
checks/netapp_api_disk | 2 +-
checks/netapp_api_snapvault | 37 +++++++++++++++++++++++-----------
web/plugins/wato/check_parameters.py | 26 +++++++++++++++++++++---
7 files changed, 82 insertions(+), 19 deletions(-)
diff --git a/.werks/2787 b/.werks/2787
new file mode 100644
index 0000000..49e3a83
--- /dev/null
+++ b/.werks/2787
@@ -0,0 +1,12 @@
+Title: netapp_api_snapvaults: Clustermode supported, netapp_api_disks: fixed invalid
total disk space
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447258603
+Class: feature
+
+<i>netapp_api_snapvaults</i>: You can now monitor the Snapmirror Lag Time
with NetApp Clustermode.
+
+<i>netapp_api_disks</i>: Total disk space was incorrectly reported by the
agent.
+
diff --git a/ChangeLog b/ChangeLog
index 513fd37..9f2be85 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
* 2708 sap, sap_state: new sap_state service reports connection problems to sap
hosts...
* 2740 local: better warning output in case of invalid agent output
* 2763 apache_status: Can now be configured to use the protocols default port...
+ * 2787 netapp_api_snapvaults: Clustermode supported, netapp_api_disks: fixed invalid
total disk space...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/agents/special/agent_netapp b/agents/special/agent_netapp
index 65b3ba1..7753ef7 100755
--- a/agents/special/agent_netapp
+++ b/agents/special/agent_netapp
@@ -482,8 +482,8 @@ if netapp_mode == "clustermode":
"disk-raid-info.position",
"disk-raid-info.used-blocks",
"disk-raid-info.physical-blocks" ],
- config_scale = {
"disk-raid-info.physical-blocks": 512,
-
"disk-raid-info.used-blocks": 512 },
+ config_scale = {
"disk-raid-info.physical-blocks": 4096,
+
"disk-raid-info.used-blocks": 4096 },
config_rename = {
"disk-inventory-info.shelf-bay": "bay",
"disk-inventory-info.serial-number": "serial-number",
"disk-inventory-info.vendor": "vendor-id",
@@ -549,6 +549,23 @@ if netapp_mode == "clustermode":
for key, values in child_dict.items():
print format_dict(values, prefix = "node %s" % key, as_line =
True)
+ # Snapmirror / Snapvault lag-time
+ snapmirror_info = query("snapmirror-get-iter")
+ if snapmirror_info:
+ print "<<<netapp_api_snapvault:sep(9)>>>"
+ print format_config(snapmirror_info, "snapvault",
"destination-volume",
+ config_report = [
"destination-volume-node",
+ "policy",
+ "mirror-state",
+ "source-vserver",
+ "lag-time",
+ "relationship-status" ],
+ config_rename = {
"destination-volume-node": "destination-system",
+ "mirror-state":
"state",
+ "source-vserver":
"source-system",
+ "relationship-status":
"status" }
+ )
+
# Environmental sensors
environment_info = query_nodes("storage-shelf-environment-list-info",
only_first = True)
if environment_info:
diff --git a/checkman/netapp_api_snapvault b/checkman/netapp_api_snapvault
index ba7fc9b..60ebb7c 100644
--- a/checkman/netapp_api_snapvault
+++ b/checkman/netapp_api_snapvault
@@ -1,4 +1,4 @@
-title: NetApp Filer 7Mode: Snapvault lag-time
+title: NetApp Filer: Snapvault/Snapmirror lag-time
agents: netapp
catalog: hw/storagehw/netapp
license: GPL
diff --git a/checks/netapp_api_disk b/checks/netapp_api_disk
index ff047ae..e2e148b 100644
--- a/checks/netapp_api_disk
+++ b/checks/netapp_api_disk
@@ -73,7 +73,7 @@ def check_netapp_api_disk_summary(_no_item, params, info):
disk['state'] = "spare"
else:
disk['state'] = 'ok'
- disk['capacity'] = int(disk['used-space'])
+ disk['capacity'] = int(disk['physical-space'])
disks_converted.append(disk)
diff --git a/checks/netapp_api_snapvault b/checks/netapp_api_snapvault
index cd60ef7..556ed9c 100644
--- a/checks/netapp_api_snapvault
+++ b/checks/netapp_api_snapvault
@@ -31,26 +31,39 @@
# snapvault /vol/ipb_vol0/ status idle state snapvaulted lag-time 97011
source-system 172.31.12.15
def inventory_netapp_api_snapvault(parsed):
- for volume in parsed:
- yield volume, {}
+ for snapvault in parsed:
+ yield snapvault, {}
def check_netapp_api_snapvault(item, params, parsed):
- volume = parsed.get(item)
- if not volume:
+ snapvault = parsed.get(item)
+ if not snapvault:
return
info = []
- for what in [ "source-system", "status", "state",
"destination-system" ]:
- yield 0, "%s: %s" % (what.title(), volume[what])
+ for what in [ "source-system", "destination-system",
"policy", "status", "state" ]:
+ if what in snapvault:
+ yield 0, "%s: %s" % (what.title(), snapvault[what])
- lag_time = int(volume["lag-time"])
+ lag_time = int(snapvault["lag-time"])
state = 0
if params:
- warn, crit = params["lag_time"]
- if lag_time >= crit:
- state = 2
- elif lag_time >= warn:
- state = 1
+ levels = None
+ snapvault_policy = snapvault.get("policy")
+
+ for name, policy_levels in params.get("policy_lag_time", []):
+ if name == snapvault_policy:
+ levels = policy_levels
+ break
+
+ if not levels and params.get("lag_time"):
+ levels = params["lag_time"]
+
+ if levels:
+ warn, crit = levels
+ if lag_time >= crit:
+ state = 2
+ elif lag_time >= warn:
+ state = 1
yield state, "Lag-Time: %s" % get_age_human_readable(lag_time)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 6e938b5..1a31f67 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6589,20 +6589,40 @@ register_check_parameters(
register_check_parameters(
subgroup_storage,
"snapvault",
- _("NetApp Snapvaults"),
+ _("NetApp Snapvaults / Snapmirror Lag Time"),
Dictionary(
elements = [
("lag_time",
Tuple(
- title = _("Maximum age of lag-time"),
+ title = _("Default levels"),
elements = [
Age(title = _("Warning at")),
Age(title = _("Critical at")),
],
),
),
+ ("policy_lag_time",
+ ListOf(
+ Tuple(
+ orientation = "horizontal",
+ elements = [
+ TextAscii(title = _("Policy name")),
+ Tuple(
+ title = _("Maximum age"),
+ elements = [
+ Age(title = _("Warning at")),
+ Age(title = _("Critical at")),
+ ],
+ ),
+ ]
+ ),
+ title = _('Policy specific levels (Clustermode only)'),
+ help = _("Here you can specify levels for different policies
which overrule the levels "
+ "from the <i>Default levels</i> parameter.
This setting only works in NetApp Clustermode setups."),
+ allow_empty = False,
+ )
+ )
],
- optional_keys = False
),
TextAscii(
title = _("Source Path"),