获取模板信息zabbix_template.py
import zabbix_base
# 获取token
token=zabbix_base.get_token()
# 获取模板
data = {
"jsonrpc": "2.0",
"method": "template.get",
"params": {
"output": ["host"],
},
"auth":token,
"id": 1
}
result=zabbix_base.zabbix_api_common(data)
print("获取模板::",result['result'],"\n\n")