Module: check_mk
Branch: master
Commit: 66e6473480441a5e7b7ad6808c5f709e775bfc4c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=66e6473480441a…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jun 26 15:54:15 2017 +0200
4876 FIX mounts: Fixed wrong handling of NFS mounts on Linux which are detected as stale
Such mounts are marked with '\040(deleted)' und therefore discovered
as new services while the related services report
{{UNKNOWN - filesystem not mounted}}.
This has been fixed. The service now reports
{{WARN - Mount point detected as stale}}.
Please see
https://utcc.utoronto.ca/~cks/space/blog/linux/NFSStaleUnmounting
for more information.
Change-Id: I03dd6febbaaa7495522319f36acae8e7cb498123
---
.werks/4876 | 20 ++++++++++++++++++++
checks/mounts | 29 ++++++++++++++++++-----------
2 files changed, 38 insertions(+), 11 deletions(-)
diff --git a/.werks/4876 b/.werks/4876
new file mode 100644
index 0000000..44692ee
--- /dev/null
+++ b/.werks/4876
@@ -0,0 +1,20 @@
+Title: mounts: Fixed wrong handling of NFS mounts on Linux which are detected as stale
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1498484953
+
+Such mounts are marked with '\040(deleted)' und therefore discovered
+as new services while the related services report
+{{UNKNOWN - filesystem not mounted}}.
+
+This has been fixed. The service now reports
+{{WARN - Mount point detected as stale}}.
+
+Please see
+https://utcc.utoronto.ca/~cks/space/blog/linux/NFSStaleUnmounting
+for more information.
diff --git a/checks/mounts b/checks/mounts
index ddac74d..1d7fba4 100644
--- a/checks/mounts
+++ b/checks/mounts
@@ -24,6 +24,12 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+# See https://utcc.utoronto.ca/~cks/space/blog/linux/NFSStaleUnmounting
+# Output changes from
+# knvmsapprd:/transreorg/sap/trans /transreorg/sap/trans nfs4 rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.24.98.63,local_lock=none,addr=172.24.98.57 0 0
+# to
+# knvmsapprd:/transreorg/sap/trans /transreorg/sap/trans\040(deleted) nfs4 rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=172.24.98.63,local_lock=none,addr=172.24.98.57 0 0
+
def inventory_mounts(info):
inventory = []
@@ -33,11 +39,11 @@ def inventory_mounts(info):
devices.append(dev)
opts = options.split(",")
opts.sort()
- inventory.append( (mp, opts) )
+ inventory.append( (mp.replace("\\040(deleted)", ""), opts) )
return inventory
-def check_mounts(item, targetopts, info):
+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=" ]:
@@ -46,7 +52,10 @@ def check_mounts(item, targetopts, info):
return False
for dev, mp, fstype, options, dump, fsck in info:
- if item == mp:
+ if item == mp.replace("\\040(deleted)", ""):
+ if mp.endswith("\\040(deleted)"):
+ return 1, "Mount point detected as stale"
+
opts = options.split(",")
# Now compute the exact difference.
@@ -61,24 +70,22 @@ def check_mounts(item, targetopts, info):
missing.append(o)
if not missing and not exceeding:
- return (0, "mount options exactly as expected")
+ return 0, "Mount options exactly as expected"
infos = []
if missing:
- infos.append("missing: %s" % ",".join(missing))
+ infos.append("Missing: %s" % ",".join(missing))
if exceeding:
- infos.append("exceeding: %s" % ",".join(exceeding))
+ infos.append("Exceeding: %s" % ",".join(exceeding))
infotext = ", ".join(infos)
if "ro" in exceeding:
- return (2, "filesystem has switched to read-only "
- "and is probably corrupted(!!), " + infotext)
+ return 2, "Filesystem has switched to read-only and is probably corrupted(!!), %s" % infotext
# Just warn in other cases
- return (1, infotext)
-
- return (3, "filesystem not mounted")
+ return 1, infotext
+ return 3, "Filesystem not mounted"
check_info["mounts"] = {
Module: check_mk
Branch: master
Commit: 7943989ce12bfcf85736ede9cb1fb22a1d13d18e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7943989ce12bfc…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Jun 26 15:28:42 2017 +0200
4825 FIX mkbackup: Fixed crash if size of backup is not reported because of a failure
Previously the check crashed if the size has not been reported. This can
happen if the backup fails directly from the beginning. This bug has always
been in this plugin until now.
Change-Id: I8e425d12aa99aa0e7edff9b299f15c7c07a033ff
---
.werks/4825 | 12 ++++++++++++
checks/mkbackup | 5 +++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/4825 b/.werks/4825
new file mode 100644
index 0000000..1166ad6
--- /dev/null
+++ b/.werks/4825
@@ -0,0 +1,12 @@
+Title: mkbackup: Fixed crash if size of backup is not reported because of a failure
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1498483587
+Class: fix
+
+Previously the check crashed if the size has not been reported. This can
+happen if the backup fails directly from the beginning. This bug has always
+been in this plugin until now.
diff --git a/checks/mkbackup b/checks/mkbackup
index 8eed86a..2ff4449 100644
--- a/checks/mkbackup
+++ b/checks/mkbackup
@@ -106,8 +106,9 @@ def check_mkbackup(job_state):
[ ("backup_duration", duration),
("backup_avgspeed", job_state["bytes_per_second"]) ]
- yield 0, "Size: %s" % get_bytes_human_readable(job_state["size"]), \
- [ ("backup_size", job_state["size"]) ]
+ if "size" in job_state:
+ yield 0, "Size: %s" % get_bytes_human_readable(job_state["size"]), \
+ [ ("backup_size", job_state["size"]) ]
next_run = job_state["next_schedule"]
if next_run == "disabled":
Module: check_mk
Branch: master
Commit: 62641d8c4f99c95a4a22446e6749412e00367b2c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=62641d8c4f99c9…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Jun 26 15:10:05 2017 +0200
transferred werk 4824 into master
Change-Id: I3ea5f558d36d41e59ce3574b437a480f8f4dc55d
---
.werks/4824 | 11 +++++++++++
checks/f5_bigip_conns | 8 +++++++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/.werks/4824 b/.werks/4824
new file mode 100644
index 0000000..b09dd4d
--- /dev/null
+++ b/.werks/4824
@@ -0,0 +1,11 @@
+Title: f5bigip_conns: Fixed crash if Parameters are at 'No Levels'
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.5.0i1
+Date: 1498479772
+Class: fix
+
+2016-11-07 the fix 3939 readded performance data into the output. Since
+then the check would crash if the Thresholds for the service has been set to
+"No Levels". This has been fixed now.
diff --git a/checks/f5_bigip_conns b/checks/f5_bigip_conns
index 961993a..5febf54 100644
--- a/checks/f5_bigip_conns
+++ b/checks/f5_bigip_conns
@@ -88,7 +88,13 @@ def check_f5_bigip_conns(item, params, info):
if val == None:
infotext += " not configured"
else:
- warn, crit = params_values[:2]
+ # The check_parameters are a bit tricky: If thresholds are disabled,
+ # the value is None; otherwise it's a Tuple.
+ # TODO: Refactor the check parameter f5_connections and this check plugin!
+ if params_values == None:
+ warn, crit = (None, None)
+ else:
+ warn, crit = params_values[:2]
perfdata.append((perfkey, val, warn, crit))
state, extrainfo, extraperf = check_levels(val, dsname, params_values)