Zabbix Documentation 2.0

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


manual:config:items:itemtypes:snmp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

manual:config:items:itemtypes:snmp [2018/05/15 12:49]
manual:config:items:itemtypes:snmp [2015/11/12 05:29] (current)
martins-v specifying 'delta'
Line 1: Line 1:
 +==== - #2 SNMP agent ====
  
 +=== Overview ===
 +
 +You may want to use SNMP monitoring on devices such as printers, network switches, routers or UPS that usually are SNMP-enabled and on which it would be impractical to attempt setting up complete operating systems and Zabbix agents.
 +
 +To be able to retrieve data provided by SNMP agents on these devices, Zabbix server must be [[manual:​installation:​install#​configure_the_sources|initially configured]] with SNMP support.
 +
 +SNMP checks are performed over the UDP protocol only.
 +
 +<note warning>​If monitoring SNMPv3 devices, make sure that msgAuthoritativeEngineID (also known as snmpEngineID or "​Engine ID") is never shared by two devices. According to [[http://​www.ietf.org/​rfc/​rfc2571.txt|RFC 2571]] (section 3.1.1.1) it must be unique for each device.</​note>​
 +
 +<​note>​For SNMPv3 privacy and authentication currently MD5 and DES protocols are supported.</​note>​
 +
 +=== Configuring SNMP monitoring ===
 +
 +To start monitoring a device through SNMP, the following steps have to be performed:
 +
 +== Step 1 ==
 +
 +[[manual:​config:​hosts:​host|Create a host]] for the device with an SNMP interface.
 +
 +Enter the IP address. Set the host status to NOT MONITORED. You can use one of the provided SNMP templates (//Template SNMP Device// and others) that will automatically add a set of items. However, the template may not be compatible with the host.
 +
 +<note tip>SNMP checks do not use //Agent port//, it is ignored.</​note>​
 +
 +== Step 2 ==
 +
 +Find out the SNMP string (or OID) of the item you want to monitor.
 +
 +To get a list of SNMP strings, use the **snmpwalk** command (part of [[http://​www.net-snmp.org/​|ucd-snmp/​net-snmp]] software which you should have installed as part of the Zabbix installation) or equivalent tool:
 +
 +  shell> snmpwalk -v 2c -c public <host IP> .
 +
 +As '​2c'​ here stands for SNMP version, you may also substitute it with '​1',​ to indicate SNMP Version 1 on the device. ​
 +
 +This should 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 from the standard '​public'​ in which case you will need to find out what it is. 
 +
 +You can then go through the list until you find the string you want to monitor, e.g. if you wanted to monitor the bytes coming in to your switch on port 3 you would use the ''​IF-MIB::​ifInOctets.3''​ string from this line:
 +
 +  IF-MIB::​ifInOctets.3 = Counter32: 3409739121
 +
 +You may now use the **snmpget** command to find out the numeric OID for '​IF-MIB::​ifInOctets.3':​
 +
 +  shell> snmpget -v 2c -c public -On 10.62.1.22 IF-MIB::​ifInOctets.3
 +
 +Note that the last number in the string is the port number you are looking to monitor. See also: [[manual:​config:​items:​itemtypes:​snmp:​dynamicindex|Dynamic indexes]].
 +
 +This should give you something like the following:
 +
 +  .1.3.6.1.2.1.2.2.1.10.3 = Counter32: 3472126941
 +
 +Again, the last number in the OID is the port number.
 +
 +<​note>​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.</​note>​
 +
 +<note tip>Some of the most used SNMP OIDs are [[manual:​config:​items:​itemtypes:​snmp:​special_mibs|translated automatically to a numeric representation]] by Zabbix.</​note>​
 +
 +== Step 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 "​SNMPv* agent"​. Enter the community (usually public) and enter the textual or numeric OID that you retrieved earlier into the 'SNMP OID' field, for example: .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 a 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 (float)// and the 'Store value' to  //Delta (speed per second)// (important otherwise you will get cumulative values from the SNMP device instead of the latest change).
 +
 +Now save the item and go back to the hosts area of Zabbix. From here change the SNMP device status to '​Monitored'​ and check in //Latest data// for your SNMP data!
 +
 +== Example 1 ==
 +
 +General example:
 +
 +^Parameter^Description^
 +|**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>​\\ For example, "​my_param"​. ​ | 
 +
 +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 <​nowiki>​--with-net-snmp</​nowiki>​ or <​nowiki>​--with-ucd-snmp</​nowiki>​ flag was specified while configuring Zabbix sources.
 +
 +== Example 2 ==
 +
 +Monitoring of uptime:
 +
 +^Parameter^Description^
 +|**Community** ​ |public ​  |
 +|**Oid** ​ |MIB::​sysUpTime.0 ​ |
 +|**Key** ​ |router.uptime ​ |
 +|**Value type** ​ |Float ​ |
 +|**Units** ​ |uptime ​ |
 +|**Multiplier** ​ |0.01  |