17.解决zabbix host [Windows host] not found-11062687
#!/usr/bin/pythonimport os
import time
import socket
import fileinput
os.system('sc stop "Zabbix Agent"')
time.sleep(10)
hostname = socket.gethostbyname(socket.gethostname())
for line in fileinput.input("C:\zabbix_agents_2.2.9.win\conf\zabbix_agentd.win.conf", inplace=1):
line = line.replace("Hostname=Windows host", "Hostname=%s" % (hostname))
print line,
os.system('sc start "Zabbix Agent"')
页:
[1]