New check for the Archive Dir of Libelle Business Shadow
Message-ID: <537f9943.kNFqqsHZBNqkp075%bs(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: 9da5c66efa84642b8f3c96e0ba452739dda809f4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9da5c66efa8464…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri May 23 20:47:58 2014 +0200
libelle_business_shadow.archive_dir: New check for the Archive Dir of Libelle Business
Shadow
checks the total / used capacity
---
.werks/960 | 8 +++
ChangeLog | 1 +
checkman/libelle_business_shadow.archive_dir | 35 +++++++++++++
checks/libelle_business_shadow | 53 ++++++++++++++++++++
...heck_mk-libelle_business_shadow.archive_dir.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
6 files changed, 99 insertions(+)
diff --git a/.werks/960 b/.werks/960
new file mode 100644
index 0000000..5d98021
--- /dev/null
+++ b/.werks/960
@@ -0,0 +1,8 @@
+Title: libelle_business_shadow.archive_dir: New check for the Archive Dir of Libelle
Business Shadow
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1400870806
+Class: feature
+
+checks the total / used capacity
diff --git a/ChangeLog b/ChangeLog
index 455137b..6a84d1b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -57,6 +57,7 @@
* 0920 blade_bays: now also detects if blade server is switched off
* 0977 check_traceroute: new active check for checking presence and absence of
routes...
* 0959 libelle_business_shadow.info, libelle_business_shadow.process,
libelle_business_shadow.status: New Checks for Libelle Business Shadow
+ * 0960 libelle_business_shadow.archive_dir: New check for the Archive Dir of Libelle
Business Shadow...
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed
detection
diff --git a/checkman/libelle_business_shadow.archive_dir
b/checkman/libelle_business_shadow.archive_dir
new file mode 100644
index 0000000..7764840
--- /dev/null
+++ b/checkman/libelle_business_shadow.archive_dir
@@ -0,0 +1,35 @@
+title: Libelle Business Shadow: Total / Used Space in Archive Dir
+agents: linux, aix, solaris, hpux
+catalog: app/libelle
+license: GPL
+distribution: check_mk
+description:
+ Checks the total / used capacity in the Archive Dir of Libelle Business
+ Shadow.
+
+ Returns {WARN} or {CRIT} if usage is above given levels.
+
+ It uses the check logic of the {df} check, so for configuration
+ parameters and examples please refer to the man page of {df}.
+
+item:
+ "Archive Dir" for now is the only item.
+
+perfdata:
+ Three values: The first value is the used space in the Archive Dir in MB.
+ Also the minimum (0 MB), maximum (total size) 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}.
+
+inventory:
+ Finds exactly one check on every node.
+
+[parameters]
+parameters (dict): See man page of {df}.
+
+[configuration]
+filesystem_default_levels: And other, see man page of {df}.
diff --git a/checks/libelle_business_shadow b/checks/libelle_business_shadow
index ebc3a8e..dba0a9e 100644
--- a/checks/libelle_business_shadow
+++ b/checks/libelle_business_shadow
@@ -230,6 +230,21 @@
#.
+def check_libelle_business_shadow_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
+ else:
+ size = int(float(size))
+ return size
+
# parses agent output into a dict
def check_libelle_business_shadow_parse(info):
parsed = {}
@@ -246,6 +261,10 @@ def check_libelle_business_shadow_parse(info):
line[0].startswith("trdarchiver ") ):
parsed["process"] = re.sub(" +$", "", line[0])
parsed["process_status"] = re.sub("^[0-9]+ +",
"", line[3])
+ elif len(line) > 1 and line[0].startswith("Archive-Dir total "):
+ parsed["arch_total_mb"] =
check_libelle_business_shadow_to_mb(re.sub(" ", "", line[1]))
+ elif len(line) > 1 and line[0].startswith("Archive-Dir free "):
+ parsed["arch_free_mb"] =
check_libelle_business_shadow_to_mb(re.sub(" ", "", line[1]))
return parsed
# .--info----------------------------------------------------------------.
@@ -355,3 +374,37 @@ check_info["libelle_business_shadow.process"] = {
}
#.
+# .--archive dir---------------------------------------------------------.
+# | _ _ _ _ |
+# | __ _ _ __ ___| |__ (_)_ _____ __| (_)_ __ |
+# | / _` | '__/ __| '_ \| \ \ / / _ \ / _` | | '__| |
+# | | (_| | | | (__| | | | |\ V / __/ | (_| | | | |
+# | \__,_|_| \___|_| |_|_| \_/ \___| \__,_|_|_| |
+# | |
+# '----------------------------------------------------------------------'
+
+def inventory_libelle_business_shadow_archive_dir(info):
+ parsed = check_libelle_business_shadow_parse(info)
+ if "arch_total_mb" in parsed.keys() and "arch_free_mb" in
parsed.keys():
+ return [ ("Archive Dir", {}) ]
+ else:
+ return []
+
+def check_libelle_business_shadow_archive_dir(item, params, info):
+ parsed = check_libelle_business_shadow_parse(info)
+ fslist = []
+ fslist.append((item, parsed["arch_total_mb"],
parsed["arch_free_mb"]))
+
+ return df_check_filesystem_list(item, params, fslist)
+
+
+check_info["libelle_business_shadow.archive_dir"] = {
+ "check_function" : check_libelle_business_shadow_archive_dir,
+ "inventory_function" : inventory_libelle_business_shadow_archive_dir,
+ "service_description" : "Libelle Business Shadow %s",
+ "has_perfdata" : True,
+ "group" : "filesystem",
+ "includes" : [ "df.include" ],
+}
+
+#.
diff --git a/pnp-templates/check_mk-libelle_business_shadow.archive_dir.php
b/pnp-templates/check_mk-libelle_business_shadow.archive_dir.php
new file mode 120000
index 0000000..aac1010
--- /dev/null
+++ b/pnp-templates/check_mk-libelle_business_shadow.archive_dir.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 eb758ae..eb8885a 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -118,6 +118,7 @@ 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
perfometers["check_mk-fast_lta_silent_cubes.capacity"] =
perfometer_check_mk_df
+perfometers["check_mk-libelle_business_shadow.archive_dir"] =
perfometer_check_mk_df
def perfometer_esx_vsphere_datastores(row, check_command, perf_data):
used_mb = perf_data[0][1]