Module: check_mk
Branch: master
Commit: 0eecfbffb1e60ee0a6e7a52877756099cf19c101
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0eecfbffb1e60e…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Feb 27 13:30:00 2017 +0100
4448 agent_netapp: now provides systemtime info for 7mode/CM. check will follow soon
Change-Id: I3b0c00c26a099fb3065b40794f51d74f6647ef7d
---
.werks/4448 | 10 ++++++++++
agents/special/agent_netapp | 33 +++++++++++++++++++++++++--------
2 files changed, 35 insertions(+), 8 deletions(-)
diff --git a/.werks/4448 b/.werks/4448
new file mode 100644
index 0000000..9e12808
--- /dev/null
+++ b/.werks/4448
@@ -0,0 +1,10 @@
+Title: agent_netapp: now provides systemtime info for 7mode/CM. check will follow soon
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1488198556
+Class: feature
+
+
diff --git a/agents/special/agent_netapp b/agents/special/agent_netapp
index 2222838..3bd1b79 100755
--- a/agents/special/agent_netapp
+++ b/agents/special/agent_netapp
@@ -24,7 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import sys, getopt
+import sys, getopt, time
# This suppress deprecated warning on older python versions
import warnings
@@ -992,6 +992,14 @@ try:
ha_partners[node] = partner_name
print format_config(container, "cluster",
node.split(".",1)[1])
+ # Systemtime for each node
+ current_time = int(time.time())
+ print "<<<netapp_api_systemtime:sep(9)>>>"
+ for node, entry in cluster_status.items():
+ node_current_time = entry.child_get_string("current-time")
+ print "%s\t%s\t%s" % (node[10:], current_time,
node_current_time)
+
+
# Disk
disks = query("storage-disk-get-iter")
if disks:
@@ -1257,13 +1265,6 @@ try:
print "<<<netapp_api_status>>>"
print format_config(diag_status, "status", "status")
- # 7Mode Cluster info
- if "cf" not in licenses["v1_disabled"]:
- cluster_status = query("cf-status", return_toplevel_node = True)
- if cluster_status:
- print "<<<netapp_api_cluster:sep(9)>>>"
- print format_as_key_value(cluster_status)
-
# Disks
disk_info = query("disk-list-info")
@@ -1334,6 +1335,22 @@ try:
print format_as_key_value(system_info)
print format_as_key_value(system_version)
+
+ # 7Mode Cluster info
+ if "cf" not in licenses["v1_disabled"]:
+ cluster_status = query("cf-status", return_toplevel_node = True)
+ if cluster_status:
+ print "<<<netapp_api_cluster:sep(9)>>>"
+ print format_as_key_value(cluster_status)
+
+ if system_info:
+ system_name = system_info.child_get_string("system-name")
+ print
"<<<netapp_api_systemtime:sep(9)>>>"
+ node_current_time =
cluster_status.child_get_string("current-time")
+ current_time = int(time.time())
+ print "%s\t%s\t%s" % (system_name, current_time,
node_current_time)
+
+
# Sensors: Temp, Fan, PSU
# Definition: all sensors are always monitored by one of the filers
# We choose this filer by an alphanumerical compare