ansible.snmp.walk (2.0.0) — module

Perform an SNMP walk against a remote device for one or more OIDs

| "added in version" 1.0.0 of ansible.snmp"

Authors: Bradley Thornton (@cidrblock)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install ansible.snmp:==2.0.0


Add to requirements.yml

  collections:
    - name: ansible.snmp
      version: 2.0.0

Description

Perform an SNMP walk against a remote device for one or more OIDs

Inputs

    
oids:
    description:
    - A dictionary of entries to walk on the remote device
    elements: dict
    required: true
    suboptions:
      iid:
        description:
        - the dotted-decimal, instance identifier, for scalar MIB objects use '0'
        type: str
      oid:
        description:
        - The OID to retrieve.
        required: true
        type: str
    type: list

enums:
    default: true
    description:
    - Set to `True` to have integer return values converted to enumeration identifiers
      if possible.
    type: bool

numeric:
    default: false
    description:
    - Set to `True to have `oids` returned untranslated (i.e. dotted-decimal).
    type: bool

best_guess:
    choices:
    - 0
    - 1
    - 2
    default: 0
    description:
    - 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).
    type: int

long_names:
    default: false
    description:
    - Set to `True` to have OIDS generated preferring longer Mib name convention.
    type: bool

sprint_value:
    default: true
    description:
    - 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.
    type: bool

Outputs

elapsed:
  description: The amount of time in seconds spent for the snmp calls
  returned: always
  sample:
    total:
      description: the amount of time spent on all snmp calls
      returned: always
      type: float
    walk:
      description: The amount of time spent in seconds for the walk
      returned: always
      type: float
  type: dict
raw:
  description: The raw result from the snmp walk
  elements: dict
  returned: always
  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
  type: list
result:
  description: The transformed result from the snmp walk
  elements: dict
  returned: always
  sample:
    _raw:
      description: The individual oid entry and the currently set value
      returned: always
  type: list