|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log4j.ext.JoeSNMPTrapSender
This class makes use of the JoeSNMP library to implement the underlying SNMP protocol(s). The JoeSNMP library is a part of the OpenNMS project, and is available/distributed under the GNU Lesser General Public License (LGPL).
To quote the JoeSNMP FAQ:
"What license is JoeSNMP released under?
JoeSNMP is released under the GNU Lesser General Public License (LGPL),
documented fully at http://www.fsf.org/copyleft/lesser.html.
Effectively, this means that JoeSNMP is free to distribute and modify as
long as you provide your modified code back to the community. And if
you'd like to use JoeSNMP as a library within your commercial product,
you are welcome to do so as well, but again, any changes to the
library itself need to be contributed back."
You can get more information about OpenNMS here. You can get a copy of JoeSNMP here.
You will need a copy of the library ("joesnmp-0.2.6.jar" at a minimum) to use
and/or compile this class.
WARNING: The JoeSNMP library requires a minimum of JDK 1.2.
Constructor Summary | |
JoeSNMPTrapSender()
Default constructor. |
Method Summary | |
void |
addTrapMessageVariable(java.lang.String applicationTrapOIDValue,
java.lang.String value)
Adds a new Varbind to the SNMP PDU. |
void |
initialize(java.lang.String managementHostValue,
int managementHostTrapListenPortValue,
java.lang.String enterpriseOIDValue,
java.lang.String localIPAddressValue,
int localTrapSendPortValue,
int genericTrapTypeValue,
int specificTrapTypeValue,
java.lang.String communityStringValue,
long sysUpTimeValue)
This method is called to set the values of all of the class fields used as parameters to the underlying SNMP API. |
void |
sendTrap()
Sends the PDU defined by the variables of the fields of this class. |
void |
snmpReceivedTrap(org.opennms.protocols.snmp.SnmpTrapSession parm1,
java.net.InetAddress parm2,
int parm3,
org.opennms.protocols.snmp.SnmpOctetString parm4,
org.opennms.protocols.snmp.SnmpPduPacket parm5)
Skeleton method, implemented only to satisfy the requirements of the JoeSNMP API. |
void |
snmpReceivedTrap(org.opennms.protocols.snmp.SnmpTrapSession parm1,
java.net.InetAddress parm2,
int parm3,
org.opennms.protocols.snmp.SnmpOctetString parm4,
org.opennms.protocols.snmp.SnmpPduTrap parm5)
Skeleton method, implemented only to satisfy the requirements of the JoeSNMP API. |
void |
snmpTrapSessionError(org.opennms.protocols.snmp.SnmpTrapSession parm1,
int parm2,
java.lang.Object parm3)
Skeleton method, implemented only to satisfy the requirements of the JoeSNMP API. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JoeSNMPTrapSender()
Method Detail |
public void snmpReceivedTrap(org.opennms.protocols.snmp.SnmpTrapSession parm1, java.net.InetAddress parm2, int parm3, org.opennms.protocols.snmp.SnmpOctetString parm4, org.opennms.protocols.snmp.SnmpPduPacket parm5)
snmpReceivedTrap
in interface org.opennms.protocols.snmp.SnmpTrapHandler
public void snmpReceivedTrap(org.opennms.protocols.snmp.SnmpTrapSession parm1, java.net.InetAddress parm2, int parm3, org.opennms.protocols.snmp.SnmpOctetString parm4, org.opennms.protocols.snmp.SnmpPduTrap parm5)
snmpReceivedTrap
in interface org.opennms.protocols.snmp.SnmpTrapHandler
public void snmpTrapSessionError(org.opennms.protocols.snmp.SnmpTrapSession parm1, int parm2, java.lang.Object parm3)
snmpTrapSessionError
in interface org.opennms.protocols.snmp.SnmpTrapHandler
public void initialize(java.lang.String managementHostValue, int managementHostTrapListenPortValue, java.lang.String enterpriseOIDValue, java.lang.String localIPAddressValue, int localTrapSendPortValue, int genericTrapTypeValue, int specificTrapTypeValue, java.lang.String communityStringValue, long sysUpTimeValue)
initialize
in interface SnmpTrapSenderFacade
managementHostValue
- - the numeric IP address of the host
to which traps should be sent, e.g. "10.255.255.1". The default is
"127.0.0.1", the local loopback address.
managementHostTrapListenPortValue
- - any valid TCP/IP port
number. This is the port that the host specified in the
"managementHostValue" variable will listen on for SNMP traps. The
default is 162.
enterpriseOIDValue
- - formatted as an OID
E.g. "1.3.6.1.2.1.1.2.0" -- this OID would point to the standard
sysObjectID of the "systemName" node of the standard "system" MIB.
localIPAddressValue
- - an IP address, as a String, in
numeric, dotted decimal format. E.g. "10.255.255.2". This is the IP
address of the host that is using this appender to send SNMP traps.
This address will be encoded in the SNMP PDU, and used to provide
things like the "agent"'s IP address.
localTrapSendPortValue
- - the port that should be used on the
local host by the appender to send the trap. Default is 161.
genericTrapTypeValue
- - generic trap type for this SNMP PDU.
One of the following values (from the SNMP standard):specificTrapTypeValue
- - any value within the range defined
for an INTEGER in the ASN.1/BER notation; i.e. -128 to 127.
communityStringValue
- - E.g. "public". This is the
default, if none is provided.
sysUpTimeValue
- - this is meant to be the amount of time, in
seconds, elapsed since the last re-start or re-initialization of the
calling application. Of course, to set this, your application needs
to keep track of the value. The default is 0, if none is provided.public void addTrapMessageVariable(java.lang.String applicationTrapOIDValue, java.lang.String value)
SnmpTrapSenderFacade
addTrapMessageVariable
in interface SnmpTrapSenderFacade
applicationTrapOIDValue
- - formatted as an OID
E.g. "1.3.6.1.2.1.1.2.0.0.0.0" -- this OID would point to the standard
sysObjectID of the "systemName" node of the standard "system" MIB.
value
- - the text to append to the Varbind that will be added to
the SNMP PDU.public void sendTrap()
SnmpTrapSenderFacade
sendTrap
in interface SnmpTrapSenderFacade
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |