am using pysnmp module to do an snmp get on a USB key status

from pysnmp.entity.rfc3413.oneliner import cmdgen

#--query on ccmSDIDUKeyStatus
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( cmdgen.CommunityData('xxx', 'xxx', 1), cmdgen.UdpTransportTarget(('', 161)), (1,3,6,1,4,1,18489,1,2,4,2,8,0))

varBinds gives the following:

[(ObjectName(''), Integer('2'))]

I need to print the key status, based on varBinds, it is connected if Integer('1'), disconnected if Integer('2')

I have read that, varBinds is a 'tuple of managed objects' and 'each managed object is a pair of Object Name and Object Value'.

By this, I understand that, my varBinds gives me 1 managed object(name,value pair)

I need to access this 'value' from varBinds

how can I do it??

any help is welcome

This question has already been answered. Start a new discussion instead.