Let’s look into other interfaces. Sometimes you will need to monitor something that doesn’t work with an agent: printer, router, etc. SNMP can help you with that.
First, you will need is to find the variable’s OID (Object Identifier) the numeric code that will help the server to request the specific things we will monitor.
To do so you can look it up in the device's manual or discover it with snmpwalk utility or use any MIB browser you like. For this article we will look into using snmpwalk.
snmpwalk
Let's look into getting OIDs with snmpwalk.
Install the SNMP package: you'll need to install the SNMP package. On Debian-based systems, you can install it with:
On Red Hat-based systems, you can use:
On Windows system, you can use the Net-SNMP package for Windows, which is available at Net-SNMP website (https://www.net-snmp.org/download.html).
Check the IP address or hostname of the device you want to query, as well as the SNMP version this device supports (usually SNMPv1 or SNMPv2c).
You'll also need to find out the SNMP community for the device. This works like a password that allows to access the SNMP data on this host. You should be able to find this in the device's documentation or configuration, the usual default option is ‘public’.
If you learned the OID you need from manual, run the snmpwalk command to check if everything's fine. The basic syntax for snmpwalk is the same on Windows as on Linux or Unix:
for example
Here, the OID .1.3.6.1.2.1.1.5.0 specifies the hostname, and the snmpwalk command will return the MIB name along with the current value and the variable type.
To discover an OID with snmpwalk you could run it without an OID or MIB name to search the one you interested in manually.
After finding out its name run the same command adding - On
Note that some variables have more than one port the last number in OID shows this port.
Hosts
Next, we will need to add a host with an SNMP interface configured and enter your device’s IP, SNMP version, and SNMP community. SNMP templates can be handy, but compatibility is not granted. Otherwise it’s a usual host creation.
Items
The only thing left is to create an SNMP item: Go to Configuration > Hosts and click on the device you want to monitor. Go to the Items tab and click on the "Create item" button. Fill in the necessary information: item name, type (for our example, SNMPv2 agent), information type, and OID. Fill the Key line with OID number.
Press test to see if it works.
Once everything is set up, you should start seeing data from the device in Zabbix. You can use Zabbix's graphs, triggers, and other features to monitor the device and be alerted if there are any issues.
Conclusion
We learned how to get the OIDs we need, and how to create SNMP hosts and items to monitor them with Zabbix.