zabbix api调用
api能干什么
Zabbix API allows you to programmatically retrieve and modify the configuration of Zabbix and provides access to historical data.
It is widely used to:
- Create new applications to work with Zabbix;
- Integrate Zabbix with third party software;
- Automate routine tasks.
我自己的理解就是可以通过编程的方法操作zabbix,比如说创建主机啊,创建图形等,当然不只是创建,增删改查基本都支持。
api的协议
用php创建的基于了JSON-RPC 2.0
意味着api的请求和回复格式都是用json编码
python编写程序调用api
需要调用的模块
- urllib2
- json
步骤大致分为两步,
认证,取得ac (authentication token)
{
"jsonrpc": "2.0",
"method": "user.login",
"params": {
"user