Developers guide
33
The AdventNet package is clearly of the highest quality. Feature rich, and backed by
comprehensive documentation. However, the Masterswitch SNMP implementation will only
require a basic set of SNMP operations, all supported by the open source packages.
Of the open source alternatives, the JSNMP package was chosen primarily for its superior
documentation, support and activity within the SNMP community. Also, the AgentAPI is used to
parse the APC PowerNet MIB, [ 28 ].
A brief overview of the SNMP protocol is given in Appendix D.
4.3.2 Configuration
• Enable SNMP on the Masterswitch
This is achieved though the HTTP interface to the APT Management Interface board.
Mistral (150.203.153.2) is given read/write access and added to the list of hosts to send
SNMP traps.
• Mistral’s firewall settings must be configured to allow access to UDP ports 161,162. This is
achieved using the ipchains Linux firewalling utility.
4.3.3 SNMP messages
Control of the Masterswitch outlets is achieved by GETs and SETs of the two OID’s
i
shown below:
• sPDUOutletName
String label for the Outlet (Max 20 characters)
• sPDUOutletCtl
outletOn (1)
outletOff (2)
outletReboot (3)
outletUnknown (4)
outletOnWithDelay (5)
outletOffWithDelay (6)
outletRebootWithDelay (7)
Detailed documentation on the outlet behaviour for each of these values
is documented in
[ 27 ] and [ 28 ], and available through the apt.masterswitch API JavaDocs.
Figure 4-3 Masterswitch OIDs
On initialisation, the POWERNET.MIB [ 28 ] is parsed and loaded into memory using the AgentAPI.
The OIDs shown in Figure 4-3 must be converted to a String of ‘.’ delimited integers denoting their
location in the MIB tree before they can be inserted into a PDU
ii
. This value is obtained by calling
mibModule.getNode(“sPDUOutletName”).getOID().toJavaValue().
For example, the OID sPDUOutletName is equivalent to:
“.iso.org.dod.internet.private.enterprises.apc.products.hardware.masterswitch.
sPDUOutletConfig.sPDUOutletConfigTable.sPDUOutletConfigEntry.sPDUOutletName”
i
Object Identifiers, see Appendix D, SNMP overview
ii
Protocol Data Unit, see Appendix D, SNMP overview










