Module: check_mk
Branch: master
Commit: 2ab47b19c7db5c300286011a479ee5ee1896b9ba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ab47b19c7db5c…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed May 30 17:09:51 2012 +0200
Added vxvm_volstats check
---
.../veritas/{vxvm_volumes => vxvm_volstats} | 5 +-
checks/vxvm_volstats | 52 ++++++++++++++++++++
2 files changed, 54 insertions(+), 3 deletions(-)
diff --git a/agents/plugins/veritas/vxvm_volumes b/agents/plugins/veritas/vxvm_volstats
similarity index 87%
rename from agents/plugins/veritas/vxvm_volumes
rename to agents/plugins/veritas/vxvm_volstats
index 46c46fe..b33c060 100755
--- a/agents/plugins/veritas/vxvm_volumes
+++ b/agents/plugins/veritas/vxvm_volstats
@@ -2,15 +2,14 @@
if type vxdg > /dev/null; then
- echo '<<<vxvm_volumes>>>'
+ echo '<<<vxvm_volstats>>>'
# Get a list of the in-use disk groups.
# Deported or otherwise inactive needs no performance monitoring
DGS=$(vxdg list | grep enabled | awk '{print $1}')
if [ "X${DGS}" != "X" ]; then
for DG in $DGS ; do
- vxprint -g $DG -v -F"%dgname %name %state"
# Options: Kilobytes, per Volume
- vxstat -u k -v -g $DG | egrep -v '(OPERATIONS|TYP)' | sed
"s/^vol/$DG/"
+ vxstat -u k -v -g $DG | egrep -v '(OPERATIONS|TYP)' | sed "s/^vol
/$DG-/"
done
fi
fi
diff --git a/checks/vxvm_volstats b/checks/vxvm_volstats
new file mode 100644
index 0000000..f32a68f
--- /dev/null
+++ b/checks/vxvm_volstats
@@ -0,0 +1,52 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 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.
+
+# <<<aix_perflib_hbastat>>>
+# Convert to generic format needed for diskstat.include. Upper example
+# would look like:
+# [ ( 'sissas0', 204494394, 156524126 ), ('fcs3', 1760, 0), ... ]
+
+def convert_vxvm_volstats(info):
+ return [ ( l[0], int(l[1])*2, int(l[2])*2) for l in info[1:] ]
+
+def inventory_vxvm_volstats(info):
+ converted = convert_vxvm_volstats(info)
+ return [ (line[0], "diskstat_default_levels") for line in converted ]
+
+def check_vxvm_volstats(item, params, info):
+ converted = convert_vxvm_volstats(info)
+ return check_diskstat_generic(item, params, int(info[0][0]), converted)
+
+
+check_info['vxvm_volstats'] = {
+ "check_function" : check_vxvm_volstats,
+ "inventory_function" : inventory_vxvm_volstats,
+ "service_description" : "VXVM Stats %s",
+ "has_perfdata" : True,
+ "group" : "disk_io",
+ "includes" : [ "diskstat.include" ],
+}
+