Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Description

type

The type of action you want to perform. Actually you can enter here poll or trap. The value poll will instruct the endpoint to poll a given host for the supplied OID keys. If you put in trap you will setup a listener for SNMP Trap Events.

address

This is the IP address and the port of the host to poll or where to setup the Trap Receiver. Example: 127.0.0.1:162

protocol

Here you can select which protocol to use. By default it will be udp protocol but you may want to use tcp as well

retries

Defines how often a retry is made before canceling the request. (Default: 2)

timeout

Sets the timeout value for the request in millis. (Default: 1500)

snmpVersion

Sets the snmp version for the request. (Default: 0 which means SNMPv1)

snmpCommunity

Sets the community octet string for the snmp request. (Default: public)

delay

Defines the delay in seconds between to poll cycles. (Default: 60)

oids

Defines which values you are interested in. Please have a look at the Wikipedia to get a better understanding. You may provide a single OID or a coma separated list of OIDs. Example: oids="1.3.6.1.2.1.1.3.0,1.3.6.1.2.1.25.3.2.1.5.1,1.3.6.1.2.1.25.3.5.1.1.1,1.3.6.1.2.1.43.5.1.1.11.1"

The result of a poll

Given the situation, that I poll for the following OIDs:

Code Block
langjava
titleoids

1.3.6.1.2.1.1.3.0
1.3.6.1.2.1.25.3.2.1.5.1
1.3.6.1.2.1.25.3.5.1.1.1
1.3.6.1.2.1.43.5.1.1.11.1

The result will be the following:

Code Block
langxml
titleResult of toString conversion

<?xml version="1.0" encoding="UTF-8"?>
<snmp>
  <entry>
    <oid>1.3.6.1.2.1.1.3.0</oid>
    <value>6 days, 21:14:28.00</value>
  </entry>
  <entry>
    <oid>1.3.6.1.2.1.25.3.2.1.5.1</oid>
    <value>2</value>
  </entry>
  <entry>
    <oid>1.3.6.1.2.1.25.3.5.1.1.1</oid>
    <value>3</value>
  </entry>
  <entry>
    <oid>1.3.6.1.2.1.43.5.1.1.11.1</oid>
    <value>6</value>
  </entry>
  <entry>
    <oid>1.3.6.1.2.1.1.1.0</oid>
    <value>My Very Special Printer Of Brand Unknown</value>
  </entry>
</snmp>

As you maybe recognized there is one more result than requested....1.3.6.1.2.1.1.1.0.
This one is filled in by the device automatically in this special case. So it may absolutely happen, that you receive more than you requested...be prepared.

Examples

Polling a remote device:

...