Westhawk SNMP Stack in Oracle ™ 8i.

This note explains and gives examples how to use the Westhawk SNMP stack to send SNMPv2 traps in an Oracle JServer environment. Due to the unusual threading model (actually threads don't work at all :-) a dedicated set of classes has to be used to avoid starting threads that are difficult to kill in JServer.

The stack has been amended to send (i.e. not receive!) traps in an Oracle JServer environment for SNMP v1 and v2c. It will probably not be possible to do more in Oracle.

Running the stack in Oracle requires sufficient knowledge of Oracle, Java, SNMP and our stack.

Environment

The example runs in the following environment:

We run the trap example using XSQL using

However, the later are not necessary for the traps to work!

The Oscar Example

The directory uk/co/westhawk/nothread/oscar contains the Oscar example. This example is a proof-of-principle example that has nothing to do with the stack. The Oscar class has one static String method

public static String quote()
{
    return "I can resist everything except temptation.";
}

The example creates a stored function in PL/SQL with the call spec for the method and then calls the example using SQL. The example uses the scott schema. This schema is used in most of Oracle's examples and is usually created during Oracle's installation time.

The Trap Example

The directory uk/co/westhawk/nothread/trap contains the Trap example. The idea is that every time a row is inserted in the (newly defined) scott.trap table, a SNMPv2 trap is sent, using the SendTrap.doSendTrap() java method. The field in the table represent the trap parameters.

To use the stack for sending traps in SNMPv2 without creating threads, use the classes

Similar classes are available for SNMPv1.

All the necessary files are jarred in a cut-down version of the stack; snmpOracle<no>.jar, where no is the stack version number, like 4_12.

The example uses the scott schema. This schema is used in most of Oracle's examples and is usually created during Oracle's installation time.

Resolving the jar file (see loadTrapExample.sh) resulted in a lot of complains about running out of shared pool memory, so the shared pool size was enlarged.

Running the example can be done in two ways; via the runTrapExample.sh script or via XSQL. The later is much more fun, but requires Oracle's XSQL to work.


$Revision: 1.2 $, $Date: 2002/10/22 16:49:24 $

Contact the snmp group at Westhawk Ltd