ansible.builtin.snmp_facts (v2.5.10) — module

Retrieve facts for a device using SNMP.

| "added in version" 1.9 of ansible.builtin"

Authors: Patrick Ogenstad (@ogenstad)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.5.10

Description

Retrieve facts for a device using SNMP, the facts will be inserted to the ansible_facts key.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Gather facts with SNMP version 2
- snmp_facts:
    host: '{{ inventory_hostname }}'
    version: v2c
    community: public
  delegate_to: local
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Gather facts using SNMP version 3
- snmp_facts:
    host: '{{ inventory_hostname }}'
    version: v3
    level: authPriv
    integrity: sha
    privacy: aes
    username: snmp-user
    authkey: abc12345
    privkey: def6789
  delegate_to: localhost

Inputs

    
host:
    description:
    - Set to target snmp server (normally {{inventory_hostname}})
    required: true

level:
    choices:
    - authPriv
    - authNoPriv
    description:
    - Authentication level, required if version is v3
    required: false

authkey:
    description:
    - Authentication key, required if version is v3
    required: false

privacy:
    choices:
    - des
    - aes
    description:
    - Encryption algorithm, required if level is authPriv
    required: false

privkey:
    description:
    - Encryption key, required if version is authPriv
    required: false

version:
    choices:
    - v2
    - v2c
    - v3
    description:
    - SNMP Version to use, v2/v2c or v3
    required: true

username:
    description:
    - Username for SNMPv3, required if version is v3
    required: false

community:
    description:
    - The SNMP community string, required if version is v2/v2c
    required: false

integrity:
    choices:
    - md5
    - sha
    description:
    - Hashing algorithm, required if version is v3
    required: false