A utility library for easier use of pysnmp4.
This function adds a directory to the internal MIB search path.
This function loads one or more pysnmp-format MIBs. Beware that these are not standard MIB files, see libsmi2pysnmp(1), smidump(1) and build-pysnmp-mib(1) for all the details.
Returns a tuple with symbolic name information for the given object id.
Returns the symbolic name for the object id.
Returns the node id for the name as a tuple of integers.
This class wraps arround pysnmp's cmdgen.CommandGenerator to make it easier to address a SNMP agent.
The constructor takes a hostname/ip address and a list of community info dicts. These dicts can have the following keys:
- name
- The security name to use. Almost always ignored, defaults to snormpy
- community
- The snmp community to use, defaults to public
- version
- The snmp version to use. Should be snormpy.V1 or snormpy.V2C (default)
- port
- The port the snmpd should listen on, defaults to 161
All communities in the list are tried until one succeeds. If none succeed, the created instance will have the 'alive' attribute set to False and should not be used.
Takes a named oid, queries the server and returns the value of that oid on the server.
Takes a named oid, queries the server and sets the value of that oid on the server to the given value.
Takes a named oid, walks that table and returns a list of (oid, value) pairs in that table
Fetches all tables listed in tables and combines returned values according to the index table. If index is None, the index will be autogenerated from the tail of the table OID's. For example, to collect network interface data, one can use:
matchtables('IF-MIB::ifIndex', ('IF-MIB::ifDescr', 'IF-MIB::ifPhysAddress', 'IF-MIB::ifOperStatus'))