文件名称:SNMP_DEMO
- 所属分类:
- JSP源码/Java
- 资源属性:
- [Java] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 301kb
- 下载次数:
- 0次
- 提 供 者:
- wayso*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
本程序很简单总共涉及到三个类,分别是Receiver (Trap接收者), Sender (Trap发送者), Startup(启动类)。
Receiver会实例化Snmp,并设定好IP,端口及监听程序,之后调用listen方法开始接收Trap。这边main方法最后会起一个用户线程,是为了让接收程序一直处于运行状态。
Sender会实例化Snmp,并实例化CommunityTarget类,这个类描述了发送目标的IP,端口等信息。然后实例化一个PDU类,里面设定了OID和变量值,最后通过Snmp对象调用send方法来实现Trap的发送。这里程序会发10个Trap作为测试。
Startup用来启动整个测试程序,它会先调Receiver.main,再调Sender.main。
-This procedure is very simple involving a total of three categories, namely Receiver (Trap receiver), Sender (Trap sender), Startup (start class). Receiver will be instantiated Snmp, and set the IP, port and the listener, and then call the listen method to start receiving Trap. Here will play a main method of the last user thread is to allow the receiving program has been running. Sender will be instantiated Snmp, and instantiate CommunityTarget class that describes the transmission target IP, port and other information. PDU and then instantiate a class, which set the OID and variable values, and finally call the send method of the object through Snmp Trap sending to achieve. This program will send 10 Trap as a test. Startup to start the test program, it will be transferred Receiver.main, and then transferred Sender.main.
Receiver会实例化Snmp,并设定好IP,端口及监听程序,之后调用listen方法开始接收Trap。这边main方法最后会起一个用户线程,是为了让接收程序一直处于运行状态。
Sender会实例化Snmp,并实例化CommunityTarget类,这个类描述了发送目标的IP,端口等信息。然后实例化一个PDU类,里面设定了OID和变量值,最后通过Snmp对象调用send方法来实现Trap的发送。这里程序会发10个Trap作为测试。
Startup用来启动整个测试程序,它会先调Receiver.main,再调Sender.main。
-This procedure is very simple involving a total of three categories, namely Receiver (Trap receiver), Sender (Trap sender), Startup (start class). Receiver will be instantiated Snmp, and set the IP, port and the listener, and then call the listen method to start receiving Trap. Here will play a main method of the last user thread is to allow the receiving program has been running. Sender will be instantiated Snmp, and instantiate CommunityTarget class that describes the transmission target IP, port and other information. PDU and then instantiate a class, which set the OID and variable values, and finally call the send method of the object through Snmp Trap sending to achieve. This program will send 10 Trap as a test. Startup to start the test program, it will be transferred Receiver.main, and then transferred Sender.main.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lib\SNMP4J.jar
src\com\broada\demo\snmp\Receiver.java
...\...\......\....\....\Sender.java
...\...\......\....\....\Startup.java
.classpath
.project
classes\com\broada\demo\snmp\Receiver$1.class
.......\...\......\....\....\Receiver$2.class
.......\...\......\....\....\Receiver.class
.......\...\......\....\....\Sender.class
.......\...\......\....\....\Startup.class
src\com\broada\demo\snmp
classes\com\broada\demo\snmp
src\com\broada\demo
classes\com\broada\demo
src\com\broada
classes\com\broada
src\com
classes\com
lib
src
classes
src\com\broada\demo\snmp\Receiver.java
...\...\......\....\....\Sender.java
...\...\......\....\....\Startup.java
.classpath
.project
classes\com\broada\demo\snmp\Receiver$1.class
.......\...\......\....\....\Receiver$2.class
.......\...\......\....\....\Receiver.class
.......\...\......\....\....\Sender.class
.......\...\......\....\....\Startup.class
src\com\broada\demo\snmp
classes\com\broada\demo\snmp
src\com\broada\demo
classes\com\broada\demo
src\com\broada
classes\com\broada
src\com
classes\com
lib
src
classes