W3cubDocs

/Ansible

snmp_facts - Retrieve facts for a device using SNMP.

New in version 1.9.

Synopsis

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

Requirements (on host that executes module)

  • pysnmp

Options

parameter required default choices comments
authkey
no
Authentication key, required if version is v3
community
no
The SNMP community string, required if version is v2/v2c
host
yes
Set to target snmp server (normally {{inventory_hostname}})
integrity
no
  • md5
  • sha
Hashing algoritm, required if version is v3
level
no
  • authPriv
  • authNoPriv
Authentication level, required if version is v3
privacy
no
  • des
  • aes
Encryption algoritm, required if level is authPriv
privkey
no
Encryption key, required if version is authPriv
username
no
Username for SNMPv3, required if version is v3
version
yes
  • v2
  • v2c
  • v3
SNMP Version to use, v2/v2c or v3

Examples

# Gather facts with SNMP version 2
- snmp_facts: host={{ inventory_hostname }} version=2c community=public
  connection: 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

This is an Extras Module

For more information on what this means please read Extras Modules

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.

© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/snmp_facts_module.html