Closed alex-eoi closed 10 years ago
Adding this small patch fixes the problem for me:
diff --git a/pynag/Model/__init__.py b/pynag/Model/__init__.py
index f7576a7..1be7bc5 100644
--- a/pynag/Model/__init__.py
+++ b/pynag/Model/__init__.py
@@ -1043,6 +1043,9 @@ class ObjectDefinition(object):
c[arg_number] = new_value
self.check_command = '!'.join(c)
+ elif macroname.startswith('$_HOST'):
+ macroname = "_" + macroname[6:-1]
+ self[macroname] = new_value
elif macroname.startswith('$_SERVICE'):
macroname = "_" + macroname[9:-1]
self[macroname] = new_value
Thanks a lot Alexander,
If you want your name in the contributor log you can edit the file directly here: https://github.com/pynag/pynag/edit/master/pynag/Model/__init__.py and then send us a pull request.
Hi,
when i try to set custom host variables using Model.set_macro(), I get the error: "No support for macro ...". Seems like there is no handling for host variables yet.