pysnmp how to use -O option if possible

Viewed 25

I'm playing around with pysnmp to create a script to discover a cisco based network via cdp. I like to do a "snmpwalk" with the -Ov option to only get values not OIDs.

Following my code for the getCmd:

def get(target, oids, credentials, port=1024, engine=hlapi.SnmpEngine(), context=hlapi.ContextData()):
    handler = hlapi.getCmd(  # snmp get command
        engine,
        credentials,
        hlapi.UdpTransportTarget((target, port)),
        context,
        *construct_object_types(oids)
    )
    return fetch(handler, 1)[0]

I've read pysnmp documentaion but can't quite get how to use Options :/

Thanks in advance and kind regards

Masl

0 Answers
Related