Setup SNMP Hosts in Zabbix
Video Lecture
Description
In this next few lectures we will look at SNMP
SNMP stands for Simple Network Management Protocol.
Common devices that support SNMP are routers, switches, printers, servers, workstations and other devices found on IP networks.
Not every network device supports SNMP, or has it enabled, and there is a good chance you don't have an SNMP enabled device available that you can use in this lecture.
So, in this next few lectures, I will demonstrate setting up SNMP on several different operating systems and also on a Cisco switch.
We will set up Zabbix to query using OIDs first. We will manually create a few sample SNMP items. Then demonstrate setup and querying with MIB descriptions. MIB stands for Management Information Base. And then use LLD to discover new SNMP devices and automatically configure them in Zabbix. And also automatically create templates for a device from the available SNMP responses.
So,
I SSH onto a server, I will use my new Grafana server, which is an Ubuntu 18, and then I install the SNMP daemon.
1 |
|
I then configure it and set the agent address and the community mycommunity
1 |
|
1 2 3 4 5 6 |
|
The SNMP agent by default is only accessible by localhost. I have changed it to be accessible remotely, so I also add a firewall rule to block all IPs other than my Zabbix server.
1 2 3 4 |
|
Warning
iptables settings will be lost in case of system reboot. You will need to reapply them manually,
or
install iptables-persistent
1 |
|
This will save your settings into two files called,
/etc/iptables/rules.v4
/etc/iptables/rules.v6
Any changes you make to the iptables configuration won't be auto saved to these persistent files, so if you want to update these files with any changes, then use the commands,
iptables-save > /etc/iptables/rules.v4
iptables-save > /etc/iptables/rules.v6
I then SSH onto my Zabbix Server,
1 |
|
I can now query my grafana server using snmpwalk
1 |
|
See the video on how I then setup the host configuration in Zabbix.
In the video, I also set up SNMPD on the Centos 7 VM.
To install SNMPD on centos 7,
1 2 |
|
See the video for how I configure the /etc/snmp/snmpd.conf file.
On the Centos 7 VM, I also needed to allow connections for UPD 161.
1 2 3 |
|