Re: [pysnmp-users] extracting values from responses
Brought to you by:
elie
From: Ilya E. <il...@gl...> - 2017-09-11 15:42:52
|
Hi Andrew, To answer your exact question -- you need to pick up the value at the callback function and pass it up to the caller (via a global variable or better mutable stack variable). BUT! Do not do that! You are using a very old pysnmp API! Better use the modern one -- it's way better: http://pysnmp.sourceforge.net/examples/hlapi/asyncore/sync/manager/cmdgen/snmp-versions.html#snmpv3-auth-md5-privacy-des On 09/11/2017 05:37 PM, Andrew Gallo wrote: > Greetings: > > Using pysnmp 4.3.9 on python 2.7. I'm following the SNMPv3 example at > >> http://pysnmp.sourceforge.net/examples/current/v3arch/manager/cmdgen/get-v3.html >> > > > How do I assign the returned value to a variable? > When I issue a command like: > rtnval = snmpEngine.transportDispatcher.runDispatcher() > 1.3.6.1.4.1.10002.2.30.1.1.1.3.16793610.1.1 = -100 > > But, rtnval is empty: > >>> type(rtnval) > <type 'NoneType'> > > Is there anyway to extract the value (in this case -100)? > > Thank you. > > ------------------------------------------------------------------------------ > > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > pysnmp-users mailing list > pys...@li... > https://lists.sourceforge.net/lists/listinfo/pysnmp-users |