python获取zabbix数据api接口。

pyzbx的Python项目详细描述


介绍
=========
pyzbx 使用python开发获取zabbix 源数据的API Application.

###版本###
0.0.1

###功能###
目前该APP提供一些获取zabbix 数据的interface,具体功能如下:

* [getAuthCode()] - 用户获取登入用户的Auth摘要.
* [getHostid()] - 通过参数hostname,获取该hostname的hostid.
* [getItemid()] - 获取item 的itemid.
* [getHistoryData()] - 获取历史数据.具体的参数可以参考:https://www.zabbix.com/documentation/2.0/manual/appendix/api/history/get


###安装###
```sh
$ pip install pyzbx
```

###实例###
```sh
$ response = pyzbx.ZbxAPI(zabbix_url="http://zabbix_server[:port]/zabbix/api_jsonrpc.php", user='user', password='password')
$ auth = response.getAuthCode() #获取登入用户的Auth摘要
$ hostid = response.getHostid(monitor_hostname='x.x.x.x') #获取item 监控主机的hostid
$ itemid = response.getItemid(monitor_item_key='system.cpu.util[,steal]') #获取item 监控项的itemid
$ historyData = response.getHistoryData(monitor_item_key='system.cpu.util[,steal]',
history=3,
output='extend',
limit=10) #获取zabbix Server的历史记录
```

###关于作者@shaozhi.zhang###
```sh
function author(){
Email='davidbjhd@gmail.com';
Blog='http://www.pydevops.com';
}
```

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java GWT对话框从不显示帮助   java在简单的MapReduce作业中带来了极大的开销   javacom。mysql。jdbc。例外情况。jdbc4。MySQLIntegrityConstraintViolationException:列不能为null/onetoone映射   如何通过TCP/IP与Java和Labview进行通信,并发送浮点数据缓冲区?   java Apache camel与spring事件基本示例   java如何使我的秒表应用程序在完全关闭后仍能运行?   java Nutch爬网错误输入路径不存在   java是Mapreduce中按值传递还是按引用传递的键?   正则表达式替换java中的特定字符   Java DOM XML解析   java Eclipse未显示服务器的项目   使用Arraylist进行快速排序的排序Java实现疑难解答   java Split text包含字符串列表中的数字   检查Java中的两个lambda是否执行相同的代码?   java为什么dispatchTouchEvent避免在屏幕上单击?