ansible / ansible.builtin / v2.4.0.0-1 / module / snmp_facts Retrieve facts for a device using SNMP. | "added in version" 1.9 of ansible.builtin" Authors: Patrick Ogenstad (@ogenstad) preview | supported by communityansible.builtin.snmp_facts (v2.4.0.0-1) — module
pip
Install with pip install ansible==2.4.0.0.post1
Retrieve facts for a device using SNMP, the facts will be inserted to the ansible_facts key.
# Gather facts with SNMP version 2 - snmp_facts: host: '{{ inventory_hostname }}' version: v2c community: public delegate_to: local
# 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
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