best monitoring tools_how_to_monitor_cisco switch or router with snmp template

Zabbix: Monitor Cisco Switch or Router with SNMP template

Would you like to learn how to monitor Cisco Switch or Router with free and open-source monitoring software called Zabbix?

Well then, you are in the right place, because in this tutorial I will show you how you can setup network monitoring (Cisco switch / router) on Zabbix in just a couple of minutes!

Zabbix is not limited only to network monitoring, it can monitor virtually anything: Linux and Windows servers, VMware environment, websites, databases, docker containers, and more. Learn more about Zabbix on the official website.

Picture showing user dashboard on Zabbix monitoring software
Picture showing user dashboard on Zabbix monitoring software

We will configure Zabbix to monitor network traffic (bandwidth), CPU utilization, power supply and serial numbers on Cisco switches and routers that use classic IOS (like Cisco Catalyst 3650, 3750, 3850, 2960, 2950, 2801, 2911 or routers 1841, 1921, etc.).

Keep in mind that you can also use this tutorial for montioring routers that use IOS-XR (like CRS series, 12000 series, and ASR9000 series, etc.) or Nexus switches (like series 7000, 9000, etc. )

Why this guide? My friend asked me to help him with Zabbix. He needed to monitor Cisco routers and switches. I was like: “Why me? There are zillion tutorials online for that!”. He replied: “But there is no guide for total beginners with zero Linux experience”.

And he was right! It can be hard to find the right tutorial for network monitoring that will guide you from scratch.

So without further ado let’s get started!

We will setup network monitoring on Zabbix and monitor Cisco switch and router with SNMP protocol (Don’t know what is SNMP protocol? Learn step by step: MIB, OID, Agent, Manager).

Step 1: Configure SNMP on the Cisco Switch or Router

Configure SNMPv2c on Cisco routers and switches with one command as shown below:

switch> enable
switch# configure terminal
switch(config)# snmp-server community MyCommunity RO
switch(config)# exit
switch# copy running-config startup-config

That will cover most Cisco devices, but if you need to use SNMPv3 or configure Nexus or ASA firewall then read this short tutorial.

My favorite tool for testing SNMP is Net-SNMP. On Ubuntu/Debian you can install Net-SNMP tools with one simple command: “apt-get install snmp“,  or if you have CentOS/RHEL you can use “yum install net-snmp net-snmp-utils“.

Run the following Net-SNMP command from Linux machine to verify that SNMP is working as configured on the device:

snmpwalk -v2c -c MyCommunity 192.168.1.1 1.3.6.1.2.1.1.1
iso.3.6.1.2.1.1.1.0 = STRING: "Cisco IOS Software, Catalyst 4500 L3 Switch Software (cat4500-ENTSERVICESK9-M), Version 12.2(54)SG1, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Thu 27-Jan-11 11:39 "

If your snmpwalk fails, then make sure that the network or local firewall on the device is not blocking UDP port 161.

Need more examples for Net-SNMP tool usage? Check out my post about snmpwalk / snmpget examples.

Step 2: Install Zabbix monitoring system

You can install Zabbix in 10 minutes. Depending on your operating system (OS) preferences you can follow CentOS/RHEL, Ubuntu, Debian, Raspberry Pi (Rasbian) tutorial.

Step 3: Change global SNMP community string for all devices

Zabbix needs SNMP community string to retrieve data from SNMP enabled devices. A community string is like a password. Global SNMP community string in Zabbix is “public” and if you are using something else than you need to change it.

You can change community string for all devices by changing value for macro “{$SNMP_COMMUNITY}” under Administration→General→Macros just as shown in the picture below.

Picture showing how to change global macro {$SNMP_COMMUNITY} on Zabbix
Picture showing how to change global macro {$SNMP_COMMUNITY} on Zabbix

Step 4: Create hostgroup for Network devices

You can add a host to some existing hostgroup or you can create new hostgroups for your devices. I will create hostgroup “Devices/Network“:

Picture showing how to create hostgroup on Zabbix
Picture showing how to create hostgroup on Zabbix

WELL DONE!
SNMP is enabled on the device and Zabbix is ready for monitoring. Now it’s time to add that device to Zabbix.

Step 5: Add host to Zabbix with appropriate SNMP template

Go to “Host” menu under “Configuration” tab and then click “Create host” option to create a host in Zabbix:

Picture showing how to add Cisco Switch or Router to Zabbix monitoring system  - Step 1
Picture showing how to add Cisco Switch or Router to Zabbix monitoring system – Step 1

Define “Hostname” and set “Groups” using your newly created hostgroup. Then remove “Agent interfaces” (because we can’t use Zabbix agent on router or switch) and add “SNMP interfaces“:

Picture showing how to add Cisco Switch or Router to Zabbix monitoring system  - Step 2
Picture showing how to add Cisco Switch or Router to Zabbix monitoring system – Step 2

Under the “SNMP interfaces” set the management IP address or DNS name of the device:

Picture showing how to add Cisco Switch or Router to Zabbix monitoring system  - Step 3
Picture showing how to add Cisco Switch or Router to Zabbix monitoring system – Step 3

Then switch to tab “Templates” and choose the appropriate template for your Cisco device under section “Link new template” by typing “net cisco”. Use “Template Net Cisco IOS SNMPv2” if you are not sure what to choose:

Picture showing how to add Cisco Switch or Router to Zabbix monitoring system  - Step 4
Picture showing how to add Cisco Switch or Router to Zabbix monitoring system – Step 4

After you have selected appropriate template click little “Add” button to link the template with the device and then press the big “Add” button:

Picture showing how to add Cisco Switch or Router to Zabbix monitoring system  - Step 5
Picture showing how to add Cisco Switch or Router to Zabbix monitoring system – Step 5

CONGRATULATIONS!
You have successfully configured network monitoring (Cisco router and switch) on Zabbix!
No need to change anything else as other steps are optional.

CONTINUE TO LEARN MORE:
How to use Clone option? Changing community string per host. Force instant data collection. Configure screen with graphs for every host…

Step 6: Tips and tricks (optional)

This step is optional, but I strongly recommend the tips and tricks from this section, as they will ease your host administration in Zabbix.

Use Clone option

After you have added your first device you can add other similar devices very fast by using “Clone” option. Clicking on “Clone” will retain all host parameters and template linkage (don’t use “Full clone” option because it will retain directly attached entities: applications, items, triggers, graphs, low-level discovery rules, and web scenarios).

Steps for clonning are very simple. Find the host that you want to clone with the “Search” option:

Picture showing how to clone a host in Zabbix - Step 1
Picture showing how to clone a host in Zabbix – Step 1

Click on the “Clone” option, then change the “Host name” and “IP address” and add a new host by pressing “Add” button:

Picture showing how to clone a host in Zabbix - Step 2
Picture showing how to clone a host in Zabbix – Step 2

Use “Check now” to force instant data collection

It will take some time before Zabbix discovers components (interfaces, power supply, serial number, etc.) on the newly added device. Usually, it takes around 1 hour, but if you are impatient you can speed things up by using the “Check now” option.

Find the host that you want to force an instant check with “Search” option and click on “Discovery“:

Picture showing how to instantly check all the items and LLD discoverys on Zabbix host - Step 1
Picture showing how to instantly check all the items and LLD discoverys on Zabbix host – Step 1

Select all discoveries and click “Check now”:

Picture showing how to instantly check all the items and LLD discoverys on Zabbix host - Step 2
Picture showing how to instantly check all the items and LLD discoverys on Zabbix host – Step 2

Items have faster polling intervals (around 1 minute) so there is no need to use “Check now” on them. However, you can force instant check even for them. Move to “Items” sections and do the same: select all items (ignore “SNMP trap” and “Zabbix Trapper” item types) and click “Check now“:

Picture showing how to instantly check all the items and LLD discoverys on Zabbix host - Step 3
Picture showing how to instantly check all the items and LLD discoverys on Zabbix host – Step 3

Change SNMP community string per host

What if one device has a different SNMP community string and – for some reason – you can’t change it on the device? No problem, you can set different SNMP community on any host in Zabbix.

Find the host that that is using different SNMP community with the “Search” option:

Picture showing how to change the SNMP community string only for one host - Step 1
Picture showing how to change the SNMP community string only for one host – Step 1

Under host configuration select “Macros” and change tab to “Inherited and host macros“. Click “Change” on macro “{$SNMP_COMMUNITY}” and enter your new community string. Hit the “Update” button after changing the SNMP community.

Picture showing how to change the SNMP community string only for one host - Step 2
Picture showing how to change the SNMP community string only for one host – Step 2

Configure screen with graphs for every host

Default Zabbix template “Template Module Interfaces SNMPv2” for monitoring network interface traffic is not bad, but it needs lots of improvement. Checking graphs on a host by selecting one by one is just painful and awkwardly implemented.

I will show you how can you configure that default template to show all the graphs that some host has on one screen (check out the last screenshoot under this chapter)

Template Module Interfaces SNMPv2” is linked with all SNMP templates, including the Cisco template that we used in this tutorial so you will only need to do this change once.

Go to “Configuration“→”Templates“, enter in name filter “Template Module Interfaces SNMPv2“, click “Apply” and select “Screens”.

Picture showing how to configure screen on hosts using template - Step 1
Picture showing how to configure screen on hosts using template – Step 1

Click on “Create screen“, define the “Name” for screen, set “Columns” to 2 and “Rows” to 100 and click “Add” button.

Picture showing how to configure screen on hosts using template - Step 2
Picture showing how to configure screen on hosts using template – Step 2

Configure graphs on the screen by selecting “Constructor” option.

Picture showing how to configure screen on hosts using template - Step 3
Picture showing how to configure screen on hosts using template – Step 3

Click on “Change” in the first row.

Picture showing how to configure screen on hosts using template - Step 4
Picture showing how to configure screen on hosts using template – Step 4

Choose “Graph prototype” from dropdown menu “Resource“; select “Network traffic” protypegraph for “Graph protoype“; set 2 for “Max columns”, 600 for “Width”, 140 for “Height”, 2 for “Column span” and 1 for “Row span”.

Picture showing how to configure screen on hosts using template - Step 5
Picture showing how to configure screen on hosts using template – Step 5

That’s it! Now you can view graphs in one place.

Picture showing how to view graphs on host using screen - Step 1
Picture showing how to view graphs on host using screen – Step 1
Picture showing how to view graphs on host using screen - Step 2
Picture showing how to view graphs on host using screen – Step 2


Thank you for reading.

Now, that you have your routers and switches monitored, you can try out Zabbix interactive topology maps!

create zabbix network maps_step by step tutorial with examples

Also, you can setup Zabbix email notifications and escalations in a few minutes

setup zabbix mail alerts and escalations
Scroll Up