用Python和Zabbix API创建主机:import requests import json url = "http://your_zabbix_server/api_jsonrpc.php" headers = { 'Content-Type': 'application/json-rpc', } data = { "jsonrpc": "2.0", "method": "host.create", "params": { "host": "Host name", "interfaces": [ { "type": 2, # 1 for agent, 2 for SNMP, 3 for IPMI, 4 for JMX "main": 1, "useip": 1, "ip": "IPMI IP", "dns": "", "port": "161" } ], "groups": [ { "groupid": "1" } ], "templates": [ { "templateid": "10001" } ], }, "auth": "Your auth token", "id": 1 } response = requests.post(url, headers=headers, data=json.dumps(data)) print(response.json())your_zabbix_server:Zabbix服务器的URLIPMI IP:换成你要添加的IPMI IP,把Your auth token换成你的Zabbix用户的认证令牌。
用Python和Zabbix API创建主机:
your_zabbix_server:Zabbix服务器的URL
IPMI IP:换成你要添加的IPMI IP,
把Your auth token换成你的Zabbix用户的认证令牌。