Setup LLD Discovery Rules and Actions to Auto Configure SNMP Devices

Video Lecture

Setup LLD Discovery Rules and Actions to Auto Configure SNMP Devices Setup LLD Discovery Rules and Actions to Auto Configure SNMP Devices Setup LLD Discovery Rules and Actions to Auto Configure SNMP Devices

Description

I setup LLD Discovery Rules and Actions to find and auto configure all SNMP devices on my local network. The rule and actions will scan all internal IP address for accessible SNMP daemon system descriptions, read the response, and then use that response to add it to a server group, and to also auto configure it the relevant template.

On my network I have,

  • A Windows 10 workstation,
  • A Mac OSX,
  • An Ubuntu 18 VM
  • A Centos 7 VM
  • And a Raspberry Pi running Raspbian.

My Raspberry Pi is also my Zabbix Proxy. This proxy will be doing the SNMP scan.

All the operating systems on my internal network are running SNMP daemons, and I have tested they respond with the system description by running for each ip.

1
snmpwalk -v2c -cmycommunity <hostname or ip> 1.3.6.1.2.1.1.1

If you have also installed snmp-mibs-downloader on the server that will do the SNMP scan, the raspberrypi in my case, then you could also query using MIB descriptions as well as OIDs. So this method using MIBs will also work,

1
snmpwalk -v2c -cmycommunity <hostname or ip> SNMPv2-MIB::sysDescr.0

To begin setup in Zabbix,

I create a new Discovery Rule,

  • Name : SNMP Discovery
  • Discovery by proxy : RaspberryPi
  • IP Range : 192.168.1.1-254,127.0.0.1
  • Checks :
    • Check Type : SNMPv2 agent
    • Port Range : 161
    • SNMP Community : mycommunity
    • OID : SNMPv2-MIB::sysDescr.0
  • Device Uniqueness : IP Address
  • Host name : DNS Address
  • Visible Name : Host name

Then I create 3 actions for each OS type,

  • Action 1
    • Name : Add Linux SNMP Host
    • Type of calculation : AND
    • Conditions:
      • Discovery rule equals SNMP Discovery
      • Received value contains Linux
    • Operations:
      • Add to host groups: Linux servers
      • Link to templates: Template OS Linux SNMPv2
  • Action 2
    • Name : Add MacOSX SNMP Host
    • Type of calculation : AND
    • Conditions:
      • Discovery rule equals SNMP Discovery
      • Received value contains Darwin
    • Operations:
      • Add to host groups: Linux servers
      • Link to templates: Template OS Linux SNMPv2
  • Action 3
    • Name : Add Windows SNMP Host
    • Type of calculation : AND
    • Conditions:
      • Discovery rule equals SNMP Discovery
      • Received value contains Windows
    • Operations:
      • Add to host groups: Linux servers
      • Link to templates: Template OS Windows SNMPv2

The tcp dump command to watch the SNMP requests from the zabbix proxy is

1
sudo tcpdump -n -s0  port 161 and udp

Configuring a network discovery rule