SNMP parameters
ZABBIX must be configured with SNMP support in order to be able to retrieve data provided
by SNMP agents.
The following steps have to be performed in order to add monitoring of SNMP parameters:
- Create a host for the SNMP device.
Enter an IP address and a port of 161. Set
the host Status to NOT MONITORED. You can use the host.SNMP template which would automatically
add set of items. However, the template may not be compatible with the host.
- Find out the SNMP string of the item you want to monitor
After creating the host, use 'snmpwalk'
(part of ucd-snmp/net-snmp software which you should have installed as part of the ZABBIX installation)
or equivalent tool:
shell> snmpwalk <host or host IP> public
This will give you a list of SNMP strings and their last value. If it doesn't then it is
possible that the SNMP 'community' is different to the standard public in which case you
will need to find out what it is. You would then go through the list until you find the
string you want to monitor, e.g. you wanted to monitor the bytes coming in to your switch on
port 3 you would use:
interfaces.ifTable.ifEntry.ifOctetsIn.3 = Counter 32: 614794138
You should now use the snmpget command to find the OID for interfaces.ifTable.ifEntry.ifInOctets.3:
shell> snmpget -On 10.62.1.22 interfaces.ifTable.ifEntry.ifOctetsIn.3
where the last number in the string is the port number you are looking to monitor. This
should give you something like the following:
.1.3.6.1.2.1.2.2.1.10.3 = Counter32: 614794138
again the last number in the OID is the port number.
3COM seem to use port numbers in the hundreds, e.g. port 1=port 101, port 3=port 103,
but Cisco use regular numbers, e.g. port 3=3
Create an item for monitoring.
So, now go back to ZABBIX and click on Items, selecting the SNMP host you created earlier.
Depending on whether you used a template or not when creating your host you will have either
a list of SNMP items associated with your host or just a new item box. We will work on the
assumption that you are going to create the item yourself using the information you have
just gathered using snmpwalk and snmpget, so enter a plain English description in the
'Description' field of the new item box. Make sure the 'Host' field has your switch/router
in it and change the 'Type' field to "SNMPv1 agent" (I had difficulty with SNMPv2 agent so I
don't use it). Enter the community (usually public) and enter the numeric OID that you
retrieved earlier in to the 'SNMP OID' field being sure to include the leading dot, i.e.
.1.3.6.1.2.1.2.2.1.10.3
Enter the 'SNMP port' as 161 and the 'Key' as something meaningful, e.g. SNMP-InOctets-Bps.
Choose the Multiplier if you want one and enter an 'update interval' and 'keep history' if
you want it to be different from the default. Set the 'Status' to MONITORED, the 'Type of
information' to NUMERIC and the 'Store value' to DELTA (important otherwise you will get
cumulative values from the SNMP device instead of the latest change).
Now ADD the item and go back to the hosts area of Zabbix. From here set the SNMP device to
be MONITORED and check in LATEST VALUES for your SNMP data!
Example:
Community: public
Oid: 1.2.3.45.6.7.8.0 (or .1.2.3.45.6.7.8.0)
Key: <Unique string to be used as reference to triggers>
Note that OID can be given in either numeric or string form. However, in some cases, string OID must be converted
to numeric representation. Utility snmpget may be used for this purpose:
shell> snmpget -On localhost public enterprises.ucdavis.memory.memTotalSwap.0
Monitoring of SNMP parameters is possible if either -with-net-snmp or -with-ucd-snmp flag was specified while
configuring ZABBIX sources.
|