lang110 发表于 2018-1-1 11:06:43

zabbix-api 添加监控

https://images2015.cnblogs.com/blog/1013504/201703/1013504-20170328180148904-1977170177.png
https://images2015.cnblogs.com/blog/1013504/201703/1013504-20170328181231092-840178276.png
  

python zabbix_api.py-C 192.168.60.13 "Linux servers" "Template OS Linux"  

  

curl -s -X POST -H 'Content-Type:application/json' -d '  

{"jsonrpc": "2.0","method": "host.create","params": {"host": "Linux server","interfaces": [  {
"type": 1,"main": 1,"useip": 1,"ip": "192.168.60.13","dns": "","port": "10050"  }
  ],
"groups": [  {
"groupid": "2"  }
  ],
"templates": [  {
"templateid": "10001"  }
  ],
  },
"auth": "c420a53318369184c9a6e00d439342fb","id": 2  
}
' http://192.168.60.217/zabbix/api_jsonrpc.php|python -mjson.tool  

  

  

Enabling a host:
  

  {
"jsonrpc": "2.0","method": "host.update","params": {"hostid": "10092","status": 0  },
"auth": "038e1d7b1735c6a5436ee9eae095879e","id": 1  
}
  

  http://www.361way.com/zabbix-api-2/3681.html
  https://raw.githubusercontent.com/joe011/zabbix/master/zabbix_api.py
页: [1]
查看完整版本: zabbix-api 添加监控