diff --git a/main.py b/main.py index 02285e1..33609db 100644 --- a/main.py +++ b/main.py @@ -38,4 +38,15 @@ for obj in parser.parseFile('objects.cache'): print(' ', '') print() -pprint.pp(config) \ No newline at end of file +#pprint.pp(config) +#from icinga2confgen.Servers.Server import Server +#from icinga2confgen.ConfigBuilder import ConfigBuilder +#from string import Template + +for hostname,obj in config["host"].items(): + template = r''' +object Host "{hostname}" {{ + address = "{address}" + check_command = "hostalive" +}}'''.format(hostname=hostname,address=obj["address"]) + print(template) \ No newline at end of file