Module: check_mk
Branch: master
Commit: 2c4a983834b8d8f433a9446aec40f9b44cd2f029
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2c4a983834b8d8…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Mar 25 17:04:34 2014 +0100
ibm_svc_mdiskgrp: New check for status and usage of MDisksGrps in IBM SVC / V7000 devices
---
.werks/770 | 8 +++
ChangeLog | 1 +
checkman/ibm_svc_mdiskgrp | 43 ++++++++++++
checks/ibm_svc_mdiskgrp | 95 +++++++++++++++++++++++++++
pnp-templates/check_mk-ibm_svc_mdiskgrp.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
6 files changed, 149 insertions(+)
diff --git a/.werks/770 b/.werks/770
new file mode 100644
index 0000000..a8833c9
--- /dev/null
+++ b/.werks/770
@@ -0,0 +1,8 @@
+Title: ibm_svc_mdiskgrp: New check for status and usage of MDisksGrps in IBM SVC / V7000 devices
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1395763421
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index ce1239a..3f2c08e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -131,6 +131,7 @@
* 0598 kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
* 0768 ibm_svc_license: New check for Licensing Status on IBM SVC / V7000 devices
* 0769 ibm_svc_mdisk: new check for status and mode of MDisks in an IBM SVC / V7000 device
+ * 0770 ibm_svc_mdiskgrp: New check for status and usage of MDisksGrps in IBM SVC / V7000 devices
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/ibm_svc_mdiskgrp b/checkman/ibm_svc_mdiskgrp
new file mode 100644
index 0000000..7f5846d
--- /dev/null
+++ b/checkman/ibm_svc_mdiskgrp
@@ -0,0 +1,43 @@
+title: IBM SVC / V7000: Status and Usage of MDisksGrps
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status and usage of MDisksGrps in an IBM SVC / V7000 device.
+
+ It uses the check logic of the {df} check, so for configuration parameters
+ and examples please refer to the man page of {df}.
+
+ Additionally the status of the MDisksGrp is checked. On every other status
+ than {online} the check results in {CRIT} status.
+
+item:
+ The name of the MDisksGrp
+
+inventory:
+ Creates one check for every MDiskGrp in th IBM SVC / V7000 device.
+
+examples:
+ # set levels for the MDiskGrp Quorum_1 to 90% for WARN and 95% for CRIT
+ # for all hosts with the host tag ibmsvc
+ checkgroup_parameters['filesystem'] = [
+ ( {'levels': (90.0, 95.0)}, ['ibmsvc'], ALL_HOSTS, ['Quorum_1$'] ),
+ ] + checkgroup_parameters['filesystem']
+
+perfdata:
+ Three values: The first value is the used space of in the MDiskGrp
+ in MB. Also the minimum (0 MB), maximum (Capacity of the MDiskGrp)
+ and the warning and critical levels in MB are provided.
+ The second is the change of the usage in MB per range since the last check
+ (e.g. in MB per 24 hours) and the 3rd is the averaged change (so called
+ trend), also in MB per range. Please note, that performance data for
+ trends is enabled per default. You can globally disable that in {main.mk}
+ with {filesystem_default_levels["trend_perfdata"] = False}.
+
+[parameters]
+parameters (dict): See man page of {df}.
+
+[configuration]
+filesystem_default_levels: And other, see man page of {df}.
+
diff --git a/checks/ibm_svc_mdiskgrp b/checks/ibm_svc_mdiskgrp
new file mode 100644
index 0000000..c28ba6d
--- /dev/null
+++ b/checks/ibm_svc_mdiskgrp
@@ -0,0 +1,95 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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-
+# ails. 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 from agent:
+# <<<ibm_svc_mdiskgrp:sep(58)>>>
+# 0:Quorum_2:online:1:0:704.00MB:64:704.00MB:0.00MB:0.00MB:0.00MB:0:0:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 1:stp5_450G_03:online:18:6:29.43TB:256:21.68TB:8.78TB:7.73TB:7.75TB:29:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 4:stp5_450G_02:online:15:14:24.53TB:256:277.00GB:24.26TB:24.26TB:24.26TB:98:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 9:stp6_450G_03:online:18:6:29.43TB:256:21.68TB:8.78TB:7.73TB:7.75TB:29:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 10:stp6_450G_02:online:15:14:24.53TB:256:277.00GB:24.26TB:24.26TB:24.26TB:98:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 15:stp6_300G_01:online:15:23:16.34TB:256:472.50GB:15.88TB:15.88TB:15.88TB:97:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 16:stp5_300G_01:online:15:23:16.34TB:256:472.50GB:15.88TB:15.88TB:15.88TB:97:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 17:Quorum_1:online:1:0:512.00MB:256:512.00MB:0.00MB:0.00MB:0.00MB:0:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 18:Quorum_0:online:1:0:512.00MB:256:512.00MB:0.00MB:0.00MB:0.00MB:0:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 21:stp5_450G_01:online:12:31:19.62TB:256:320.00GB:19.31TB:19.31TB:19.31TB:98:0:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 22:stp6_450G_01:online:12:31:19.62TB:256:320.00GB:19.31TB:19.31TB:19.31TB:98:0:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 23:stp5_600G_01:online:3:2:6.54TB:256:512.00MB:6.54TB:6.54TB:6.54TB:99:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+# 24:stp6_600G_01:online:3:2:6.54TB:256:512.00MB:6.54TB:6.54TB:6.54TB:99:80:auto:inactive:no:0.00MB:0.00MB:0.00MB
+
+def ibm_svc_mdiskgrp_to_mb(size):
+ if size.endswith("MB"):
+ size = int(float(size.replace("MB", "")))
+ elif size.endswith("GB"):
+ size = int(float(size.replace("GB", ""))) * 1024
+ elif size.endswith("TB"):
+ size = int(float(size.replace("TB", ""))) * 1024 * 1024
+ elif size.endswith("PB"):
+ size = int(float(size.replace("PB", ""))) * 1024 * 1024 * 1024
+ elif size.endswith("EB"):
+ size = int(float(size.replace("EB", ""))) * 1024 * 1024 * 1024 * 1024
+ return size
+
+def inventory_ibm_svc_mdiskgrp(info):
+ inventory = []
+ for mgrp_id, mgrp_name, mgrp_status, mdisk_count, vdisk_count, capacity, \
+ extent_size, free_capacity, virtual_capacity, used_capacity, \
+ real_capacity, overallocation, mgrp_warning, easy_tier, easy_tier_status, \
+ compression_active, compression_virtual_capacity, compression_compressed_capacity, \
+ compression_uncompressed_capacity in info:
+ inventory.append( (mgrp_name, {}) )
+ return inventory
+
+def check_ibm_svc_mdiskgrp(item, params, info):
+ for mgrp_id, mgrp_name, mgrp_status, mdisk_count, vdisk_count, capacity, \
+ extent_size, free_capacity, virtual_capacity, used_capacity, \
+ real_capacity, overallocation, mgrp_warning, easy_tier, easy_tier_status, \
+ compression_active, compression_virtual_capacity, compression_compressed_capacity, \
+ compression_uncompressed_capacity in info:
+ if mgrp_name == item:
+ if mgrp_status != "online":
+ return 2, "MDiskGrp %s reports status %s" % (item, mgrp_status)
+ fslist = []
+ size_mb = ibm_svc_mdiskgrp_to_mb(capacity)
+ avail_mb = ibm_svc_mdiskgrp_to_mb(free_capacity)
+ fslist.append((item, size_mb, avail_mb))
+ status, message, perfdata = df_check_filesystem_list(item, params, fslist)
+ message += ", MDiskGrp %s reports status %s" % (item, mgrp_status)
+ return status, message, perfdata
+
+ return 3, "MDiskGrp %s not found in agent output" % item
+
+
+check_info["ibm_svc_mdiskgrp"] = {
+ "check_function" : check_ibm_svc_mdiskgrp,
+ "inventory_function" : inventory_ibm_svc_mdiskgrp,
+ "service_description" : "IBM SVC MDiskGrp %s",
+ "has_perfdata" : True,
+ "group" : "filesystem",
+ "includes" : [ "df.include" ],
+ "default_levels_variable" : "filesystem_default_levels",
+}
+
diff --git a/pnp-templates/check_mk-ibm_svc_mdiskgrp.php b/pnp-templates/check_mk-ibm_svc_mdiskgrp.php
new file mode 120000
index 0000000..aac1010
--- /dev/null
+++ b/pnp-templates/check_mk-ibm_svc_mdiskgrp.php
@@ -0,0 +1 @@
+check_mk-hitachi_hnas_volume.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index dee8d8e..b9f7f4a 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -75,6 +75,7 @@ perfometers["check_mk-hitachi_hnas_span"] = perfometer_check_mk_df
perfometers["check_mk-hitachi_hnas_volume"] = perfometer_check_mk_df
perfometers["check_mk-emcvnx_raidgroups.capacity"] = perfometer_check_mk_df
perfometers["check_mk-emcvnx_raidgroups.capacity_contiguous"] = perfometer_check_mk_df
+perfometers["check_mk-ibm_svc_mdiskgrp"] = perfometer_check_mk_df
def perfometer_esx_vsphere_datastores(row, check_command, perf_data):
used_mb = perf_data[0][1]
Module: check_mk
Branch: master
Commit: 3e671e09560b268f683c58c7b22f3da7209fdb41
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3e671e09560b26…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Mar 25 15:26:22 2014 +0100
ibm_svc_mdisk: new check for status and mode of MDisks in an IBM SVC / V7000 device
---
.werks/769 | 8 +++++
ChangeLog | 1 +
checkman/ibm_svc_mdisk | 17 +++++++++++
checks/ibm_svc_mdisk | 78 ++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 104 insertions(+)
diff --git a/.werks/769 b/.werks/769
new file mode 100644
index 0000000..6e49114
--- /dev/null
+++ b/.werks/769
@@ -0,0 +1,8 @@
+Title: ibm_svc_mdisk: new check for status and mode of MDisks in an IBM SVC / V7000 device
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1395757553
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 04ffb59..ce1239a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -130,6 +130,7 @@
* 0707 ibm_svc_host: New check: Status of hosts an IBM SVC / V7000 presents volumes to
* 0598 kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
* 0768 ibm_svc_license: New check for Licensing Status on IBM SVC / V7000 devices
+ * 0769 ibm_svc_mdisk: new check for status and mode of MDisks in an IBM SVC / V7000 device
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/ibm_svc_mdisk b/checkman/ibm_svc_mdisk
new file mode 100644
index 0000000..b870de4
--- /dev/null
+++ b/checkman/ibm_svc_mdisk
@@ -0,0 +1,17 @@
+title: IBM SVC / V7000: Status and Mode of MDisks
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Checks the status and mode of MDisks in an IBM SVC / V7000 device.
+
+ Status {online} is {OK}, status {offline} and {excluded} are {CRIT} and
+ every other status is {WARN}.
+
+ Mode {managed} is {OK} and every other mode is {WARN}.
+
+ The worst of both is returned as check result.
+
+inventory:
+ Creates one check for every MDisk in th IBM SVC / V7000 device.
diff --git a/checks/ibm_svc_mdisk b/checks/ibm_svc_mdisk
new file mode 100644
index 0000000..2422ae6
--- /dev/null
+++ b/checks/ibm_svc_mdisk
@@ -0,0 +1,78 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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-
+# ails. 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 from agent:
+# <<<ibm_svc_mdisk:sep(58)>>>
+# 0:stp5_300G_01-01:online:managed:16:stp5_300G_01:1.1TB:0000000000000000:BLUBB5:600a0b80006e1dbc0000f6f9513026a000000000000000000000000000000000:generic_hdd
+# 1:Quorum_BLUBB3:online:managed:0:Quorum_2:1.0GB:0000000000000000:BLUBB3:600a0b8000293eb800001f264c3e8a1f00000000000000000000000000000000:generic_hdd
+# 2:stp6_300G_01-01:online:managed:15:stp6_300G_01:1.1TB:0000000000000000:BLUBB6:600a0b80006e8e3c00000f1651302b8800000000000000000000000000000000:generic_hdd
+# 3:Quorum_blubb5:online:managed:18:Quorum_0:1.0GB:0000000000000001:BLUBB5:600a0b80006e1dcc0000f6905130225800000000000000000000000000000000:generic_hdd
+# 4:Quorum_blubb6:online:managed:17:Quorum_1:1.0GB:0000000000000001:BLUBB6:600a0b80006e1d5e00000dcb5130228700000000000000000000000000000000:generic_hdd
+# 5:stp5_300G_01-02:online:managed:16:stp5_300G_01:1.1TB:0000000000000002:BLUBB5:600a0b80006e1dbc0000f6fc51304bfc00000000000000000000000000000000:generic_hdd
+# 6:stp6_300G_01-02:online:managed:15:stp6_300G_01:1.1TB:0000000000000002:BLUBB6:600a0b80006e8e3c00000f1951304f9a00000000000000000000000000000000:generic_hdd
+# 7:stp5_300G_01-03:online:managed:16:stp5_300G_01:1.1TB:0000000000000003:BLUBB5:600a0b80006e1dcc0000f76951305bc000000000000000000000000000000000:generic_hdd
+# 8:stp6_300G_01-03:online:managed:15:stp6_300G_01:1.1TB:0000000000000003:BLUBB6:600a0b80006e1d5e00000e9a51305a3200000000000000000000000000000000:generic_hdd
+# 9:stp5_300G_01-04:online:managed:16:stp5_300G_01:1.1TB:0000000000000004:BLUBB5:600a0b80006e1dbc0000f7d051341cc000000000000000000000000000000000:generic_hdd
+
+
+def inventory_ibm_svc_mdisk(info):
+ inventory = []
+ for mdisk_id, mdisk_name, mdisk_status, mdisk_mode, mdisk_grp_id, mdisk_grp_name, capacity, ctrl_lun_number, controller_name, mdisk_uid, tier in info:
+ inventory.append( (mdisk_name, None) )
+ return inventory
+
+def check_ibm_svc_mdisk(item, _no_params, info):
+ status = 3
+ for mdisk_id, mdisk_name, mdisk_status, mdisk_mode, mdisk_grp_id, mdisk_grp_name, capacity, ctrl_lun_number, controller_name, mdisk_uid, tier in info:
+ if mdisk_name == item:
+
+ # Check mdisk_status
+ message = "%s reports status %s" % (item, mdisk_status)
+ if mdisk_status == "online":
+ status = 0
+ elif mdisk_status == "offline" or mdisk_status == "excluded":
+ status = 2
+ message += "(!!)"
+ else:
+ status = 1
+ message += "(!)"
+
+ # check mdisk_mode
+ message += ", Mode %s" % mdisk_mode
+ if mdisk_mode != "managed":
+ status = max(status, 1)
+ message += "(!)"
+
+ return status, message
+ return 3, "MDisk %s not found in agent output" % item
+
+check_info["ibm_svc_mdisk"] = {
+ "check_function" : check_ibm_svc_mdisk,
+ "inventory_function" : inventory_ibm_svc_mdisk,
+ "service_description" : "IBM SVC MDisk %s",
+ "has_perfdata" : False,
+}
+
Module: check_mk
Branch: master
Commit: 132ee3eb48dae6453217078f6f5c6c77f9383db8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=132ee3eb48dae6…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Mar 25 14:16:25 2014 +0100
ibm_svc_host: additional state online
---
checkman/ibm_svc_host | 4 ++--
checks/ibm_svc_host | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/checkman/ibm_svc_host b/checkman/ibm_svc_host
index f8bb1fd..9a43898 100644
--- a/checkman/ibm_svc_host
+++ b/checkman/ibm_svc_host
@@ -6,8 +6,8 @@ distribution: check_mk
description:
Checks the status of hosts an IBM SVC / V7000 presents volumes to.
- If there are only hosts reporting status {active} or {inactive} the
- check returns {OK}. If there are hosts reporting {degraded} status or
+ If there are only hosts reporting status {active}, {online} or {inactive}
+ the check returns {OK}. If there are hosts reporting {degraded} status or
any unidentified status the check returns {WARN}. If some hosts report
{offline} status the check returns {CRIT}.
diff --git a/checks/ibm_svc_host b/checks/ibm_svc_host
index e648061..934255f 100644
--- a/checks/ibm_svc_host
+++ b/checks/ibm_svc_host
@@ -43,7 +43,7 @@ def check_ibm_svc_host(item, _no_params, info):
degraded += 1
elif line[4] == 'offline':
offline += 1
- elif line[4] == 'active':
+ elif line[4] == 'active' or line[4] == 'online':
active += 1
elif line[4] == 'inactive':
inactive += 1
Module: check_mk
Branch: master
Commit: 3c6a1dcda82ee5a86c09aff4ba1950eccbe415a8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3c6a1dcda82ee5…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Mar 25 13:59:47 2014 +0100
ibm_svc_license: New check for Licensing Status on IBM SVC / V7000 devices
---
.werks/768 | 8 +++
ChangeLog | 3 +-
checkman/ibm_svc_license | 16 ++++++
checks/ibm_svc_license | 73 ++++++++++++++++++++++++++++
pnp-templates/check_mk-ibm_svc_license.php | 37 ++++++++++++++
web/plugins/perfometer/check_mk.py | 13 +++++
6 files changed, 149 insertions(+), 1 deletion(-)
diff --git a/.werks/768 b/.werks/768
new file mode 100644
index 0000000..d4cdbd8
--- /dev/null
+++ b/.werks/768
@@ -0,0 +1,8 @@
+Title: ibm_svc_license: New check for Licensing Status on IBM SVC / V7000 devices
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1395752352
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 4306759..04ffb59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -125,10 +125,11 @@
* 0760 The windows agent contains meta information about version, manufacturer etc....
* 0145 apc_symmetra: Changed naming of Batterie Temperature to System Temerature...
NOTE: Please refer to the migration notes!
- * 0598 kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
* 0735 mem.win: now able to configure swap file levels
* 0146 innovaphone_priports_l1, innovaphone_priports_l2: New Checks for Innovaphone PRI Ports
* 0707 ibm_svc_host: New check: Status of hosts an IBM SVC / V7000 presents volumes to
+ * 0598 kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
+ * 0768 ibm_svc_license: New check for Licensing Status on IBM SVC / V7000 devices
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/ibm_svc_license b/checkman/ibm_svc_license
new file mode 100644
index 0000000..96ee633
--- /dev/null
+++ b/checkman/ibm_svc_license
@@ -0,0 +1,16 @@
+title: IBM SVC / V7000: Licensing Status
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ For every licensed feature on an IBM SVC / V7000 device, the number
+ of licenses is compared to the usage of licenses. The check returns
+ {CRIT} if the usage is higher than the licensing and {OK} otherwise.
+
+perfdata:
+ Two values are reported: The number of licenses you have and the number
+ of licenses used.
+
+inventory:
+ Creates one check for every licensable feature.
diff --git a/checks/ibm_svc_license b/checks/ibm_svc_license
new file mode 100644
index 0000000..4e7b6b4
--- /dev/null
+++ b/checks/ibm_svc_license
@@ -0,0 +1,73 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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-
+# ails. 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 from agent:
+# Put here the example output from your TCP-Based agent. If the
+# check is SNMP-Based, then remove this section
+
+def parse_ibm_svc_license(info):
+ licenses = {}
+ for line in info:
+ if line[0].startswith("license_"):
+ license = line[0].replace("license_", "")
+ if not license in licenses.keys():
+ licenses[license] = [0.0, 0.0]
+ if line[1] == "off":
+ licenses[license][0] = 0.0
+ else:
+ licenses[license][0] = float(line[1])
+ if line[0].startswith("used_"):
+ license = line[0].replace("used_", "")
+ if not license in licenses.keys():
+ licenses[license] = [0.0, 0.0]
+ licenses[license][1] = float(line[1])
+ return licenses
+
+def inventory_ibm_svc_license(info):
+ inventory = []
+ licenses = parse_ibm_svc_license(info)
+ for license in licenses.keys():
+ inventory.append( (license, None) )
+ return inventory
+
+def check_ibm_svc_license(item, _no_params, info):
+ licenses = parse_ibm_svc_license(info)
+ licensed, used = licenses[item]
+ perfdata = [ ("licensed", licensed), ("used", used) ]
+
+ if used > licensed:
+ status = 2
+ else:
+ status = 0
+ return status, "%s %s licensed, %s used" % (item, licensed, used), perfdata
+
+check_info["ibm_svc_license"] = {
+ "check_function" : check_ibm_svc_license,
+ "inventory_function" : inventory_ibm_svc_license,
+ "service_description" : "IBM SVC License %s",
+ "has_perfdata" : True,
+}
+
diff --git a/pnp-templates/check_mk-ibm_svc_license.php b/pnp-templates/check_mk-ibm_svc_license.php
new file mode 100644
index 0000000..dd8a597
--- /dev/null
+++ b/pnp-templates/check_mk-ibm_svc_license.php
@@ -0,0 +1,37 @@
+<?php
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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-
+# ails. 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.
+
+$opt[1] = '--vertical-label "Licenses" --title "' . $this->MACRO['DISP_HOSTNAME'] . ' / ' . $this->MACRO['DISP_SERVICEDESC'] . ' per State" --lower=0';
+
+$def[1] = ""
+ . "DEF:licensed=$RRDFILE[1]:$DS[1]:MAX "
+ . "DEF:used=$RRDFILE[2]:$DS[2]:MAX "
+ . "AREA:used#008000:\"Used \" "
+ . "GPRINT:used:AVERAGE:\"% 6.0lf avg\" "
+ . "GPRINT:used:LAST:\"% 6.0lf last\\n\" "
+ . "LINE1:licensed#0000FF:\"Licensed \" "
+ . "GPRINT:licensed:AVERAGE:\"% 6.0lf avg\" "
+ . "GPRINT:licensed:LAST:\"% 6.0lf last\\n\" "
+ . "";
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index a06b7a7..dee8d8e 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -866,3 +866,16 @@ def perfometer_check_mk_ibm_svc_host(row, check_command, perf_data):
return "%d active" % active, h
perfometers["check_mk-ibm_svc_host"] = perfometer_check_mk_ibm_svc_host
+
+def perfometer_check_mk_ibm_svc_license(row, check_command, perf_data):
+ licensed = float(perf_data[0][1])
+ used = float(perf_data[1][1])
+ if used == 0 and licensed == 0:
+ return "0 of 0 used", perfometer_linear(100, "white")
+ elif licensed == 0:
+ return "completely unlicensed", perfometer_linear(100, "silver")
+ else:
+ perc_used = 100 * used / licensed
+ return "%0.2f%% used" % perc_used, perfometer_linear(perc_used, "silver")
+
+perfometers["check_mk-ibm_svc_license"] = perfometer_check_mk_ibm_svc_license
Module: check_mk
Branch: master
Commit: 8f22e40118fa844d413e8d1d1352be70c356ee5c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f22e40118fa84…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Mar 25 11:57:22 2014 +0100
kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
---
.werks/598 | 8 +++++++
ChangeLog | 6 ++---
checkman/kentix_humidity | 13 ++++++++++
checkman/kentix_temp | 13 ++++++++++
checks/kentix_humidity | 59 ++++++++++++++++++++++++++++++++++++++++++++++
checks/kentix_temp | 59 ++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 155 insertions(+), 3 deletions(-)
diff --git a/.werks/598 b/.werks/598
new file mode 100644
index 0000000..73f8552
--- /dev/null
+++ b/.werks/598
@@ -0,0 +1,8 @@
+Title: kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1395744987
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index d7c3284..cc2d53a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -121,11 +121,11 @@
* 0595 dell_chassis_power, dell_chassis_powersupplies: new checks for Dell Poweredge Chassis Ppower consumption...
* 0596 dell_chassis_status, dell_chassis_temp, dell_chassis_kvm, dell_chassis_io, dell_chassis_fans: new checks to monitor the overall status of various sections of the Dell Poweredge Chassis via CMC
* 0597 dell_chassis_slots: new check to monitor the status of the blade slots of the Dell Poweredge Blade Servers
- * 0145 apc_symmetra: Changed naming of Batterie Temperature to System Temerature...
- NOTE: Please refer to the migration notes!
* 0759 check_notify_count: New active check to monitor the number of notifications sent to contacts...
* 0760 The windows agent contains meta information about version, manufacturer etc....
->>>>>>> 309bc055d22c0013242e9c3787049fbd6afb6ff1
+ * 0145 apc_symmetra: Changed naming of Batterie Temperature to System Temerature...
+ NOTE: Please refer to the migration notes!
+ * 0598 kentix_temp, kentix_humidity: new checks for Kentix MultiSensor-Rack
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/kentix_humidity b/checkman/kentix_humidity
new file mode 100644
index 0000000..8fa5874
--- /dev/null
+++ b/checkman/kentix_humidity
@@ -0,0 +1,13 @@
+title: Kentix MultiSensor-RACK: Humidity Sensor
+agents: snmp
+catalog: hw/server/kentix
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the humidity measured by the Kentix MultiSensor-RACK device.
+
+ No limits are set in the check, since limits are configured in the device
+ itself. These limits are taken as the lower and upper warning levels of the check.
+
+perfdata:
+ One variable: the humidity
diff --git a/checkman/kentix_temp b/checkman/kentix_temp
new file mode 100644
index 0000000..5cbb478
--- /dev/null
+++ b/checkman/kentix_temp
@@ -0,0 +1,13 @@
+title: Kentix MultiSensor-RACK: Temperature Sensor
+agents: snmp
+catalog: hw/server/kentix
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the temperature measured by the Kentix MultiSensor-RACK device.
+
+ No limits are set in the check, since limits are configured in the device
+ itself. These limits are taken as the lower and upper warning levels of the check.
+
+perfdata:
+ One variable: the temperature
diff --git a/checks/kentix_humidity b/checks/kentix_humidity
new file mode 100644
index 0000000..a47edec
--- /dev/null
+++ b/checks/kentix_humidity
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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-
+# ails. 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.
+
+def inventory_kentix_humidity(info):
+ if info:
+ return [ (None, None ) ]
+
+def check_kentix_humidity(_no_item, _no_params, info):
+ value, lower_warn, upper_warn, alarm, text = info[0]
+ temp = float(value)/10
+ perfdata = [ ("temp", temp, lower_warn+":"+upper_warn ) ]
+ upper_warn = float(upper_warn)
+ lower_warn = float(lower_warn)
+ infotext = "%.1f%% (min/max at %.1f%%/%.1f%%)" % (temp, lower_warn, upper_warn)
+ if temp >= upper_warn or temp <= lower_warn:
+ state = 1
+ infotext = "%s: %s" % (text, infotext)
+ else:
+ state = 0
+ return state, infotext, perfdata
+
+check_info["kentix_humidity"] = {
+ 'check_function': check_kentix_humidity,
+ 'inventory_function': inventory_kentix_humidity,
+ 'service_description': 'Humidity',
+ 'has_perfdata': True,
+ 'snmp_info': ('.1.3.6.1.4.1.37954.3.1.2',
+ ['1', # humidityValue
+ '2', # humidityMin
+ '3', # humidityMax
+ '4', # humidityAlarm, not used
+ '5', # humidityAlarmtext
+ ]
+ ),
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6"),
+}
diff --git a/checks/kentix_temp b/checks/kentix_temp
new file mode 100644
index 0000000..d3bd2df
--- /dev/null
+++ b/checks/kentix_temp
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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-
+# ails. 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.
+
+def inventory_kentix_temp(info):
+ if info:
+ return [ (None, None ) ]
+
+def check_kentix_temp(_no_item, _no_params, info):
+ value, lower_warn, upper_warn, alarm, text = info[0]
+ temp = float(value)/10
+ perfdata = [ ("temp", temp, lower_warn+":"+upper_warn ) ]
+ upper_warn = float(upper_warn)
+ lower_warn = float(lower_warn)
+ infotext = "%.1f C (min/max at %.1f/%.1f C)" % (temp, lower_warn, upper_warn)
+ if temp >= upper_warn or temp <= lower_warn:
+ state = 1
+ infotext = "%s: %s" % (text, infotext)
+ else:
+ state = 0
+ return state, infotext, perfdata
+
+check_info["kentix_temp"] = {
+ 'check_function': check_kentix_temp,
+ 'inventory_function': inventory_kentix_temp,
+ 'service_description': 'Temperature',
+ 'has_perfdata': True,
+ 'snmp_info': ('.1.3.6.1.4.1.37954.3.1.1',
+ ['1', # temperatureValue
+ '2', # temperatureMin
+ '3', # temperatureMax
+ '4', # temperatureAlarm, not used here
+ '5', # temperatureAlarmtext
+ ]
+ ),
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.332.11.6"),
+}