ODT Export
 

SNMP Items with ZABBIX

Devices

Other devices may be found in the templates section of the wiki.

Example with System Uptime

  1. Create a New Host Item
  2. Add an Item for the Host (System Uptime as an example)
    • Description: server1.example.org (I use DNS names for description YMMV)
    • Type: SNMPv1 agent
    • SNMP community: public
    • SNMP OID: 1.3.6.1.2.1.25.1.1.0
    • SNMP port: 161
    • Key: hrSystemUptime.0 (or any other unique value for this item - I use the SNMP name
    • Type of information: Numeric Integer (64bit)
    • Units: s
    • Use multiplier || Custom multiplier: .01
    • Status: Active
    • Store value: As is
  3. Save the Item
  4. Go back to the host and set it's state to “Monitored”

Using data from an snmpwalk

This script here can be used to import data (prior 1.4) into the database or (>=1.4) to generate a xml-importfile.

General Howto

To find the values or exact names of what you would like to monitor:

root@host:~# snmpwalk vpn.openforce.com -v1 -c public|grep -i ifinoctet
IF-MIB::ifInOctets.1 = Counter32: 2216
IF-MIB::ifInOctets.2 = Counter32: 2909800100
IF-MIB::ifInOctets.3 = Counter32: 0
IF-MIB::ifInOctets.4 = Counter32: 948093493
IF-MIB::ifInOctets.5 = Counter32: 252207088
IF-MIB::ifInOctets.6 = Counter32: 0
IF-MIB::ifInOctets.7 = Counter32: 0
IF-MIB::ifInOctets.8 = Counter32: 0
IF-MIB::ifInOctets.9 = Counter32: 0
IF-MIB::ifInOctets.10 = Counter32: 0
IF-MIB::ifInOctets.11 = Counter32: 0
IF-MIB::ifInOctets.12 = Counter32: 0
IF-MIB::ifInOctets.13 = Counter32: 0
IF-MIB::ifInOctets.14 = Counter32: 0
IF-MIB::ifInOctets.15 = Counter32: 0
IF-MIB::ifInOctets.16 = Counter32: 0
IF-MIB::ifInOctets.17 = Counter32: 0
IF-MIB::ifInOctets.18 = Counter32: 0
IF-MIB::ifInOctets.19 = Counter32: 0
IF-MIB::ifInOctets.20 = Counter32: 0
IF-MIB::ifInOctets.21 = Counter32: 258005245

To find the OID of the item you want to get:

root@host:~# snmpget -v1 -c public -On vpn.openforce.com ifInOctets.1
.1.3.6.1.2.1.2.2.1.10.1 = Counter32: 2216

Other Values

Incoming Network Traffic

Situation:

  1. We want to monitor the incoming an outgoing traffic on outgoing traffic on our gateway.
  2. We now that the interface of interest is eth0.
  3. We have no idea what the OID could be, but we have some common sense

Solution:

  • Find the OID of the value we want
root@linz:~# snmpwalk vpn.openforce.com -v1 -c public|grep -i eth0
IF-MIB::ifDescr.2 = STRING: eth0
HOST-RESOURCES-MIB::hrDeviceDescr.1026 = STRING: network interface eth0
HOST-RESOURCES-MIB::hrSWRunParameters.20742 = STRING: "-q eth0"
IF-MIB::ifName.2 = STRING: eth0
  • Now we guess that it has to be some OID with “if” let's try “in” and “out” to get the traffic
  • We guess that the ”.2” at the end has to be the identifier of “eth0” inside our interesting OIDs
snmpwalk vpn.openforce.com -v1 -c public|egrep -i 'if(in|out)'|less
  • this gives us items like
  • Create an item in ZABBIX
IF-MIB::ifInOctets.1 = Counter32: 2216
IF-MIB::ifInOctets.2 = Counter32: 2916915107
IF-MIB::ifInOctets.3 = Counter32: 0
IF-MIB::ifInOctets.4 = Counter32: 949315672
IF-MIB::ifInOctets.5 = Counter32: 252207088
IF-MIB::ifInOctets.6 = Counter32: 0
IF-MIB::ifInOctets.7 = Counter32: 0
IF-MIB::ifInOctets.8 = Counter32: 0
  • Aha “ifInOctets” and “ifOutOctets” with the “identifier” of 2 could be what we want
    • We still want it to be nicely formatted in ZABBIX
  • Let's get the numeric OID
root@host:~# snmpget -v1 -c public -On vpn.openforce.com ifInOctets.2
.1.3.6.1.2.1.2.2.1.10.2 = Counter32: 2917893876
root@host:~# snmpget -v1 -c public -On vpn.openforce.com ifOutOctets.2
.1.3.6.1.2.1.2.2.1.16.2 = Counter32: 735038193
  • Create an Item
    • Description: server1.example.org (I use DNS names for description YMMV)
    • Type: SNMPv1 agent
    • SNMP community: public
    • SNMP OID: 1.3.6.1.2.1.2.2.1.10.2
    • SNMP port: 161
    • Key: ifInOctets.eth0 (or any other unique value for this item - I use the SNMP name
    • Type of information: Numeric Integer (64bit)
    • Units: bps # bits per second - refer to the ZABBIX Manual and forums for more units
    • Use multiplier || Custom multiplier: 8 # it's octets so let's try 8 ;) - someone please explain this :)
    • Status: Active
    • Store value: Delta Speed per second # Traffic is at most times defined to be just a growing value, we want to see what happens not Gigabyte counting
  • Create the same for the Outgoing traffic
 
howto/monitor/snmp/snmp.txt · Last modified: 2009/08/24 16:46 by richlv
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki