From 3a939c1348db608c8285919285fbfa74db9a4d20 Mon Sep 17 00:00:00 2001 From: elie Date: Mon, 27 Aug 2012 07:53:49 +0000 Subject: updated --- README | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'README') diff --git a/README b/README index 254b41b..fa9bb98 100644 --- a/README +++ b/README @@ -15,10 +15,9 @@ FEATURES Managed Objects * Complete SNMP entity implementation * USM Extended Security Options support (3DES, 192/256-bit AES encryption) -* Extensible network transports framework (UDP and UNIX domain implemented) +* Extensible network transports framework (UDP/IPv4, UDP/IPv6 and UNIX domain sockets already implemented) * Asynchronous socket-based IO API support * Twisted (http://twistedmatrix.com) integration -* IPv6 transport support * Python eggs and py2exe friendly * 100% Python, works with Python 2.4 though 3.3 (alpha 2) * MT-safe (only if run locally to a thread) @@ -37,7 +36,7 @@ MISFEATURES ----------- * Much slower than C implementations. Some optimization still possible. -* No pure-Python MIB compiler. But there's a workaround, read on. +* No pure-Python MIB compiler. The libsmi's smidump tool used for one-time MIB compilation. INSTALLATION ------------ @@ -53,7 +52,8 @@ OPERATION As of this writing, PySNMP implements two SNMP architectures -- the first is a legacy one specified by SNMPv1 & v2c standards [5]. It is quite low-level and protocol-oriented by design. In particular, it requires -application to manage transport failures, access issues and so on. +application to manage authentication and access issues, deal with transport +failures and similar housekeeping stuff. The second model supported by PySNMP is aligned to SNMPv3 architecture, as specified in [4]. Here is an example on querying SNMP agent @@ -64,13 +64,14 @@ privacy enabled: from pysnmp.entity.rfc3413.oneliner import cmdgen -userData = cmdgen.UsmUserData('test-user', 'authkey1', 'privkey1') -targetAddr = cmdgen.UdpTransportTarget(('localhost', 161)) +cmdGen = cmdgen.CommandGenerator() -errorIndication, errorStatus, \ - errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( - userData, targetAddr, (('SNMPv2-MIB', 'sysDescr'), 0) - ) +errorIndication, errorStatus, errorIndex, varBinds = cmdGen.getCmd( + cmdgen.CommunityData('public'), + cmdgen.UdpTransportTarget(('localhost', 161)), + cmdgen.MibVariable('SNMPv2-MIB', 'sysDescr', 0), + lookupNames=True, lookupValues=True +) if errorIndication: # SNMP engine errors print errorIndication @@ -91,19 +92,20 @@ For more examples, please see the examples directory in the PySNMP distribution. MIB SUPPORT ----------- -The pysnmp.smi sub-package defines and implements data model for SNMP SMI +The pysnmp.smi package component defines and implements data model for SNMP SMI objects. With that model, various objects defined in MIB file could be implemented in Python, loaded into SNMP entity and used for verification and visualisation purposes (SNMP manager side) and/or become management targets (SNMP agent side). -While MIB parser/codegenerator has not been implemented in PySNMP, the -smidump tool of libsmi library [6] could be used for automatic convertion -of MIB text files into Python code. The produced code relies on PySNMP -SMI library. +While MIB parser/codegenerator has not yet been implemented in PySNMP, the +smidump tool of libsmi library [6] could be used for automatic, one-time +convertion of MIB text files into specific Python programs designed to be +dynamically loaded and used by PySNMP engine. -In order to convert MIB text files into pysnmp.smi-compliant Python source, -please, use build-pysnmp-mib utility as shipped with PySNMP distribution. +To simplify smidump tool invocation followed by libsmi2pysnmp script, PySNMP +distribution includes a build-pysnmp-mib shell script. You should use it for +one-time MIB text modules convertion into PySNMP format. A large set of pre-compiled MIB files is shipped along the pysnmp-mibs package.[2] -- cgit v1.2.1