From d3b281cdc6f3ab2dd4a47a176b054e9d843117b1 Mon Sep 17 00:00:00 2001 From: Conor Branagan Date: Thu, 25 Oct 2012 19:10:12 -0400 Subject: [PATCH] Allow custom pythonpaths in checks.d, fixes #227 --- config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config.py b/config.py index 43320201bb..7dc59877dd 100644 --- a/config.py +++ b/config.py @@ -502,6 +502,13 @@ def load_check_directory(agentConfig): check_class = check_class(check_name, init_config=init_config, agentConfig=agentConfig) + # Add custom pythonpath(s) if available + if 'pythonpath' in check_config: + pythonpath = check_config['pythonpath'] + if not isinstance(pythonpath, list): + pythonpath = [pythonpath] + sys.path.extend(pythonpath) + log.debug('Loaded check.d/%s.py' % check_name) checks.append({ 'name': check_name,