Setup LLD Discovery Rules and Actions to Auto Configure SNMP Devices
Video Lecture
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 |
|
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 |
|
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 SNMP
- 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 SNMP
- 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 SNMP
Note
Since Zabbix 5.0.2 many Zabbix templates have been updated and renamed to be generic between SNMP, SNMPv2 and SNMPv3 protocols. The SNMP credentials are now carried at the host interface level instead of item level. Where template names included "SNMPv2", they now just say "SNMP".
The tcp dump command to watch the SNMP requests from the zabbix proxy is
1 |
|