Module: check_mk
Branch: master
Commit: ea7590038af1efe62b6f4cff06f367339b56b7cc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ea7590038af1ef…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed May 27 13:53:41 2015 +0200
#1251 lvm_pvs, lvm_vgs: New Checks for LVM volume groups and physical volumes
The checks need the agent plugin {lvm} in order to work.
---
.werks/1251 | 10 ++++++++++
ChangeLog | 1 +
agents/plugins/lvm | 6 ++++++
checkman/lvm_pvs | 15 +++++++++++++++
checkman/lvm_vgs | 15 +++++++++++++++
checks/lvm_pvs | 39 +++++++++++++++++++++++++++++++++++++++
checks/lvm_vgs | 38 ++++++++++++++++++++++++++++++++++++++
7 files changed, 124 insertions(+)
diff --git a/.werks/1251 b/.werks/1251
new file mode 100644
index 0000000..52c96ea
--- /dev/null
+++ b/.werks/1251
@@ -0,0 +1,10 @@
+Title: lvm_pvs, lvm_vgs: New Checks for LVM volume groups and physical volumes
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1432727463
+Class: feature
+
+The checks need the agent plugin {lvm} in order to work.
+
diff --git a/ChangeLog b/ChangeLog
index 767614f..d31d837 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -195,6 +195,7 @@
* 1249 alcatel_cpu, alcatel_temp, alcatel_fans: New checks for Alcatel switches based
on IND1 MIB
* 1250 alcatel_timetra_cpu: New CPU Check for Alcatel Switches supporting the TIMETRA
MIB
* 2215 pfsense_status, pfsense_if: Two new checks to monitor the interfaces and
status of pfSense firewalls...
+ * 1251 lvm_pvs, lvm_vgs: New Checks for LVM volume groups and physical volumes...
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/agents/plugins/lvm b/agents/plugins/lvm
new file mode 100755
index 0000000..26dc110
--- /dev/null
+++ b/agents/plugins/lvm
@@ -0,0 +1,6 @@
+#!/bin/bash
+echo "<<<lvm_vgs>>>"
+vgs --units b --nosuffix --noheadings --separator ' '
+
+echo "<<<lvm_pvs>>>"
+pvs --units b --nosuffix --noheadings --separator ' '
diff --git a/checkman/lvm_pvs b/checkman/lvm_pvs
new file mode 100644
index 0000000..1812655
--- /dev/null
+++ b/checkman/lvm_pvs
@@ -0,0 +1,15 @@
+title: LVM: Physical volume
+agents: linux
+catalog: os/storage
+license: GPL
+distribution: check_mk
+description:
+ This Check monitors the size and the usage of physical volumes in LVM.
+ It useses same configuration like normal filesystems and supports almost the same
+ options (except inodes etc.)
+
+ You need to install the agent plugin {lvm}.
+
+
+inventory:
+ One item is generated per physical volume
diff --git a/checkman/lvm_vgs b/checkman/lvm_vgs
new file mode 100644
index 0000000..4a5b450
--- /dev/null
+++ b/checkman/lvm_vgs
@@ -0,0 +1,15 @@
+title: LVM: Volume groups
+agents: linux
+catalog: os/storage
+license: GPL
+distribution: check_mk
+description:
+ This Check monitors the size and the usage of LVM volume groups.
+ It useses same configuration like normal filesystems and supports almost the same
+ options (except inodes etc.)
+
+ You need to install the agent plugin {lvm}.
+
+
+inventory:
+ One item is generated per volume group
diff --git a/checks/lvm_pvs b/checks/lvm_pvs
new file mode 100644
index 0000000..6962c8d
--- /dev/null
+++ b/checks/lvm_pvs
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+
+# (c) 2013 Heinlein Support GmbH
+# Robert Sander <r.sander(a)heinlein-support.de>
+
+# This 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. This file 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.
+
+lvm_pvs_default_values = ( 90, 95 )
+
+def inventory_lvm_pvs(info):
+ for line in info:
+ yield line[0], {}
+
+def check_lvm_pvs(item, params, info):
+ pvlist = []
+ for pv, vg, fmt, attr, size, free in info:
+ size_mb = int(size) / 1048576
+ avail_mb = int(free) / 1048576
+ pvlist.append((pv, size_mb, avail_mb, 0))
+ return df_check_filesystem_list(item, params, pvlist)
+
+check_info['lvm_pvs'] = {
+ "check_function" : check_lvm_pvs,
+ "inventory_function" : inventory_lvm_pvs,
+ "service_description" : "LVM PVs %s",
+ "has_perfdata" : True,
+ "group" : "filesystem",
+ "default_levels_variable" : "filesystem_default_levels",
+}
diff --git a/checks/lvm_vgs b/checks/lvm_vgs
new file mode 100644
index 0000000..b3b5f10
--- /dev/null
+++ b/checks/lvm_vgs
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+
+# (c) 2013 Heinlein Support GmbH
+# Robert Sander <r.sander(a)heinlein-support.de>
+
+# This 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. This file 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_lvm_vgs(info):
+ for line in info:
+ yield line[0], {}
+
+def check_lvm_vgs(item, params, info):
+ vglist = []
+ for vg, pvs, lvs, sns, attr, size, free in info:
+ size_mb = int(size) / 1048576
+ avail_mb = int(free) / 1048576
+ vglist.append((vg, size_mb, avail_mb, 0))
+ return df_check_filesystem_list(item, params, vglist)
+
+
+check_info['lvm_vgs'] = {
+ "check_function" : check_lvm_vgs,
+ "inventory_function" : inventory_lvm_vgs,
+ "service_description" : "LVM VG %s",
+ "has_perfdata" : True,
+ "group" : "filesystem",
+ "default_levels_variable" : "filesystem_default_levels",
+}