diff options
author | elie <elie> | 2012-09-10 10:23:54 +0000 |
---|---|---|
committer | elie <elie> | 2012-09-10 10:23:54 +0000 |
commit | bc8cb42017e8a615802ccb8c389242c2e0901319 (patch) | |
tree | b388e18935d423471350412420a595cbfaef0302 /docs | |
parent | 28186f3dce7854ff1092e3e3b866978bd750c575 (diff) | |
download | pysnmp-bc8cb42017e8a615802ccb8c389242c2e0901319.tar.gz |
minor formatting fixes
Diffstat (limited to 'docs')
-rw-r--r-- | docs/pysnmp-tutorial.html | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/docs/pysnmp-tutorial.html b/docs/pysnmp-tutorial.html index c066654..6292f6e 100644 --- a/docs/pysnmp-tutorial.html +++ b/docs/pysnmp-tutorial.html @@ -65,6 +65,10 @@ PySNMP tutorial </UL> </UL> +<I> +Applicable to PySNMP 4.2.3 and later. +</I> + <P> <A NAME="NETWORK-MANAGEMENT-BASICS"></A> @@ -1448,13 +1452,15 @@ So the GET operation is performed: <PRE> from pysnmp.entity.rfc3413.oneliner import cmdgen -def cbFun(sendRequestHandle, errorIndication, errorStatus, errorIndex, varBinds, cbCtx): +def cbFun(sendRequestHandle, errorIndication, errorStatus, errorIndex, + varBinds, cbCtx): if errorIndication: print(errorIndication) return if errorStatus: - print('%s at %s' % (errorStatus.prettyPrint(), - errorIndex and varBinds[int(errorIndex)-1] or '?') + print('%s at %s' % \ + (errorStatus.prettyPrint(), + errorIndex and varBinds[int(errorIndex)-1] or '?') ) return @@ -1587,13 +1593,15 @@ this example are the same for all targets. So the GETNEXT operation is performed <PRE> from pysnmp.entity.rfc3413.oneliner import cmdgen -def cbFun(sendRequestHandle, errorIndication, errorStatus, errorIndex, varBindTable, cbCtx): +def cbFun(sendRequestHandle, errorIndication, \ + errorStatus, errorIndex, varBindTable, cbCtx): if errorIndication: print(errorIndication) return if errorStatus: - print('%s at %s' % (errorStatus.prettyPrint(), - errorIndex and varBindTable[-1][int(errorIndex)-1] or '?') + print('%s at %s' % \ + (errorStatus.prettyPrint(), + errorIndex and varBindTable[-1][int(errorIndex)-1] or '?') ) return @@ -1838,7 +1846,6 @@ for target in ( ntforg.UdpTransportTarget(('127.0.0.1', 162)), ntfOrg.snmpEngine.transportDispatcher.runDispatcher() </PRE> -</TABLE> </TD></TR></TABLE> <P> @@ -2739,7 +2746,9 @@ Let's consider SNMP Conceptual Table created in an "MY-MIB.py" file: <TABLE BGCOLOR="lightgray" BORDER=0 WIDTH=90% ALIGN=CENTER><TR><TD> <PRE> myTable = MibTable((1, 3, 6, 1, 4, 1, 20408, 2, 1)) -myTableEntry = MibTableRow(myTable.getName() + (1,)).setIndexNames((0, "MY-MIB", "myTableIndex")) +myTableEntry = MibTableRow(myTable.getName() + (1,)).setIndexNames( + (0, "MY-MIB", "myTableIndex") + ) myTableIndex = MibTableColumn(myTableEntry.getName() + (1,), Integer()) myTableValue = MibTableColumn(myTableEntry.getName() + (2,), OctetString()) </PRE> @@ -3033,7 +3042,9 @@ raised. >>> mibBuilder = builder.MibBuilder().loadModules('SNMPv2-MIB') >>> mibViewController = view.MibViewController(mibBuilder) >>> ->>> oid, label, suffix = mibViewController.getNodeName((1,3,6,1,2,'mib-2',1,'sysDescr')) +>>> oid, label, suffix = mibViewController.getNodeName( + (1,3,6,1,2,'mib-2',1,'sysDescr') + ) >>> print(oid) (1, 3, 6, 1, 2, 1, 1, 1) >>> print(label) @@ -3095,7 +3106,7 @@ Managed Object by OID <STRONG>name</STRONG> as a tuple of The <STRONG>modName</STRONG> and <STRONG>mibName</STRONG> parameters are as used in <A HREF="#MibBuilder">MibBuilder</A> interface. The <STRONG>suffix</STRONG> parameter is as described in -<A HREF="MIB-VIEW-MANAGED-OBJECT-NAME">getNodeName</A>() method. +<A HREF="#MIB-VIEW-MANAGED-OBJECT-NAME">getNodeName</A>() method. </P> </DD> </DL> @@ -3107,7 +3118,9 @@ as used in <A HREF="#MibBuilder">MibBuilder</A> interface. The >>> mibBuilder = builder.MibBuilder().loadModules('SNMPv2-MIB') >>> mibViewController = view.MibViewController(mibBuilder) >>> ->>> modName, symName, suffix = mibViewController.getNodeLocation((1,3,6,1,2,1,1,1,123)) +>>> modName, symName, suffix = mibViewController.getNodeLocation( + (1,3,6,1,2,1,1,1,123) + ) >>> print(modName) SNMPv2-MIB >>> print(symName) @@ -3803,14 +3816,6 @@ octet-streams manipulations. <HR> -<I> -<P> -Disclaimer: this document is a work-in-progress. -It is neither complete nor accurate. -Take it with a grain of salt! -</P> -</I> - </TR></TD></TABLE> </TR></TD></TABLE> |