Perform an SNMP walk against a remote device for one or more OIDs
Version added: 1.0.0
- Perform an SNMP walk against a remote device for one or more OIDs
Parameter |
Choices/Defaults |
Comments |
best_guess
integer
|
|
This setting controls how return value oids are parsed.
Setting to 0 causes a regular lookup.
Setting to 1 causes a regular expression match (defined as -Ib in snmpcmd).
Setting to 2 causes a random access lookup (defined as -IR in snmpcmd).
|
enums
boolean
|
|
Set to `True` to have integer return values converted to enumeration identifiers if possible.
|
long_names
boolean
|
|
Set to `True` to have OIDS generated preferring longer Mib name convention.
|
numeric
boolean
|
|
Set to `True to have `oids` returned untranslated (i.e. dotted-decimal).
|
oids
list
/ elements=dictionary
/ required
|
|
A dictionary of entries to walk on the remote device
|
|
iid
string
|
|
the dotted-decimal, instance identifier, for scalar MIB objects use '0'
|
|
oid
string
/ required
|
|
The OID to retrieve.
|
sprint_value
boolean
|
|
Set to `True` to have return values formatted with netsnmp's sprint_value function.
This will result in certain data types being returned in non-canonical format.
Values returned with this option set may not be appropriate for 'set' operations.
|
Note
- Tested against ubuntu 18.04 using net-snmp.
- This module works with connection
v1
, v2c
, v3_usm
.
Common return values are documented here, the following are the fields unique to this module:
Key |
Returned |
Description |
elapsed
dictionary
|
always |
The amount of time in seconds spent for the snmp calls
Sample:
{'walk': {'description': 'The amount of time spent in seconds for the walk', 'type': 'float', 'returned': 'always'}, 'total': {'description': 'the amount of time spent on all snmp calls', 'type': 'float', 'returned': 'always'}}
|
raw
list
/ elements=dictionary
|
always |
The raw result from the snmp walk
Sample:
{'iid': {'description': 'The instance id', 'returned': 'always', 'type': 'str'}, 'tag': {'description': 'The OID', 'returned': 'always', 'type': 'str'}, 'type': {'description': 'The type of the value', 'returned': 'always', 'type': 'str'}, 'value': {'description': 'The currently set value for the oid', 'returned': 'always', 'type': 'raw'}}
|
result
list
/ elements=dictionary
|
always |
The transformed result from the snmp walk
Sample:
{'_raw': {'description': 'The individual oid entry and the currently set value', 'returned': 'always'}}
|
- Bradley Thornton (@cidrblock)