Module: check_mk
Branch: master
Commit: fa9c2a2582fef348f175e5606eeaf1f87f5dc249
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fa9c2a2582fef3…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed May 30 17:10:23 2012 +0200
Added lnx_vmstat check
---
checks/lnx_vmstat | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/checks/lnx_vmstat b/checks/lnx_vmstat
new file mode 100644
index 0000000..2c5a7df
--- /dev/null
+++ b/checks/lnx_vmstat
@@ -0,0 +1,49 @@
+#!/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.
+
+#<<<lnx_lvmstat>>>
+#1338389956.26
+#252 2 vgubuntu-root 66109 0 1861626 771692 310410 0 5240232 21519872 0 546740 22291608
+#252 3 vgubuntu-home 37997 0 593186 339120 130175 0 2554992 5621456 0 495464 5960576
+#252 1 vgubuntu-swap 214 0 1712 1932 21 0 168 64 0 1204 1996
+
+def linux_lnx_lvmstat_convert(info):
+ return [ ( l[2], int(l[5]), int(l[9])) for l in info[1:] ]
+
+def inventory_lnx_lvmstat(info):
+ return inventory_diskstat_generic(linux_lnx_lvmstat_convert(info))
+
+def check_lnx_lvmstat(item, params, info):
+ return check_diskstat_generic(item, params, int(info[0][0].split('.')[0]),
linux_lnx_lvmstat_convert(info))
+
+check_info['lnx_lvmstat'] = {
+ "check_function" : check_lnx_lvmstat,
+ "inventory_function" : inventory_lnx_lvmstat,
+ "service_description" : "LVM IO %s",
+ "has_perfdata" : True,
+ "group" : "disk_io",
+ "includes" : [ "diskstat.include" ],
+}