Basic template

This commit is contained in:
2022-03-10 18:37:06 +01:00
parent 633fadb49c
commit d27f74f7d1

13
main.py
View File

@@ -38,4 +38,15 @@ for obj in parser.parseFile('objects.cache'):
print(' ', '<none>')
print()
pprint.pp(config)
#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)