• No results found

Using SNMPv2c Protocol

6 Specify SNMP Protocol Parameters

6.2 Using SNMPv2c Protocol

To use the SNMPv2c protocol, specify the following parameters in the SNMP Protocol Preferences dialog box:

1. Click the SNMPv2c radio button in the SNMP Protocol Version frame (Figure 29).

Figure 29: Specifying SNMPv2c protocol preferences

2. In the Read community drop-down list in the General frame, specify the Read community string (e.g., public). This parameter is used only with SNMP Get, SNMP GetNext and SNMP GetBulk requests.

3. In the Set community drop-down list, specify the Set community string (e.g., private). This parameter is used only with SNMP Set requests.

4. Into the Timeout [s] input line, enter the timeout value for pending SNMP requests.

5. Into the Retransmits input line enter the number of retransmits for pending SNMP requests.

6. In the Port number drop-down list, specify the SNMP port number to which the remote SNMP agent listens.

7. If you want to use the SNMP GetBulk operation when querying SNMP agents, check the Use Get-Bulk checkbox (Figure 29).

8. Into the Non repeaters input line, enter the number of non-repeaters and into the Max repetitions input line, the maximum number of returned instances in the SNMP GetBulk packet.

The Non-repeaters value is the number of variable bindings, counted from the beginning of the list of variable bindings (e.g., in the Multiple Variable Bindings window), for which only one instance is returned in the Response to the SNMP GetBulk packet.

The Max-repetitions value is the maximum number of instances that are in lexicographical order returned for each variable binding remaining in the list. 'Variable bindings remaining in the list' are in this case variable bindings that do not fall into the category of Non-repeaters and for which more than one instance is returned (the maximum number of returned instances is defined with the Max-repetitions value).

For illustration see the usage example.

Note: When you use the SNMP GetBulk operation in the main window, the 'non-repeaters' value has to be set to zero (0). Otherwise the program returns only one instance regardless of the 'max-repetitions' value.

9. To save the current settings in the SNMP Protocol Preferences dialog box and the agent address specified in the Remote SNMP agent drop-down list in the main window as an SNMP agent profile, check the Add to agent profiles checkbox.

10. Click the OK button to close the SNMP Protocol Preferences dialog box and apply the changes. If the Add to agent profiles checkbox was checked, a new SNMP agent profile, named “New - <agent address>”, is created in the SNMP Agent Profiles window.

Example:

How to correctly specify the 'non-repeaters' and 'max-repetitions' parameters and use the SNMP GetBulk operation to return multiple instances of objects?

The SNMP GetBulk operation is an optimization of the SNMP GetNext operation that allows SNMP agents to return large packets in response to GetBulk requests. SNMP GetBulk packets have two fields in request PDU, the non-repeaters and the max-repetitions fields, which are not found in any other SNMP PDU (Get, GetNext, Set).

In MIB Browser, you can specify the number of non-repeaters and max-repetitions in the SNMP Protocol Preferences dialog box (View SNMP Protocol Preferences command) after checking the Use Get-Bulk checkbox (Figure 29).

SNMP GetBulk operation in MIB Browser's main window:

To perform the SNMP GetBulk operation in the main window, you have to set the 'non-repeaters' value in the SNMP Protocol Preferences dialog box to zero (0). Otherwise the program returns only one object instance with its value because the use of non-repeaters makes sense only with multiple variable binding PDUs. You can set the 'max-repetitions' parameter to any value in order to determine the maximum number of object instances returned in one SNMP GetBulk packet. If you, for example, set it to 8, the program will return eight instances with corresponding values that in lexicographical order follow the instance of the object selected in the MIB tree.

Figure 30: Multiple object instances with corresponding values returned in SNMP GetBulk packet To perform the SNMP Get Bulk operation in the main window, click a node in the MIB tree (e.g., sysDescr) from which you wish to perform the SNMP Walk operation. When you have selected the node, use the SNMP Get Bulk command. MIB Browser will perform the SNMP Walk operation from the selected node and in lexicographical order return the specified number (defined with 'max-repetitions') of object instances with values (Figure 30).

SNMP GetBulk operation in the Multiple Variable Bindings window:

Using the ‘non-repeaters’ parameter makes sense only with multiple variable binding PDUs. You can create such PDU by making a list of variable bindings in the Multiple Variable Bindings window (opened with the SNMP Multiple Variable Bindings command).

You can make a list of variable bindings in the MVB window by dragging the objects from the MIB tree displayed in the main window (for instructions see the Making Multiple Variable Bindings List section). For example, you can make a list of three scalar objects (e.g., from the system sub tree) and two columnar objects (e.g., from the ifTable table), as shown in Figure 31. In the SNMP Protocol Preferences dialog box, set the 'non-repeaters' parameters to the value that corresponds to the number of scalar objects in the list. Set the value of 'max-repetitions' to the maximum number of instances (e.g., 4) that you wish to retrieve in lexicographical order for the remaining two columnar objects.

Figure 31: A list of variable bindings in the Multiple Variable Bindings window A set of parameters for the SNMP GetBulk operation:

Non-repeaters: 3 Max-repetitions: 4

Number of variable bindings in the list: 5 (3 scalar and 2 columnar objects)

After you have set all parameters, click in the Multiple Variable Bindings window toolbar the arrow next to the programmable button for SNMP operations. Select the Get Bulk operation from the list and then click the Get Bulk button. MIB Browser sends the SNMP GetBulk request PDU with the list of variable bindings to the SNMP agent. For the first three variable bindings in the list, it retrieves only one object instance with the corresponding value, where as for each of the remaining two variables it returns four object instances with their values (Figure 32).

Figure 32: Object instances and their values returned in response to SNMP GetBulk request with multiple variable bindings