Skip to content

Set up a Network Discovery Rule and Action to Auto Configure SNMP Devices

Video Lecture

Set up a Network Discovery Rule and Action to Auto Configure SNMP Devices Set up a Network Discovery Rule and Action to Auto Configure SNMP Devices

Description

I set up Network Discovery Rule to find SNMP devices on my local network and then add them as a host using a Discovery Action

On my network, I have a TP-Link SNMP router and Cisco Switch.

They will both be discovered, and I will auto assign the Generic SNMP template.

I will use my Raspberry Pi, which is configured as my Zabbix proxy, to scan the local network for any SNMP devices listening on port 161.

I have preconfigured both my SNMP devices to use the mycommunity community and are sure that they respond to SNMP requests.

From my Raspberry Pi, I have pre-installed the SNMP tools,

sudo apt install snmp

and can use snmpget to test both devices respond with the system description.

snmpget -v2c -cmycommunity <hostname or ip> 1.3.6.1.2.1.1.1.0

To begin configuration in Zabbix,

I create a new Discovery Rule,

  • Name : SNMP Discovery
  • Discovery by proxy : RaspberryPi
  • IP Range : 192.168.1.0/24
  • Checks :
    • Check Type : SNMPv2 agent
    • Port Range : 161
    • SNMP Community : mycommunity
    • OID : 1.3.6.1.2.1.1.1.0
  • Device Uniqueness : IP Address
  • Host name : DNS Address
  • Visible Name : Host name

Then I create a Discovery Action to add each SNMP host

  • Name : Add SNMP Host
  • Conditions:
    • Discovery rule equals SNMP Discovery
  • Operations:
    • Add to host groups: Templates/Network Devices
    • Link to templates: Generic SNMP

TCPDump

If you want, you can watch the scan progress from the Zabbix proxy by using the TCPDump command.

You may need to install TCPDump first.

sudo apt install tcpdump

The TCPDump command to watch the SNMP requests from the Zabbix proxy is

sudo tcpdump -n -s0  port 161 and udp

The scan progress can be quite slow and unpredictable when it will start/finish. Leave it running and come back in 24 hours.

Once I am happy that all the SNMP devices have been discovered and added, I then disable the Discovery rule so that I don't get any duplicate hosts added due to me changing the host names in the Zabbix UI configuration.

Configuring a network discovery rule

Comments