This chapter assumes that the previous chapter covering
SNMP instrumentation of an active network application in Magician has been
read and understood. In this chapter, and throughout the rest of this tutorial,
we continue to add incremental features to our sample application known as
LoadGen. Recall from the previous chapter that we have instrumented two SNMP
Objects: the length of time the application has been running and the number
of packets transmitted.
Key Concept
- The goal of this chapter is to illustrate how Atropos can
be used to enhance our SNMP instrumented application. The key is essentially
one line of code in avnmp.java.lp.SnmpInterface (avnmp/java/lp/SnmpInterface.java)
in which the AppOid string is set to the SNMP Object Identifier of
the variable that we wish to enhance with Atropos capability shown in the
line below:
-
final static
String AppOid = new String(loadAppPackets.toString()+".0"); |
- Once this change is made and the Atropos package compiled,
predictions should appear in loadAppPackets.<milliseconds> where
<milliseconds> is an SNMP table index and is the
time at which the value is predicted to occur. However, in this version of
Atropos, the predicted values appear in:
final static
StringBuffer loadPredictionPredictedLoad = new StringBuffer(loadPredictionTable+".3");
final static StringBuffer loadPredictionPredictedTime
= new StringBuffer(loadPredictionTable+".4");
|
The only signficant change to the application from the program
classes developed in Chapter 5
is the removal of the SNMP Object Identifier variables from the application
to the Atropos SnmpInterface class.
Running the Active Application
After reading through this code and understanding what it does, you can compile
the code "as-is" using the included Makefile. Run in the Magician execution
environment by entering:
- send InjectSnmp AH-1
- send LoadGenAppBasic AH-1
- send Flood AH-1
- send AvnmpSmartDriver AH-1
The object identifiers created within the application and the predictions
generated by Atropos should now be queriable via an SNMP client.
|