By the time you're reading this, your summer vacation may have ended! It's not all bad, today I'll show you one of my earliest task when I interned as a network engineer. Which was to configure networking equipment to be monitored by Zabbix using SNMP.

As you may be aware networking devices like my trusty Cisco 2960 switch and 3821 router have very limited memory and cannot have the Zabbix agent installed. SNMP is the preferred vehicle when it comes to monitoring these devices.

Prepare the Switch

If you have a brand new switch with a blank configuration file, follow the steps below. Otherwise you can skip below to the SNMP setup section.

  1. Create a VLAN.

Connect to your switch and change into configuration mode by typing in conf t and then pressing enter.

my-switch-01(config)#interface Vlan99
my-switch-01(config)#description MGMT
my-switch-01(config)#ip address 192.168.1.200 255.255.255.0
my-switch-01(config)#no ip route-cache

2. Assign a physical interface to the new vlan.

my-switch-01(config)#switchport access vlan 99

3. Verify everything is up and doing fine. You will see an output similar to mine below.

my-switch-01(config)#show ip int br

Interface              IP-Address      OK? Method Status                Protocol
Vlan1                  unassigned      YES NVRAM  administratively down down
Vlan99                 192.168.1.200   YES NVRAM  up                    up
FastEthernet0/1        unassigned      YES unset  down                  down
FastEthernet0/2        unassigned      YES unset  down                  down
FastEthernet0/3        unassigned      YES unset  down                  down
GigabitEthernet0/1     unassigned      YES unset  up                    up

Configuring SNMP

  1. Go back into config mode and create the community string.
my-switch-01(config)#snmp-server community my-switch-01 RO

Notice the RO at the end? That stands for Read-Only. When this is in place no one can make changes to the switch via SNMP.  If you do want to make changes using SNMP you can use RW (Read-Write) instead.

2. Add the location into the community string.

my-switch-01(config)#snmp-server location bos

3. Next add a contact.

my-switch-01(config)#snmp-server contact pafable

4. Save the new configs.

my-switch-01(config)#do wr mem
Building configuration...
[OK]

Monitoring with Zabbix

  1. Log into Zabbix and navigate to "Configuration" > "Hosts". Then click on "Create host".

2. In the page that opens; enter the hostname and put it into the correct group - Templates/Network Devices. Under SNMP interfaces, select "SNMP interfaces" and fill in the IP address of the switch.

3. Go into the macros tab. In here fill in the macro {$SNMP_COMMUNITY} with the hostname of your switch in the value.

Click on "Add" or "Update" on the bottom of your screen to create or update the host.

4. Verify the data is now being sent to Zabbix. Navigate to Monitoring > Latest data, filter the hosts to only show data from your switch. Your data may take a while to populate into Zabbix, but once it is complete you will see the following like below.

5. Another thing to check are the graphs. Navigate to Monitoring > Graphs and select your switch in the Host dropdown. Here you can visually inspect interface, CPU, and memory utilization.

Fantastic that is all you need to monitor networking equipment using SNMP and Zabbix!

The next steps from here is setting up custom triggers by default Zabbix already has triggers for networking equipment from the default templates. However you are more than free to create your own.