services
This commit is contained in:
12
main.py
12
main.py
@@ -49,4 +49,16 @@ object Host "{hostname}" {{
|
||||
address = "{address}"
|
||||
check_command = "hostalive"
|
||||
}}'''.format(hostname=hostname,address=obj["address"])
|
||||
print(template)
|
||||
|
||||
for hostname,obj in config["service"].items():
|
||||
template = r'''
|
||||
object Service "{service}" {{
|
||||
import "generic-service"
|
||||
host_name = "{hostname}"
|
||||
check_command = "{command}"
|
||||
check_interval = {check_interval}m
|
||||
retry_interval = {retry_interval}m
|
||||
}}'''.format(hostname=hostname, service=obj["service_description"], check_interval=int(float(obj["check_interval"])),
|
||||
retry_interval=int(float(obj["retry_interval"])),command=obj["check_command"])
|
||||
print(template)
|
||||
Reference in New Issue
Block a user