Module: check_mk
Branch: master
Commit: 36f3301e8bc8b99d42d477b1a765a315d32e866e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=36f3301e8bc8b9…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Thu Mar 19 10:00:47 2015 +0100
#1233 FIX Fixed fileinfo check for solaris in case of missing files
---
.werks/1233 | 10 ++++++++++
ChangeLog | 1 +
checks/fileinfo | 5 ++++-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/1233 b/.werks/1233
new file mode 100644
index 0000000..9847fac
--- /dev/null
+++ b/.werks/1233
@@ -0,0 +1,10 @@
+Title: Fixed fileinfo check for solaris in case of missing files
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1426755598
+
+
diff --git a/ChangeLog b/ChangeLog
index 516af60..906ad9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -264,6 +264,7 @@
* 2144 FIX: Fixed exception in inventory GUI when trying to render dates of
inventorized exe files...
* 2058 FIX: ucs_bladecenter_fans.temp, ucs_bladecenter_psu.chassis_temp: fixed broken
temperature checks (nagios only)...
* 2059 FIX: ucs_bladecenter_if: fixed exception when fibrechannel interfaces were not
configured...
+ * 1233 FIX: Fixed fileinfo check for solaris in case of missing files
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/fileinfo b/checks/fileinfo
index b625db3..b3594ac 100644
--- a/checks/fileinfo
+++ b/checks/fileinfo
@@ -171,7 +171,10 @@ def check_fileinfo_groups(item, params, info):
if inclusion != inclusion_tmp:
inclusion = inclusion_tmp
date_inclusion = inclusion_tmp
- if fnmatch.fnmatch(line[0], inclusion) and str(line[1]) != 'missing'
\
+ # endswith("No such file...") is needed to
+ # support the solaris perl based version of fileinfo
+ if not line[0].endswith("No such file or directory") \
+ and fnmatch.fnmatch(line[0], inclusion) and str(line[1]) !=
'missing' \
and not fnmatch.fnmatch(line[0], exclusion):
size = int(line[1])
size_all += size