请问Zabbix 6.0如何批量加入IPMI IP来测试ping状态?

新手上路,请多包涵

请问Zabbix 6.0如何批量加入IPMI IP来测试ping状态?
系統版本 : Ubuntu 20.04

阅读 2.3k
1 个回答

用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服务器的URL
IPMI IP:换成你要添加的IPMI IP,
把Your auth token换成你的Zabbix用户的认证令牌。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进