Basic template
This commit is contained in:
13
main.py
13
main.py
@@ -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)
|
||||
Reference in New Issue
Block a user