from parse_function to inventory_function
Message-ID: <5a1ea3c1.wVE+mKlDzBDr9m3s%kb(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Module: check_mk
Branch: master
Commit: af49400db96e583d26be9c990c1e9915c04d1a01
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=af49400db96e58…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Wed Nov 29 13:02:33 2017 +0100
df: Move deselecting of filesystems by type (such as tmpfs) from parse_function to inventory_function
Change-Id: I810ad81697d623b709f7f1f738c7f31fd50ff350
---
checks/df | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/checks/df b/checks/df
index fca4bbb..d780799 100644
--- a/checks/df
+++ b/checks/df
@@ -127,8 +127,6 @@ def parse_df(info):
else:
mountpoint = " ".join(line[6:]).replace('\\', '/') # Windows \ is replaced with /
- if fs_type in inventory_df_exclude_fs:
- continue # ignore this filesystem type
if line[2] == '-' or int(line[2]) == 0:
continue # exclude filesystems without size
@@ -205,9 +203,12 @@ def inventory_df(parsed):
mountpoint = line[0]
if mountpoint in inventory_df_exclude_mountpoints:
continue # exclude this mount point (/tmp, /proc, whatever user wants)
+ if volume_info[mountpoint]["fs_type"] in inventory_df_exclude_fs:
+ continue # ignore this filesystem type
mplist.append(mountpoint)
+
if include_volume_name:
inventory = []
for entry in df_inventory(mplist):