After building the example as described in "MIB Development Process", launch the simple agent with the following command:
$ java -classpath classpath Agent |
You should see some initialization messages, including our notification listener giving information about the two table entries which are created. Then, you should see the agent sending out a trap every two seconds. Traps are covered in "Sending Traps", and we can ignore these messages. Access this agent's HTML adaptor by pointing a web browser to the following URL: http://localhost:8082/. Through the HTML adaptor, you can see the MBeans representing the MIB:
The class=RFC1213_MIB MBean in the snmp domain is the topmost MBean, it contains a name and information about the SNMP adaptor to which the MIB is bound
The RFC1213_MIB domain contains the MBeans for each group; these MBeans contain variables with values provided by our customizations
The ifTable domain contains the entries of the interface table
In any of these MBeans, you could write new values into the text fields of exposed attributes and click the "Apply" button. This will set the corresponding SNMP variable, and thereafter, SNMP managers will see the new value. This is an example of managing a MIB through a protocol other than SNMP.
For any SNMP agent application, you can turn on trace messages for the SNMP adaptor by specifying the -DINFO_ADAPTOR_SNMP property on the command line. The tracing mechanism is covered in the Java Dynamic Management Kit 4.0 Tools Reference guide and in the Javadoc API of the Trace class.
Type "Control-C" when you are done viewing the agent.