using pysnmp I am querying a variable which gives the IP address. I want to check that address.

I do the following

...........
............
.............
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd( cmdgen.CommunityData('xxx', 'yyy', 1), cmdgen.UdpTransportTarget((addr,161)), ((1,3,6,1,4,1,18489,1,2,2,2,9,30,0)))
print"Error on GET for ccmSDIDULinkUtilEastRemoteIP -%s,%s%(errorIndication,errorStatus)
print varBinds
print varBinds[0][1]

i get the following:

Error on GET for ccmSDIDULinkUtilEastRemoteIP -None,0
[(ObjectName('1.3.6.1.4.1.18489.1.2.2.2.9.30.0'), IpAddress('0.0.0.0'))]

varBinds[0][1] is giving me some wierd value.. some unrecognizable characters..which i can't even copy, paste.. It's driving me nuts :'(

Pls.. help........

Grib....

repr() of the value gives me:

IpAddress('0.0.0.0')

:)

Ok, so it's not at all weird, only it's not a very useful address... Were you expecting something else ?

Edited 5 Years Ago by Gribouillis: n/a

ok... thanks Grib...
before using repr(), I was getting some unrecognizable string.. something like four squares!!

U guided me in the right direction... Thanks a lot :)

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