pysnmp的安装
pysnmp的网站:http://pysnmp.sourceforge.net/
pysnmp依赖两个第三方的python库:
(1) ASN.1 : Structure of Management Information:管理信息结构
用于定义通过网络管理协议可访问的对象的规则。SMI定义在MIB中使用的数据类型及网络资源在MIB中的名称或表示。
(2) Cryptography Toolkit: 用来加密的。
安装的过程为先安装ASN.1 和Cryptography的python库,最后安装pysnmp。
下载地址:
ASN.1 library for Python:
http://sourceforge.net/projects/pyasn1/files/
Python Cryptography Toolkit:
http://www.amk.ca/python/code/crypto.html 这里的需要C编译,如果在windows下编译不方便的话,建议安装编译好的exe:
http://www.voidspace.org.uk/python/modules.shtml#pycrypto
PySNMP:
http://sourceforge.net/projects/pysnmp/files/ 目前最新版本为:pysnmp-4.1.15a
安装顺序:
(1): ASN.1 library for Python :
(2):Python Cryptography Toolkit : 双击EXE
(3): PySNMP : python setup.py install
测试是否成功:
在Pysnmp解压的目录下有一个example的目录,首先运行
\examples\v3arch\agent\cmdrsp.py
接下来运行\examples\v3arch\manager\getgen.py
出现结果:
1.3.6.1.2.1.1.1.0 = Example Command Responder
则说明安装正确了。
参考:
http://www.cnblogs.com/qigo4c/archive/2009/10/18/1585631.html
py
1.3.6.1.2.1.1.1.0 = PySNMP example command responder
1.3.6.1.2.1.1.3.0 = 4396