services
This commit is contained in:
12
main.py
12
main.py
@@ -50,3 +50,15 @@ object Host "{hostname}" {{
|
|||||||
check_command = "hostalive"
|
check_command = "hostalive"
|
||||||
}}'''.format(hostname=hostname,address=obj["address"])
|
}}'''.format(hostname=hostname,address=obj["address"])
|
||||||
print(template)
|
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