net-snmp上的python包装器
yahoo-panoptes-snmp的Python项目详细描述
全景SNMP
A Python wrapper on Net-SNMP
目录
简介
这个库是优秀的EasySNMP library的分支,它提供了一个pythonic包装器 在Net-SNMPc库的顶部。
背景
与上游库的主要区别是:
- 包括net snmp源代码,用于在安装过程中生成共享对象,从而生成自包含的分发版
- net snmp库的锁定选项:例如,snmpv1是,应用程序被禁用
- 发行版中不包含MIB—这是设计的,因为使用符号oid比较慢
- 基于python的bulk-walk实现
- 修复对隧道式SNMP连接的支持
安装
通过运行以下命令进行安装:
pip install yahoo_panoptes_snmp
用法
这个api类似于easysnmp,它是documented here
散散步
bulkwalk的实现基于执行bulkgets并使用oid树的“脱落”来终止。
方法签名如下:
defbulk_walk(self,oids,non_repeaters=0,max_repetitions=10):""" Performs a series of bulk SNMP GET operation using the prepared session to retrieve multiple pieces of information in a single packet. :param oids: you may pass in a list of OIDs or single item; each item may be a string representing the entire OID (e.g. 'sysDescr.0') or may be a tuple containing the name as its first item and index as its second (e.g. ('sysDescr', 0)) :param non_repeaters: the number of objects that are only expected to return a single GETNEXT instance, not multiple instances :param max_repetitions: the number of objects that should be returned for all the repeating OIDs :return: a list of SNMPVariable objects containing the values that were retrieved via SNMP """
贡献
我们欢迎提出问题、问题和请求-请查看contributing以了解如何这样做。
维护人员
- 瓦伦瓦玛:vvarun@oath.com
许可证
这个项目是根据BSD开源许可的条款授权的。请参阅LICENSE了解完整条款。
学分
请参阅CREDITS file以获取完整的信用列表。