Module: check_mk
Branch: master
Commit: f5f41946d9be03f50e832dd3dcb6891c05bb3334
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f5f41946d9be03…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sat Oct 31 11:48:37 2015 +0100
#2672 FIX mounts: ignore options that are allowed to change on btrfs filesystems
This prevents the service from complaining about <tt>subvolid</tt> and
<tt>subvol</tt>.
---
.werks/2672 | 10 ++++++++++
ChangeLog | 1 +
checks/mounts | 15 +++++++++++----
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/.werks/2672 b/.werks/2672
new file mode 100644
index 0000000..c531409
--- /dev/null
+++ b/.werks/2672
@@ -0,0 +1,10 @@
+Title: mounts: ignore options that are allowed to change on btrfs filesystems
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1446288478
+
+This prevents the service from complaining about <tt>subvolid</tt> and
<tt>subvol</tt>.
diff --git a/ChangeLog b/ChangeLog
index 82b7f8f..9473b2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
* 2706 FIX: winperf_if: fixed rare crashes of windows_if.ps1 plugin...
* 1297 FIX: emcvnx_hba: Prevent old emc versions from inventory...
* 2698 FIX: ups_capacity: fixed missing battery time and fuel information
+ * 2672 FIX: mounts: ignore options that are allowed to change on btrfs
filesystems...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/mounts b/checks/mounts
index 40d0ead..3dd5f65 100644
--- a/checks/mounts
+++ b/checks/mounts
@@ -24,6 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+
def inventory_mounts(info):
inventory = []
devices = []
@@ -36,6 +37,14 @@ def inventory_mounts(info):
return inventory
def check_mounts(item, targetopts, info):
+
+ # Ignore options that are allowed to change
+ def should_ignore_option(option):
+ for ignored_option in [ "commit=", "localalloc=",
"subvol=", "subvolid=" ]:
+ if option.startswith(ignored_option):
+ return True
+ return False
+
for dev, mp, fstype, options, dump, fsck in info:
if item == mp:
opts = options.split(",")
@@ -43,14 +52,12 @@ def check_mounts(item, targetopts, info):
exceeding = []
for o in opts:
- if o not in targetopts and not o.startswith("commit=") \
- and not o.startswith("localalloc="):
+ if o not in targetopts and not should_ignore_option(o):
exceeding.append(o)
missing = []
for o in targetopts:
- if o not in opts and not o.startswith("commit=") \
- and not o.startswith("localalloc="):
+ if o not in opts and not should_ignore_option(o):
missing.append(o)
if not missing and not exceeding: