![]() ![]() ![]() |
7.1 Overview
7.2 Starting MIB Browser
7.3 Using MIB Browser
7.4 Testing the Agent with SNMP Operations
7.5 Using Row Status
This section explains the various kinds of SNMP operations that can be performed on the Agent for Testing purposes. SNMP Operations include SNMP GET, GET-NEXT, SET, WALK, GET-BULK, and so on. Let us see in detail how these have to be used on the Agent. It is assumed that a v2c Agent is created using AGENT-SAMPLE-MIB following the steps given in Creating a Simple Agent using MIB Compiler section.
An SNMP Manager environment is created using the MIB Browser tool. Please follow the steps given below to start the MIB Browser application and configure the Manager settings.
To start this tool, use MIBBrowser.bat or .sh file in <Agent Toolkit Home>/bin directory.
Load the MIB e.g, AGENT-SAMPLE-MIB for which an SNMP Agent is created.
Click the Settings sub menu in the Edit menu bar.
A wizard opens up with a General Tab open.
Check the version, v2c (for our case).
And click OK.
The Manager's Port can be specified in the field given for Port in the MIB Browser main UI.
The WebNMS MIB Browser can be used for MIB browsing and to view and operate on data available through a SNMP agent. The MIB Browser can be configured in tune with performing the SNMP operations.
In order to configure the MIB Browser,
Click on the MIB Browser Settings button or
Select Edit-->Settings menu item or
Use a short cut of Alt + S
On performing any of the above action, a dialog box opens which is the MIB Browser settings frame that has three-tabbed panel. The three tabs are
General
Mib Settings
v3Settings
Now, let us have an overview on the configuration of the MIB Browser under various tabs.
This topic also covers Graphs and Debugging and Decoding of Messages.
7.3.1 Setting Common Parameters
The common parameters are set in the General tab of the MIB Browser Settings frame. The General field. The figure depicted below shows the General Settings in the MIB Browser.
The various protocol-related options to SNMP are listed in the table below.
Options | Default Values | Other Options |
---|---|---|
Snmp Version |
v1 |
v2c or v3 |
Time out |
5 sec |
any user defined value |
Retries |
0 |
any user defined value |
Encoding |
ISO8859_1 |
any encoding scheme that |
Max repetitions |
50 |
any user defined value |
Non-repeaters |
0 |
any user defined value |
|
Note:
|
The Validate Broadcast Address check box enables you to check the
validity of the broadcast address provided. You need to provide the Netmask
address to validate the broadcast address. A Netmask is a string of 0's
and 1's that hides the network part of the IP address and allows only
the host ID to remain.
In the v3 Options section, Context Name and the ContextID are to be
provided as additional parameters for an SNMPv3 request. An SNMP context
name is a collection of management information accessible by an SNMP entity.
An item of management information may exist in more than one context.
An SNMP entity potentially has access to many contexts. In other words,
if a management information has been defined under certain context by
an SNMPv3 entity, any management application can access that information
by giving that context name. The ContextID uniquely identifies an SNMP
entity that may recognize an instance of a context with a particular context
name within an administrative domain.
The next section is the v3Settings section. The following are the security-related
parameters for accessing the SNMPv3 agents. You can add, modify, and delete
users by clicking the Add, Modify, Delete buttons.
Options | Default Values | Other Options |
---|---|---|
User name |
null |
any user-defined value |
Security level |
noAuth noPriv |
Auth noPriv and Auth Priv |
Authentication Protocol |
MD5 (if authentication is |
SHA |
Privacy Protocol |
CBC-DES (if privacy is |
not available |
Authentication password |
any user defined value |
- |
Privacy password |
any user defined value |
- |
Target host |
localhost |
any host with SNMPV3 agent or proxy agent |
Target port |
161 |
any user-defined port |
If the security level is "NoAuthNoPriv",
no additional parameters are required. If the security level is "AuthNoPriv",
the parameters AuthProtocol and AuthPassword are be set. If the user security
level is "AuthPriv", the privacy password needs to be set in
addition to the other parameters.
The v3Settings section has an option for storing the v3 table entries.
The v3 table entries can be stored in:
A serialized file
A database
Storing table entries in a serialized file
To enable serialization of v3 table entries, select the Save v3 Settings to File option. If this option is selected, the user information is stored in the serialized files namely UserEntry.ser and EngineEntry.ser. When MIB Browser is invoked the next time, the serialized files are de-serialized and the v3 table is updated. The advantage of storing table entries in serialized files is that the operation is faster.
Storing table entries in a database
To store v3 table entries in a database, select the Save v3 Settings to Database option. To use this, the database connection has to be established. Clicking the "Database Settings" button displays the Database Parameters dialog box. The image of the dialog box that appears is given below.
Enter the necessary database parameters in
this dialog box, and click the OK button. If the database connection is
established successfully, all the user information entered is saved in
the database. When the MIB Browser is invoked the next time, v3 details
are restored and the v3 table is updated.
The advantages of storing v3 table entries in a database are:
Scalability - Any number of entries can be maintained in the database.
Accessibility - All the authenticated users of the database can access the entries.
The last section is the field entry section
in which the corresponding fields in the v3 table are displayed for data
entry. The various buttons available in the field entry section are the
Add, Modify, and Delete buttons.
To add an entry, enter the required parameters in the respective fields
and click the Add Entry button. Based on the parameters and the security
level, Discovery and Time Synchronization are done and USM Table is updated
and listed in the v3 table.
To modify an entry, select the entry in the v3 table, modify the required
fields, and click the Modify button. Time Synchronization is done and
the USM table is updated and listed in the v3 table.
|
Note: The NoAuthNoPriv entry cannot be modified. Only the password fields in the AuthNoPriv entry and AuthPriv entry can be modified. |
To delete an entry in the v3 table, select the entry in the v3 table and click the Delete button. The entry is removed from the USM table.
|
Note: The settings are saved only on exiting the MIB Browser application and not every time the settings are modified. The 'Save v3 Settings to File' option is enabled only in the MIB Browser application and not in the MIB Browser applet because of certain security restrictions in applets. |
The Mib Settings tab is focused on the loading of MIBs in MIB Browser. The image below displays the Mib Settings tab.
The first section gives the MIB loading options. The next section displays the various parsing levels.
7.3.2.1 MIB Loading Options
The various Options available for Loading the MIB are:
Load MIBs directly
Load MIBs From Compiled File
Load MIBs From Database
|
Note: "Load MIBs From Compiled File" is by default selected when a MIB Browser is used as an Application. In case of MIB Browser used as an Applet, the default option selected is "Load MIBs directly". |
7.3.2.1.1 Load MIBs directly
The MIB file is usually read and parsed into MIB modules and displayed in the MIB tree. In this case, when you load a MIB file, it is parsed and then loaded. This is time consuming because parsing is done every time a MIB file is loaded.
7.3.2.1.2 Load MIBs From Compiled Files
The next option is loading of the MIB files as compiled files. The main advantage here is that the loading time is reduced. This ultimately leads to the improvement in performance. To store the MIB information in a formatted structure, the following two new file types are made available.
cmi - This file type contains MIB information, such as MibNode, MibModule, naming hierarchy, etc.
ds - This file type contains the description and reference of the MIB nodes.
When the option Load MIBs from Compiled File
is selected, the MIB Browser loads the MIB from the cmi and cds files.
If these files are not present, MIB Browser parses the MIB file, writes
the output in the cmi and cds files, and loads the MIB file. For example,
if we load the RFC1213-MIB, the MIB file is parsed and stored in the compiled
MIB files as RFC1213-MIB.cmi and RFC1213-MIB.cds provided RFC1213-MIB
is the module name of the RFC1213-MIB file.
When this MIB file is loaded again, the MIB is loaded from the cmi and
cds files and no parsing is done. The advantage of using this option is,
we need not parse the MIB each time we load, thus optimizing the load
time and improving the performance. While loading the compiled MIBs, we
need to only load the cmi file. The cmi file has a reference to the cds
files. Therefore, the cds file need not be loaded directly.
|
Note: Any changes made to the MIB file after it has been loaded as a compiled MIB file, are not reflected when it is loaded again. You have to remove the existing cmi and cds files and load the MIB again to get the latest changes shown. To overcome this, select the option" Overwrite existing Compiled MIB Files" can be selected. If this option is set to true, the cmi and cds files are created each time the MIB is loaded. However, enabling this option is recommended only if you have changed the contents of the MIB file. Otherwise, this serves as a redundant option and increase the load time of the MIBs. |
7.3.2.1.3 Loading MIB's from database
The third option is loading of the MIB files
from a database. The MIB files can be stored in any RDBMS such as MySql
or Oracle. Applications can load these MIB files directly from the database.
This feature is particularly useful when the number of MIB files to be
loaded is high in number.
The MIB Browser uses JDBC (Java Database Connectivity) for the database
support. Applications should use a valid JDBC driver of the respective
databases to enable the database support.
Selecting the option Load MIBs from Database enables the text fields in
the JDBCParams section. On initializing the necessary database parameters
in this section, the database support can be provided for loading MIBs.
The various JDBCParams required are:
Drivername - Name of the Database driver.
URL - URL pointing to the Database file name
UserName - user name
Password - password
After selecting this loading option, select the required MIB file to be loaded from the Open tab of the Load a MIB File dialog box. If the selected MIB file is already present in the database, the MIB file is read, parsed, and loaded from the database. If the MIB file does not exist in the database, MIB Browser parses the MIB file, writes the output to the database and then loads the MIB file.
7.3.2.2 Parsing MIBs
MIB Browser enables you to parse the given MIB file and check for the macro constructs. It allows different levels of parsing and the parsing is done as per the standard definition of the macros. The parsing levels can be set in the MIB Browser Settings dialog box. The following tables describes the different levels of parsing that can be set and their corresponding checks.
S.No. | Level of Parsing | Checks | Description |
---|---|---|---|
1 |
Lenient |
No Checks |
This level accepts all types of MIB files. For example, it allows both SMIv1 and v2. |
2 |
Normal |
Default checks |
This level is the default level conforming to the obsolete standards, such as RFC 1902, RFC 1903, etc. Most MIBs follow the obsolete standard. |
3 |
Serious |
Most checks throw exceptions on first |
This level strictly follows the current standard. It accepts the constructs with interoperability and implementation problems. |
4 |
Critical |
All possible checks throw exceptions on first |
This level completely follows the SMIv1 and v2 standards. However, it does not accept the backward compatibility constructs, constructs with interoperability and implementation problems, etc. |
Applications, while loading MIB files, perform the following operations.
Parsing and validating the syntax of the MIB module
Constructing the MIB module into the tree structure
While performing the parsing and validation
of the MIB files, if the MIB modules fail to conform to the SMI standards
the loading will not be not done. However, the application requirements
might mandate the loading of the non-standard files. On the other hand,
some applications might require a stricter check on the compliance to
the standards.
The parsing and validating the syntax of the MIB file can be made configurable
to suit the application requirements. MIB Browser handles this by providing
parsing levels which facilitate to select the level of parsing required
by the applications.
In addition to the above four parsing levels, MIB Browser supports another
level, which is user-defined. In case of user-defined level, you can define
your own parsing level with the required checks at runtime
|
Note: It is recommended to use the higher parsing level (SERIOUS, CRITICAL) for validating the MIB file and not for loading the MIB file in the application. It affects the performance of the application while loading the MIB files, because it takes considerable amount of time and resources, such as memory, CPU usage, etc. |
User Defined Parsing Levels
In addition to the four parsing levels, you
also have another level, which is user-defined to define your own parsing
levels at runtime. To add a user-defined parsing level, select the User-Defined
option and click the Add button in the User-Defined Levels section. This
displays the Customized Level dialog box.
By default, all the checks are included. Provide a name for the level in
the Level Name text field. To add or remove checks from the level, select
or deselect the checks and click OK. Note that if you select (deselect)
a parent check, all its child checks are also selected (or deselected).
Click OK to add this level to the user-defined level list.
The level of the parser has to be set in the MibParser before loading a
MIB. This level, once set, is used for subsequent MIBs loaded. If the
level needs to be modified for the next set of MIBs loaded, it has to
be set again in the MIB Parser. In the Mib Settings tab of the MIB Browser
Settings dialog box, select the required Parsing level, and click Apply.
The MIB file can contain one or more MIB modules. MIB Browser loads all
the dependency files to resolve the MIB module. If the dependency file
is not present, the IMPORTS failed error is thrown.
The parsing level can be set for the dependency file by selecting the Import
File option and choosing Parsing Levels.
One of the vital feature of the Net MIB Browser
is the Graphs. The graphs depict the real-time plotting of the SNMP data.
Currently two types of graphs are supported - line graph and bar graph.
The SNMP data to be polled should be of integer or unsigned integer data
type. Typically the values that are plotted will be of type Counter, Gauge
or Timeticks.
Although the steps followed in invoking a graph and working on it is similar
to the line graph and bar graph, let us understand it better under the
following two sections:
Line Graph
Bar Graph
Line Graph
The line graph depicts the real-time plotting of the SNMP data. Follow
the steps below to invoke a line graph from the MIB Browser.
Specify the proper agent hostname or IP address in the host field of the MIB Browser.
Load the MIB in the MIB Browser.
Specify a valid variable. The variable must be an integer or unsigned integer (Counter, Gauge, Timeticks). This variable can be entered directly in the variable field or it can be chosen by browsing through the MIB in the Mib Tree.
Click on the 'View real-time graph' button in the toolbar (or) choose View-->Line Graph menu item from the Menu Bar (or) use a shortcut Alt+L. By default, the Line graph option is selected in the MIB Browser settings panel, hence the line graph would be invoked when you do any of these operations.
This would invoke the updated Line graph showing the results of periodically polling the specified agent for the specified OID.
The various options available in the line graph is tabulated below:
Options | Description |
---|---|
Polling Interval (sec's.) |
This specifies the polling interval time. The default value is 5 secs. You can change the interval time as desired. |
Average over Interval? |
Generally the actual values are plotted, selecting this option would take the average of the values. |
X-axis Scale (>300) |
This specifies the X-Axis scale. The default value is 300 secs and this is the minimum seconds. Changing this would alter the X-axis scale of the table. By default it is disabled, only on clicking 'Show polled values?' option the x-axis scale option is enabled. |
Show Absolute Time? |
By default the time is depicted in the graphs as only seconds. Selecting this option would give you the time in hours:Secs. |
Max Poll Duration (sec's) |
In order to see all the polled values in a particular time period, this option is used. This option by default it is disabled. Only on clicking 'Show polled values?' option this is enabled. the default value is 3600 secs. |
Show Polled Values? |
By default this option is disabled. When selected, all the polled values in a particular period of time is shown. Only on selecting this option the Max Poll Duration and Log FileName options are enabled. |
Log FileName |
The file name for the log file can be set here. By default the log file name is graph.txt. If the adjacent "Log Polled Values" is selected all the polled values are logged in this file. This option is not enabled when the MIB Browser is run as an applet, this is because of the security restrictions in case of applets. |
Log Polled Values? |
Selecting this option would log the polled values. This would enable the option Log FileName for the log file name to be set. |
Show Absolute Counters |
By default the graph plots only the difference between the two values. On selecting this the plotting of the absolute value is performed. |
Restart |
The restart button is used to restart the polling |
Stop |
The stop button is used to stop the polling |
Close |
The close button is used to close the graph window. |
Yet another way of invoking a graph is through
the Table options. The MIB Browser can plot multiple graphs showing values
for different variables from different hosts.
Bar Graph
The bar graph depicts the real-time plotting of the SNMP data. Follow the
steps below to invoke a bar graph from the MIB Browser which is similar
to invoking a line graph.
Specify the proper agent hostname or IP address in the host field of the MIB Browser.
Load the MIB in the MIB Browser.
Specify a valid variable. The variable must be an integer or unsigned integer (Counter, Gauge, Timeticks). This variable can be entered directly in the variable field or it can be chosen by browsing through the MIB in the Mib Tree. In case of a Scalar OID, the bar graph works fine by appending a .0 to it. When it is a Columnar OID, you need to append the index in order to enable the plotting of bar graph.
Click on the 'View real-time graph' button in the toolbar (or) choose View -->Bar Graph menu item from the Menu Bar (or) use a shortcut Alt+B. By default, the Line graph option is selected in the MIB Browser settings panel, hence the line graph would be invoked when you do any of these operations. If you need to invoke the Bar graph by default, then opt for the Bar Graph option in the Setting Common parameters in the MIB Browser Settings option.
This would invoke the updated Bar graph showing the results of periodically polling the specified agent for the specified OID.
|
Note: The bar graph does not have the option of plotting multiple variables in the graph. Therefore, in case of a columnar OID, you need to append the instance of the index in order to enable the plotting of Bar graph. For example, to plot a bar graph for the values of the first row of the columnar OID ifOperStatus (ifTable), you need to first select the node ifOperStatus. Then, in the Object ID text field, append ".1" with the OID and select View --> Bar Graph from the menu. This plots the value of the first row of the column ifOperStatus. |
The various options available in the bar graph is tabulated below:
Options | Description |
---|---|
Polling Interval (Sec.) |
This specifies the polling interval time. The default value is 5 secs. You can change the interval time as desired. |
Average over Interval? |
By default, the actual values are plotted, selecting this option would take the average of the values. |
Range |
Altering the range would change the X-axis scale of the table. The
default |
Show Absolute Time? |
By default the time is depicted in the graphs as only seconds. Selecting this option would give you the time in hours:Secs. |
Restart |
The restart button is used to restart the polling. |
Stop |
The Stop button is used to stop the polling |
Close |
The close button is used to close the bar graph window. |
The MIB Browser application provides facility to view the debug output of the SNMP operations.
Invoking the Debugging window
Click on the Debug icon in the toolbar (or) choose View-->Debug from the menu bar (or) use a shortcut of Alt+D. This would invoke the debug window.
As long as this window is opened, debugging is turned on, and debugging output is displayed in the debug window. When this window is closed the debugging is turned off. The image below depicts a Debug window.
The three icons in the debug window provide the following function:
Save MIB Browser Debug Results - Saves the debug information to a file
Print MIB Browser Debug Results - Prints the debug information to a file
Snmp Decoder - Switches to Decoder window.
Invoking the Decoder Window
To switch from the Debug window to the Decoder window, click on the Decoder icon. To switch from Decoder window to the Debug window click on the Debug icon.
The three icons in the debug window provide the following function:
Save MIB Browser Decoder Results - Saves the debug information to a file
Print MIB Browser Decoder Results - Prints the debug information to a file
Debug - Switches to Debug window
|
Note: The Save and Print options are available only when the MIB Browser is invoked as an application and not in an applet. This is because of security restrictions in case of applets. |
Performing the Decoding operation
The Snmp Decoder is used to decode the SNMP debug messages . The decoding can be done by two ways by using the
Copy-Paste option and
File option
The figure below depicts the Snmp Decoder.
Copy-Paste option (This method is applicable for both MIB Browser application and applet).
This option can be used for frequent debugging.
Copy the debug information whatever is displayed in the debug window
Click on the Snmp Decoder icon. This will switch to the decoder window.
Paste the debug message into the "Hex PDU" text area.
Click on the Decode button.
The decoded message will be displayed in the bottom panel of the decoder window.
File option (This method is applicable only for MIB Browser application because the saving and loading of debug information files is done only in applications and not in applets). This option can be used if the debug message was stored in a file and decoding has to be done.
Load the file which contains the debug information by clicking on the
Browse button in the Debug frame. (or) Enter the URL in the File
URL text field and click 'Enter' key.
This will display the decoded message in the bottom panel of the decoder window.
Important: You can select the entire PDU debug message displayed in the debugger window with all the strings and paste it in the Hex PDU text area or load it in the decoder. The decoder will decode all the PDU dumps leaving the informative strings. The limitation in this is that the two continuous PDUs should have a string delimiter as a new line in between them. A sample PDU is depicted below
30 26 02 01 00 04 06 70 75 62 6c 69 63 a0 19 02 01 04 02 01
00 02 01 00 30 0e 30 0c 06 08 2b 06 01 02 01 01 05 00 05 00
Packet from: 192.168.1.215 : 161
DATA:
30 2e 02 01 00 04 06 70 75 62 6c 69 63 a2 21 02 01 04 02 01
00 02 01 00 30 16 30 14 06 08 2b 06 01 02 01 01 05 00 04 08
4b 41 4e 4e 41 4e 4b 41
The highlighted strings will be the delimiter between the two continuous PDU dumps. In case there is no string delimiter as above, only the first PDU will be decoded properly and the remaining PDUs will not be decoded.
The three icons in the debug window provide the following function:
Save MIB Browser Debug Results - Saves the debug information to a file
Print MIB Browser Debug Results - Prints the debug information to a file
Snmp Decoder - Switches to Decoder window.
Invoking the Decoder Window
To switch from the Debug window to the Decoder window, click on the Decoder icon. To switch from Decoder window to the Debug window click on the Debug icon.
The three icons in the debug window provide the following function:
Save MIB Browser Decoder Results - Saves the debug information to a file
Print MIB Browser Decoder Results - Prints the debug information to a file
Debug - Switches to Debug window
|
Note: The Save and Print options are available only when the MIB Browser is invoked as an application and not in an applet. This is because of security restrictions in case of applets. |
7.4 Testing the Agent With SNMP Operations
An SNMP GET Request can be sent to the Agent to get the values of the variable. Requests can be sent either from MIB Browser UI or from Command line. To perform the testing,
From MIB Browser UI
Select agentDescr from the agentSystem group of AGENT-SAMPLE-MIB.
Click Operations -> GET menu.
The result with
the default value will be as :
Sent get request to localhost : 8001
agentDescr.0: ->agentDescr not initialized.
From Commandline
To send a GET Request from Command line, go to <Agent Toolkit Home>/examples/snmp/low_level_udpapps directory from the command prompt and use the following options.
sh run.sh snmpget -v v1 -d -c public -p 8001 localhost .1.3.6.1.4.1.2162.4.1.1.0 |
where,
sh run.sh or run indicates run.sh and run.bat options respectively. These options are used for running the Agent. Based on the OS, the batch or shell file is used.
snmpget indicates the SNMP GET Operation to be performed.
-v indicates the version in which the request is to be sent.
-d debugs the snmp messages.
-c indicates the community of the Agent.
-p indicates the port in which the Agent is running and
.1.3.6.1.4.1.2162.4.1.1 indicates the OID of agentDescr.
.0 indicates the instance for the scalar variable.
Similar steps have to be followed for testing a Table in the Agent.
An SNMP GET-NEXT request can be sent to the Agent to acquire the next OID of the selected variable. To perform the testing on a scalar variable,
From MIB Browser UI
Select agentDescr from the agentSystem group of AGENT-SAMPLE-MIB.
Add the instance value .0 to the OID in the Object ID field.
Click Operations -> GET NEXT menu.
The result with the
default value will be as :
Sent getnext request to localhost : 8001
agentSupportContact.0:-->agentSupportContact not initialized
From Commandline
To send a GET NEXT Request from Commandline, use the following options.
sh run.sh snmpgetnext -v v1 -d -c public -p 8001 localhost .1.3.6.1.4.1.2162.4.1.1.0 |
Please refer to SNMP GET for explanation of the Options used. Similar steps have to be followed for testing a Table in the Agent. Please specify the exact instance before sending a request to the Table. .0 instance is used only for Scalars.
An SNMP SET request can be sent to the Agent to SET a new value to the selected variable. To perform the testing on a Scalar variable,
From MIB Browser UI
Select agentDescr from the agentSystem group of AGENT-SAMPLE-MIB.
Give a value, say abc in the SET Value text-field.
Click Operations -> SET menu.
The result with the
new value will be as :
Sent set request to localhost : 8001
agentDescr.0:-->abc
To perform the testing on a Table,
Select adiskName from the agentDisk group of AGENT-SAMPLE-MIB.
Give a value, say abc in the SET Value text-field.
Click Operations -> SET menu.
The result with the
default value will be as :
Sent set request to localhost : 8001
adiskName.1:-->abc
Please note that the instance value .1 has to be given in the Object ID field toward the end of the adiskName ID. Since the Index type of adiskTable is Integer32 , .1 has been given as the instance value. It can be any integer value.
From Commandline
To send a SET Request to the scalar variable agentDescr from Commandline, use the following options.
sh run.sh snmpset -v v1 -d -c public -p 8001 localhost .1.3.6.1.4.1.2162.4.1.1.0 STRING 1 |
where,
.1.3.6.1.4.1.2162.4.1.1 indicates the OID of agentDescr.
.0 indicates the instance of the scalar variable.
STRING refers to the Syntax type of the Scalar node and
1 refers to the new value set for agentDescr.
To send a SET Request to the adiskName of adiskTable from Commandline, use the following options,
sh run.sh snmpset -v v1 -d -c public -p 8001 localhost .1.3.6.1.4.1.2162.4.2.1.1.2.1 STRING 25 |
Here, .1.3.6.1.4.1.2162.4.2.1.1.2.1 refers to the OID of adiskName, .1 refers to the instance OID of the table, STRING refers to the Syntax type of the column, and 25 refers to the new value to be set for the column.
The SNMP walk operation does a continuous get-next operation. It takes the oid of the starting node, performs a get-next and if there is no error in response, repeats the get-next operation for all the nodes right from the starting node specified until it encounters any error in response i.e., an End-of-MIB view error or a change in the starting node OID.
This operation is supported through command line and is similar to GET-NEXT operations. To perform the testing on a Scalar variable, follow the steps given below :
From Commandline
To send a WALK Request to a scalar group from Command line, use the following options.
sh run.sh snmpwalk -v v1 -d -c public -p 8001 localhost .1.3.6.1.4.1.2162.4.1 |
where,
1.3.6.1.4.1.2162.4.1 indicates the OID of agentSystem group.
To send a WALK Request to a Tabular group from Commandline, use the following options,
sh run.sh snmpset -v v1 -d -c public -p 8001 localhost .1.3.6.1.4.1.2162.4.2 |
where,
1.3.6.1.4.1.2162.4.2 indicates the OID of agentDisk.
Get Bulk operation is performed on the Agent to get the values from a group of variables. This operation is supported only on v2c and v3 Agents.
To perform the testing on a Scalar variable,
From MIB Browser UI
Go to Edit -> Settings menu -> General Tab of MIB Browser UI.
Change the Max-Repetitions value to 5, from 50.
Now, select agentSystem group of AGENT-SAMPLE-MIB.
Click Operations -> GETBULK menu.
The result with
the default values will be as :
Sent getbulk request to localhost : 8001
agentDescr.0:-->agentDescr not initialized
agentSupportContact.0:-->agentSupportContact not initialized
agentLocation.0:-->agentLocation not initialized
agentAvailMemory.0:-->agentAvailMemory not initialized
agentPlatformName.0:-->agentPlatformName not initialized
Please note that Maximum Repetitions and Non-Repeaters values need to be specified for a GET BULK operation. Based on this count, the query is done on the group. You can find these text-fields in Edit -> Settings menu -> General Tab of MIB Browser UI. GET BULK operation will not be successful if the Max-Repetitions and Time Out value do not synchronize with each other. To know more about these terms refer to the FAQs - > General section.
To perform the testing on a Table,
Select agentDisk group of AGENT-SAMPLE-MIB.
Click Operations -> GETBULK menu.
The result with the
default value will be as :
Sent getbulk request to localhost : 8001
adiskID.1:-->1
adiskName.1:-->1
adiskCapacity.1:-->1
adiskUsed.1:-->1
adiskFree.1:-->1
From Command line
To send a GET BULK Request to a scalar group from Command line, use the following options.
sh run.sh snmpbulk -v v2 -d -c public -p 8001 localhost .1.3.6.1.4.1.2162.4.1 0 5 |
where,
.1.3.6.1.4.1.2162.4.1.1 indicates the OID of agentDescr.
0 indicates the non-repeaters value
5 indicates the Max-Repetitions value.
To send a GET BULK Request to a Tabular variable (adiskTable) from Commandline, use the following options,
sh run.sh snmpbulk -v v2 -d -c public -p 8001 localhost .1.3.6.1.4.1.2162.4.2 0 5 |
Multi-varbind operation sends many requests containing varbinds in the same PDU, i.e. the manager can query the agent with more than one request at a time. The functioning of the operation is such that when multiple requests are sent by the manager, the agent will not process each request one after another, but groups all the varbinds under a parent OID as a single request before calling the instrumentation layer. This minimizes the number of requests processed by the agent and also increases the performance of the agent as the response time is minimal.
For example, add the nodes of scalar group and nodes of tabular group in AGENT-SAMPLE-MIB to the multi-varbind text field as shown below:
.iso.org.dod.internet.private.enterprises.adventnet.demo.agentSystem.agentDescr.0:
.iso.org.dod.internet.private.enterprises.adventnet.demo.agentSystem.agentLocation.0:
.iso.org.dod.internet.private.enterprises.adventnet.demo.agentSystem.agentAvailMemory.0:
.iso.org.dod.internet.private.enterprises.adventnet.demo.agentDisk.adiskTable.adiskEntry.adiskName.1:
.iso.org.dod.internet.private.enterprises.adventnet.demo.agentDisk.adiskTable.adiskEntry.adiskUsed.1:
Here the agent processes two requests for five varbinds send from the manager by grouping the scalar nodes of agentSystem as a request and tabular nodes of agentDisk as another.
To enable Multivarbind operation in MIB Browser UI,
Select View-> Display-> Multi-Varbind from the MIB Browser UI. A dialog or text field provided for Multivarbind requests opens in UI.
Check Multi-Var option.
Select a node, say agentDescr and click Add. Similarly add other varbinds.
Then do a GET/SET (for a SET you should have specified a value in the SET value text-field)/ GET-NEXT/ GET-BULK operation.
If there is a read-only variable, the SET operation will not be successful. Similarly GET-BULK will not be successful if the Max-Repetitions and Time Out value do not synchronize with each other.
7.4.6.1 Atomicity or MultiVarbind SET Requests
While processing a Multivarbind SET request, if the SET fails for any subsequent varbind, the previous successful SETs in the multivarbindare rolled back to the original values. This concept is known as Atomicity (Roll Back). This feature is handled within the "processSetRequest" of the XXXRequestHandler class and the Agent API.
Enabling Rollback Method
By default, Roll Back method is enabled in an Agent. When a Multivarbind SET request arrives from the Manager the processes carried out in an Agent are,
The Agent API first gets the existing values from the Instrument file and stores it temporarily.
Then it processes the Multivarbind Set Request and waits for the result.
If the Multivarbind SET request is successful, then the Agent's API discards the previous values and returns the values set as a response.
If the Multivarbind SET request fails, say, for the third varbind in a table having 5 columns, then an appropriate error message is returned for the failure occurred and all the values are restored with the previous values.
Also note, requests will not processed for the 4th and 5th varbind.
Disabling Rollback Method
This Rollback functionality method can also be disabled using the following piece of code in the "initSnmpExtensionNodes" method of the Generated Main File of the Agent,
hdlr.setRollBackEnabled(false); |
By stating false, this will remove the Rollback functionality with the Agent. As stated earlier, by default this functionality will remain "true" in the Agent.
If this functionality is disabled and the Multivarbind SET Request is successful, the Agent responds with the latest values sent by the Manager.
In case the Multivarbind Request is unsuccessful, then in that case, the varbinds for which the request is successful, would get SET with the latest values. Whereas the other varbinds remain with the old values. Further requests will not be processed as they are unsuccessful.
SNMP Operations also include Adding a Row and Deleting a Row from a Table using Row Status Textual Convention (v2c). To define Row Status, please refer to Defining a MIB section.
Different Levels in Row Status
The different levels supported by Row Status are: -
active (1) : The active status indicates that the conceptual row is available for use by the Managed device. A row can be added and deleted using this active status.
notInService (2) : The conceptual row that exists is "Not in service" as per this range.
notReady (3): This range indicates that the conceptual row exists but is not in an usable state by the managed device.
createAndGo (4) : As the name indicates, the conceptual row gets created on specifying this range from the management station and automatically becomes active, thus allowing to add any number of rows.
createAndWait (5): -Using this range will create a row from the Management station but would not be accessible by the managed device. The values can be set only if the row is made "active".
destroy(6): The conceptual row can be removed from a table by specifying the respective instance and making the status as "destroy".
Adding a Row
To add a new row to a Table from the Manager that particular Table should be an SNMPv2 Table having RowStatus column i.e., the MIB should be a V2 MIB supporting Row Status . A new row can be added to the Table using any of these three ways.
CreateAndWait (5).
CreateAndGo using Multiple-Varbind Set.
CreateAndGo using SNMP table UI.
CreateAndWait
In this method, the RowStatus column should be first SET with the value 5 (CreateAndWait). Then, the other column values should be added. Finally, the RowStatus column should be made "Active".
For example, in the aaplicationTable of Agent-Sample-MIB, the aaplicationTablestatus is the Row Status Column. To add a row (with index value 3) in this table,
Select aaplicationTablestatus and in the Object ID field add the table instance ".3" to the OID as follows .iso.org.dod.internet.private.enterprises.adventnet.demo.aapplications.aaplicationTable.aaplicationEntry.aaplicationTablestatus.3
and set the value with "5" (CreateandWait) in the Set value field.
Similarly, select aaplicationName and set the value for .3 instance as "MIB Editor".
Select aaplicationVersion and set the value for .3 instance as "5.0" in the Set value field.
Select aaplicationInstallDate and set the value for .3 instance as "2002" in the Set value field.
Select aaplicationTablestatus and set the value for .3 instance as "1" (Active) in the Set value field.
Thus, a new row is created in the aaplication table with the aaplicationID (index) value as 3.
CreateAndGo Using MultivarbindSet
Instead of sending multiple SET requests to the Agent, a new row can be created in a Table in a single SET method. For this, add some relevant values to the columns of a Table with the RowStatus column as "4" (CreateAndGo) using MultivarbindSET option. Check Multivarbind option available in Edit -> Settings menu of MIB Browser UI.
To explain it with an Example, take the aaplicationTable of Agent-Sample-MIB. The aaplicationTablestatus is the Row Status Column. To add a row (with index value 4) in this table,
Select aaplicationTablestatus. In the Object ID field add the instance for the Table OID as ".4". Then, set the value for .4 instance as "4" in the Set Value field.
In the right side bottom most part frame of MIB Browser UI, you can find the Multivar check box (after enabling it in MIB Browser settings). Check the MultiVar option and Add to list. This will add the RowStatus column with its value in the list.
Similarly, add the following columns to the list.
Select aaplicationName and in the Object ID field add the table instance ".4" to the OID. Then set the value for .4 instance as "MIB Browser". Later add it to the Multivarbind list.
Select aaplicationVersion and in the Object ID field add the table instance ".4" to the OID. Then set the value for .4 instance as "1.0". Later add it to the Multivarbind list.
Select aaplicationInstallDate and in the Object ID field add the table instance ".4" to the OID. Then set the value for .4 instance as "2002". Later add it to the Multivarbind list.
Now, do a single SET operation by which all the values are added to the Table. Thus a new row is created in the aaplication table with the aaplicationID (index) value as 4.
CreateAndGo using SNMP Table
A new row for a table can also be created using SNMP table User Interface (UI). On enabling the SNMP Table icon after selecting the appropriate table from the left side MIB tree a dialog box opens.
For example, in the aaplicationTable of the AGENT-SAMPLE-MIB, the column aaplicationTable status is the Row Status Column.
To add a row in this table, select the Table and choose SNMP Table from the View menu bar or from the toolbar icon.
Click Add button of the SNMP Table.
The Row Addition Editor pops up . Enter values for each column and press OK. Leave the RowStatus column to be the default one (4).
You can see the entry added to the Table by clicking the Start button.
Deleting a Row
By changing the Row Status value to 6 (Destroy) a row can be deleted from the MIB Browser UI itself. You can also delete an entry using the SNMP Table. By selecting the entry to be removed, changing the row status value to 6 and refreshing the table, the entry gets removed.
![]() ![]() ![]() |