Module: check_mk
Branch: master
Commit: 9c7d3c11e51e4a568e3b003c2e26982e108b0bbd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9c7d3c11e51e4a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Apr 19 16:45:24 2011 +0200
Do not longer exit on syntax error in autochecks
Errors are silently ignored. -v will output them. --debug will
exit on errors in autochecks files.
---
modules/check_mk.py | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index ab9c142..72c552d 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3925,11 +3925,15 @@ def read_all_autochecks():
try:
autochecks += eval(file(f).read())
except SyntaxError,e:
- sys.stderr.write("Syntax error in file %s: %s\n" % (f, e))
- sys.exit(3)
+ if opt_verbose:
+ sys.stderr.write("Syntax error in file %s: %s\n" % (f, e))
+ if opt_debug:
+ sys.exit(3)
except Exception, e:
- sys.stderr.write("Error in file %s:\n%s\n" % (f, e))
- sys.exit(3)
+ if opt_verbose:
+ sys.stderr.write("Error in file %s:\n%s\n" % (f, e))
+ if opt_debug:
+ sys.exit(3)
# Exchange inventorized check parameters with those configured by
# the user. Also merge with default levels for modern dictionary based checks.