Configure Zabbix SNMP monitoring for network devices with automated discovery and templates

Intermediate 45 min Apr 02, 2026 342 views
Ubuntu 24.04 Debian 12 AlmaLinux 9 Rocky Linux 9

Set up comprehensive SNMP monitoring for network devices using Zabbix with automated discovery rules, custom templates, and intelligent alerting. Learn to monitor switches, routers, and other network equipment with performance triggers and detailed reporting.

Prerequisites

  • Zabbix server installed and configured
  • Network devices with SNMP support
  • Administrative access to network equipment
  • Basic understanding of SNMP protocol

What this solves

SNMP (Simple Network Management Protocol) monitoring allows you to track network device performance, interface utilization, and hardware status from a centralized Zabbix server. This tutorial shows you how to configure SNMP on network devices, set up Zabbix for automated device discovery, and create monitoring templates with intelligent triggers for comprehensive network infrastructure monitoring.

Step-by-step configuration

Install SNMP utilities on Zabbix server

Install the required SNMP packages to enable communication with network devices.

sudo apt update
sudo apt install -y snmp snmp-mibs-downloader
sudo dnf install -y net-snmp net-snmp-utils

Configure SNMP MIBs

Enable MIB translation for human-readable SNMP output and better monitoring visibility.

# Comment out the mibs line to enable MIB loading

mibs :

Add community string configuration

defaultcommunity public

Set SNMP version preferences

defaultversion 2c

Test SNMP connectivity

Verify that your Zabbix server can communicate with network devices using SNMP.

snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.2.1.1.1.0
snmpget -v2c -c public 192.168.1.1 1.3.6.1.2.1.1.5.0

Configure network device SNMP (Cisco example)

Enable SNMP on your network devices with appropriate community strings and access controls.

configure terminal
snmp-server community monitoring RO
snmp-server community zabbix RO 10
snmp-server location "Data Center Rack 42"
snmp-server contact "admin@example.com"
snmp-server enable traps snmp linkdown linkup
snmp-server host 192.168.1.100 version 2c monitoring
exit
write memory

Create SNMP access control list

Restrict SNMP access to your monitoring servers for enhanced security.

configure terminal
access-list 10 permit 192.168.1.100
access-list 10 permit 192.168.1.0 0.0.0.255
access-list 10 deny any log
snmp-server community monitoring RO 10
exit
write memory

Configure Zabbix network discovery rule

Set up automated discovery to find and monitor network devices automatically.

mysql -u zabbix -p zabbix << 'EOF'
INSERT INTO drules (druleid, proxy_hostid, name, iprange, delay, nextcheck, status, error, error_from, templateid) 
VALUES (1, NULL, 'Network Discovery', '192.168.1.1-254', '3600', 0, 0, '', 0, NULL);

INSERT INTO dchecks (dcheckid, druleid, type, key_, snmp_community, ports, snmpv3_securityname, snmpv3_securitylevel, snmpv3_authpassphrase, snmpv3_privpassphrase, uniq, snmpv3_authprotocol, snmpv3_privprotocol, snmpv3_contextname) 
VALUES (1, 1, 11, '1.3.6.1.2.1.1.1.0', 'public', '161', '', 0, '', '', 0, 0, 0, '');
EOF

Create network device template

Build a comprehensive template for monitoring network device performance and status.



    6.0
    
        
    

Import template through Zabbix web interface

Import the network device template into Zabbix for use with discovered devices.

curl -X POST http://localhost/zabbix/api_jsonrpc.php \
-H "Content-Type: application/json" \
-d '{
    "jsonrpc": "2.0",
    "method": "user.login",
    "params": {
        "user": "Admin",
        "password": "zabbix"
    },
    "id": 1
}' | jq -r '.result'

Configure discovery actions

Set up automatic actions to link discovered devices with the network template.

INSERT INTO actions (actionid, name, eventsource, evaltype, status, esc_period, def_shortdata, def_longdata, r_shortdata, r_longdata, formula, maintenance_mode, filter) 
VALUES (1, 'Auto-add network devices', 1, 0, 0, '1h', 'Device discovered: {HOST.NAME}', 'Device {HOST.NAME} has been discovered at {HOST.IP}', '', '', '', 1, '');

INSERT INTO operations (operationid, actionid, operationtype, esc_period, esc_step_from, esc_step_to, evaltype) 
VALUES (1, 1, 2, 0, 1, 1, 0);

INSERT INTO optemplate (optemplateid, operationid, templateid) 
VALUES (1, 1, (SELECT templateid FROM hosts WHERE host = 'Network Device SNMP'));

Create performance triggers

Set up intelligent triggers to alert on network performance issues and device problems.

INSERT INTO triggers (triggerid, expression, description, priority, status, comments, error, templateid, type, state, flags) 
VALUES 
(1, '{Network Device SNMP:system.uptime.last()}<600', 'Device {HOST.NAME} restarted', 2, 0, 'Trigger when device uptime is less than 10 minutes', '', NULL, 0, 0, 0),
(2, '{Network Device SNMP:net.if.in.packets[{#SNMPINDEX}].avg(5m)}>10000', 'High inbound traffic on {HOST.NAME} interface {#SNMPVALUE}', 1, 0, 'Trigger when interface receives more than 10k packets/sec for 5 minutes', '', NULL, 0, 0, 2),
(3, '{Network Device SNMP:net.if.out.packets[{#SNMPINDEX}].avg(5m)}>10000', 'High outbound traffic on {HOST.NAME} interface {#SNMPVALUE}', 1, 0, 'Trigger when interface sends more than 10k packets/sec for 5 minutes', '', NULL, 0, 0, 2);

Configure SNMPv3 for enhanced security

Implement SNMPv3 with authentication and encryption for production environments.

configure terminal
snmp-server group MONITORING v3 auth read READONLY
snmp-server user zabbixuser MONITORING v3 auth sha AuthPass123 priv aes 128 PrivPass123
snmp-server view READONLY internet included
snmp-server view READONLY system included
snmp-server view READONLY interfaces included
exit
write memory

Test SNMPv3 connectivity

Verify SNMPv3 authentication and encryption are working correctly.

snmpwalk -v3 -u zabbixuser -l authPriv -a SHA -A AuthPass123 -x AES -X PrivPass123 192.168.1.1 1.3.6.1.2.1.1.1.0

snmpget -v3 -u zabbixuser -l authPriv -a SHA -A AuthPass123 -x AES -X PrivPass123 192.168.1.1 1.3.6.1.2.1.1.5.0

Enable Zabbix server SNMP processing

Configure Zabbix server to handle SNMP monitoring efficiently with proper process allocation.

StartSNMPTrapper=1
SNMPTrapperFile=/var/log/snmptrapd.log
StartPollers=10
StartPollersUnreachable=5
StartTrappers=5
CacheSize=64M
HistoryCacheSize=32M
HistoryIndexCacheSize=8M
TrendCacheSize=8M

Restart Zabbix services

Apply the configuration changes by restarting the Zabbix server and agent processes.

sudo systemctl restart zabbix-server
sudo systemctl restart zabbix-agent
sudo systemctl status zabbix-server

Configure SNMP trap handling

Install SNMP trap daemon

Set up snmptrapd to receive and process SNMP traps from network devices.

sudo apt install -y snmptrapd
sudo dnf install -y net-snmp-perl

Configure SNMP trap daemon

Set up snmptrapd to log traps for Zabbix processing and configure authentication.

authCommunity log,execute,net public
disableAuthorization yes
logOption s 7
outputOption A
format2 %02.2h:%02.2j %B [%b]: %N %W %q %P %t %v\n

Start SNMP trap daemon

Enable and start the snmptrapd service to begin receiving network device traps.

sudo systemctl enable --now snmptrapd
sudo systemctl status snmptrapd
sudo tail -f /var/log/snmptrapd.log

Verify your setup

sudo systemctl status zabbix-server
sudo systemctl status snmptrapd

Test SNMP connectivity to a device

snmpwalk -v2c -c public 192.168.1.1 1.3.6.1.2.1.1

Check Zabbix server logs for SNMP activity

sudo tail -f /var/log/zabbix/zabbix_server.log | grep -i snmp

Verify network discovery is running

zabbix_get -s localhost -k "system.localtime"
Note: Replace 192.168.1.1 with your actual network device IP address and ensure the SNMP community string matches your device configuration.

Common issues

SymptomCauseFix
SNMP timeout errorsFirewall blocking UDP 161sudo ufw allow from 192.168.1.0/24 to any port 161 proto udp
No data from devicesIncorrect community stringVerify community string matches device configuration
Discovery not finding devicesIP range too narrowExpand IP range in discovery rule configuration
MIB resolution errorsMissing MIB filessudo download-mibs and uncomment mibs line in /etc/snmp/snmp.conf
SNMPv3 authentication failsPassword or encryption mismatchVerify auth/priv passwords match on both device and Zabbix
Template not applyingDiscovery action misconfiguredCheck Configuration → Actions → Discovery actions in Zabbix web interface
Security Warning: Always use SNMPv3 with authentication and encryption in production environments. SNMPv1 and SNMPv2c transmit community strings in plain text.

Next steps

Automated install script

Run this to automate the entire setup

Need help?

Don't want to manage this yourself?

We handle managed devops services for businesses that depend on uptime. From initial setup to ongoing operations.