Module: check_mk
Branch: master
Commit: aad3eedf1a06b6514ce97c8ea07353ee937cd105
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aad3eedf1a06b6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Jan 8 14:33:45 2012 +0100
Better error message on missing traceroute
---
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 d90ea9e..b331c5b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3756,11 +3756,11 @@ def do_cleanup_autochecks():
sys.stdout.write("Deleting %s\n" % f)
os.remove(f)
-def check_bin_in_path(prog):
+def find_bin_in_path(prog):
for path in os.environ['PATH'].split(os.pathsep):
f = path + '/' + prog
if os.path.exists(f) and os.access(f, os.X_OK):
- return True
+ return f
def do_scan_parents(hosts):
global max_num_processes
@@ -3778,8 +3778,12 @@ def do_scan_parents(hosts):
outfilename = check_mk_configdir + "/parents.mk"
- if not check_bin_in_path('traceroute'):
- raise MKGeneralException('The traceroute command can not be found in
PATH?')
+ traceroute_prog = find_bin_in_path('traceroute')
+ if not traceroute_prog:
+ raise MKGeneralException(
+ 'The program "traceroute" was not found.\n'
+ 'The parent scan needs this program.\n'
+ 'Please install it and try again.')
if os.path.exists(outfilename):
first_line = file(outfilename, "r").readline()