Module: check_mk
Branch: master
Commit: 0074959b01839c3b1a49e864da757bd403ec8107
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0074959b01839c…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Apr 12 17:33:24 2017 +0200
4618 3par_remotecopy: New check for HPE 3PAR remote copy replication status
Now it is possible to monitor the remote replication of 3PAR devices.
Change-Id: I66b998a45ad346a38be775fb13a958e4ce8038e3
---
.werks/4618 | 10 +++++
agents/special/agent_3par | 2 +-
checkman/3par_remotecopy | 14 ++++++
checks/3par_remotecopy | 79 +++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 59 ++++++++++++++++++++++++
web/plugins/wato/datasource_programs.py | 4 +-
6 files changed, 165 insertions(+), 3 deletions(-)
diff --git a/.werks/4618 b/.werks/4618
new file mode 100644
index 0000000..c80a509
--- /dev/null
+++ b/.werks/4618
@@ -0,0 +1,10 @@
+Title: 3par_remotecopy: New check for HPE 3PAR remote copy replication status
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1492011121
+Class: feature
+
+Now it is possible to monitor the remote replication of 3PAR devices.
diff --git a/agents/special/agent_3par b/agents/special/agent_3par
index 843aece..55bd78c 100755
--- a/agents/special/agent_3par
+++ b/agents/special/agent_3par
@@ -64,7 +64,7 @@ OPTIONS:
opt_host = None
opt_user = None
opt_pass = None
-opt_values = ["system", "cpgs", "volumes",
"hosts", "capacity", "ports"]
+opt_values = ["system", "cpgs", "volumes",
"hosts", "capacity", "ports", "remotecopy"]
short_options = "hh:u:p:v:"
long_options = [ "help", "user=", "password=",
"values=" ]
diff --git a/checkman/3par_remotecopy b/checkman/3par_remotecopy
new file mode 100644
index 0000000..a1bce8f
--- /dev/null
+++ b/checkman/3par_remotecopy
@@ -0,0 +1,14 @@
+title: HPE 3PAR: Remote Copy
+agents: 3par
+catalog: hw/storagehw/hpe
+license: GPL
+distribution: check_mk
+description:
+ This check shows general information about the replication status of the
+ filer. The check will be {CRIT} if the remote copy mode is "STOPPED". Also
+ the check will be {CRIT} if the device reports a status of INVALID or DISABLE
+ and {WARN} for STARTUP, SHUTDOWN or NODEDUP. These states are configurable
+ except for the remote copy mode.
+
+inventory:
+ Only one service is created
diff --git a/checks/3par_remotecopy b/checks/3par_remotecopy
new file mode 100644
index 0000000..2e5aaaf
--- /dev/null
+++ b/checks/3par_remotecopy
@@ -0,0 +1,79 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2017 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-
+# tails. 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.
+
+
+# example output
+
+factory_settings['threepar_remotecopy_default_levels'] = {
+ 1 : 0, # NORMAL
+ 2 : 1, # STARTUP
+ 3 : 1, # SHUTDOWN
+ 4 : 0, # ENABLE
+ 5 : 2, # DISABLE
+ 6 : 2, # INVALID
+ 7 : 1, # NODEDUP
+ 8 : 0, # UPGRADE
+}
+
+def inventory_3par_remotecopy(parsed):
+ if parsed["mode"] > 1:
+ return [ (None, {}) ]
+
+
+def check_3par_remotecopy(_no_item, params, parsed):
+ mode_translate = {
+ 1 : (3, "NONE"),
+ 2 : (0, "STARTED"),
+ 3 : (2, "STOPPED"),
+ }
+
+ state, state_readable = mode_translate[parsed['mode']]
+ yield state, "Mode: %s" % state_readable
+
+ status_translate = {
+ 1 : "NORMAL",
+ 2 : "STARTUP",
+ 3 : "SHUTDOWN",
+ 4 : "ENABLE",
+ 5 : "DISABLE",
+ 6 : "INVALID",
+ 7 : "NODEDUP",
+ 8 : "UPGRADE",
+ }
+
+ status = parsed['status']
+ state_readable = status_translate[status]
+ yield params[status], "Status: %s" % state_readable
+
+check_info['3par_remotecopy'] = {
+ 'parse_function' : parse_3par,
+ 'inventory_function' : inventory_3par_remotecopy,
+ 'check_function' : check_3par_remotecopy,
+ 'service_description' : "Remote copy",
+ 'group' : "threepar_remotecopy",
+ 'default_levels_variable' :
"threepar_remotecopy_default_levels",
+ 'includes' : [ "3par.include" ],
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index b88097b..6d37aa8 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1587,6 +1587,65 @@ register_check_parameters(
"dict"
)
+register_check_parameters(
+ subgroup_applications,
+ "threepar_remotecopy",
+ _("3PAR Remote Copy"),
+ Dictionary(
+ elements = [
+ ("1",
+ MonitoringState(
+ title = _("Status: NORMAL"),
+ default_value = 0,
+ )
+ ),
+ ("2",
+ MonitoringState(
+ title = _("Status: STARTUP"),
+ default_value = 1,
+ )
+ ),
+ ("3",
+ MonitoringState(
+ title = _("Status: SHUTDOWN"),
+ default_value = 1,
+ )
+ ),
+ ("4",
+ MonitoringState(
+ title = _("Status: ENABLE"),
+ default_value = 0,
+ )
+ ),
+ ("5",
+ MonitoringState(
+ title = _("Status: DISBALE"),
+ default_value = 2,
+ )
+ ),
+ ("6",
+ MonitoringState(
+ title = _("Status: INVALID"),
+ default_value = 2,
+ )
+ ),
+ ("7",
+ MonitoringState(
+ title = _("Status: NODEUP"),
+ default_value = 1,
+ )
+ ),
+ ("8",
+ MonitoringState(
+ title = _("Status: UPGRADE"),
+ default_value = 0,
+ )
+ ),
+ ]
+ ),
+ None,
+ "dict"
+)
register_check_parameters(
subgroup_applications,
diff --git a/web/plugins/wato/datasource_programs.py
b/web/plugins/wato/datasource_programs.py
index 7d9e7d8..d6a92da 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -1031,10 +1031,10 @@ register_rule("datasource_programs",
orientation =
"horizontal",
help = _("Possible values are
the following: "
"cpgs, volumes, hosts,
capacity, "
- "system, ports,
hostsets, volumesets, "
+ "system, ports,
remotecopy, hostsets, volumesets, "
"vluns, flashcache,
users, roles, qos.\n"
"If you do not specify
any value the "
- "first six are used as
default.")
+ "first seven are used
as default.")
)),
],
optional_keys = [ "values" ],