Module: check_mk
Branch: master
Commit: 25dfcaebb1f3e5e45d01f60637fee3e92972adcc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=25dfcaebb1f3e5…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri May 27 13:23:41 2016 +0200
added rule for nfsmounts
---
checks/network_fs.include | 6 ++++--
web/plugins/wato/check_parameters.py | 17 +++++++++++++++--
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/checks/network_fs.include b/checks/network_fs.include
index 0dde3c1..28858b6 100644
--- a/checks/network_fs.include
+++ b/checks/network_fs.include
@@ -34,7 +34,7 @@ def inventory_network_fs_mounts(info):
return [ (" ".join(line[:-5]), None) for line in info ]
-def check_network_fs_mounts(item, _no_params, info):
+def check_network_fs_mounts(item, params, info):
for line in info:
mountpoint = " ".join(line[:-5])
if mountpoint == item:
@@ -57,7 +57,9 @@ def check_network_fs_mounts(item, _no_params, info):
free_bytes = free_blocks * blocksize
used_bytes = size_bytes - free_bytes
used_perc = 100.0 * used_bytes / size_bytes
- perfdata = [("fs_size", size_bytes), ("fs_used",
used_bytes)]
+ perfdata = None
+ if params.get("has_perfdata"):
+ perfdata = [("fs_size", size_bytes), ("fs_used",
used_bytes)]
if line[-5] == 'ok':
if size_bytes == 0:
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 61aac04..118c82b 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -8424,11 +8424,24 @@ register_check_parameters(
subgroup_storage,
"network_fs",
_("Network filesystem - overall status (e.g. NFS)"),
- None,
+ Dictionary(
+ elements = [
+ ("has_perfdata",
+ DropdownChoice(
+ title = _("Performance data settings"),
+ choices = [
+ (True, _("Enable performance data")),
+ (False, _("Disable performance data")),
+ ],
+ default_value = False
+ ),
+ ),
+ ],
+ ),
TextAscii(
title = _("Name of the mount point"),
help = _("For NFS enter the name of the mount point.")),
- "first"
+ "dict"
)
register_check_parameters(