Module: check_mk
Branch: master
Commit: bacbd3bb5853029de68e97d0888900b24535472e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bacbd3bb585302…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Apr 17 12:01:38 2013 +0200
g_hostname is now also available in argument_functions of checks
---
modules/check_mk.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index dceed76..cde68c5 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -1924,6 +1924,10 @@ define service {
if actchecks:
outfile.write("\n\n# Active checks\n")
for acttype, act_info, params in actchecks:
+ # Make hostname available as global variable in argument functions
+ global g_hostname
+ g_hostname = hostname
+
has_perfdata = act_info.get('has_perfdata', False)
description = act_info["service_description"](params)
# compute argument, and quote ! and \ for Nagios