summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fcf0c6b)
raw | patch | inline | side by side (parent: fcf0c6b)
author | Sven Velt <sven@velt.de> | |
Wed, 22 Dec 2010 14:32:09 +0000 (15:32 +0100) | ||
committer | Sven Velt <sven@velt.de> | |
Wed, 22 Dec 2010 14:32:09 +0000 (15:32 +0100) |
Signed-off-by: Sven Velt <sven@velt.de>
nagixsc/__init__.py | patch | blob | history |
diff --git a/nagixsc/__init__.py b/nagixsc/__init__.py
index 85f39092a13ab1e105e002bd172e1293b15ebc41..19ef4166cd963bfd5381b8a512144f299273a289 100644 (file)
--- a/nagixsc/__init__.py
+++ b/nagixsc/__init__.py
check['returncode'] = 127
return check
+ check['commandline'] = cmdline
+ check['command'] = cmdarray[0].split(os.path.sep)[-1]
+
if timeout:
signal.signal(signal.SIGALRM, exec_timeout_handler)
signal.alarm(timeout)
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
timeout_returncode = 2
+ # Read "add_pnp4nagios_template_hint" from "[nagixsc]", default "False"
+ try:
+ add_pnp4nagios_template_hint = config.getboolean('nagixsc','add_pnp4nagios_template_hint')
+ except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
+ add_pnp4nagios_template_hint = False
+
# Sections are Hosts (not 'nagixsc'), options in sections are Services
hosts = config.sections()
if 'nagixsc' in hosts:
if '_host_check' in services and not opt_service:
cmdline = config.get(host, '_host_check')
check = exec_check(host_name, None, cmdline, timeout, timeout_returncode)
+ if add_pnp4nagios_template_hint and '|' in check['output']:
+ check['output'] += ' [%s]' % check['command']
checks.append(check)
cmdline = config.get(host, service)
check = exec_check(host_name, service, cmdline, timeout, timeout_returncode)
+ if add_pnp4nagios_template_hint and '|' in check['output']:
+ check['output'] += ' [%s]' % check['command']
checks.append(check)
return checks