snmp trap
程序员文章站
2022-07-15 15:08:40
...
eps
1.snmptrapd
/etc/rc.local auto restart added & in the end
snmptrapd -c c:/etc/snmp/snmptrapd.conf -d -f -Lo
ps -ef|grep snmptrapd
https://blog.csdn.net/yanhang1589/article/details/7292354 linux install net snmp
https://blog.csdn.net/jiangeeq/article/details/70144092
https://blog.csdn.net/u010411897/article/details/10781031 用snmptrapd接收SNMP trap信息,并将其写入指定文档
设置所有用户的访问权限:可执行,记录,传递:
authcommunity execute,log,net public
设置traphandle(即收到.1.3.6.1.4.1.2021.251.1类OID信息时,执行test.pl)
traphandle .1.3.6.1.4.1.2021.251.1 /home/long/test.pl
2.snmpd
# /usr/bin/snmpd -c /etc/snmpd.conf 加入到/etc/rc.d/rc.local中,成为开机自动启动)
新版snmp配置文件snmpd.conf详解,自定义OID
https://blog.csdn.net/qq_37819695/article/details/86299268
3.https://blog.csdn.net/yr512656630/article/details/84264836 java advent send or receive trap
https://blog.csdn.net/DaveBobo/article/details/51759907
使用AdventNet快速开发网管软件Agent端
开发网管软件的工具和源码包有很多,如Java的SNMP4J,C++的SNMP++,C的Net-SNMP和AdventNet Agent Toolkit C Edition工具包。这里我介绍一下使用AdventNet工具来开发Agent(代理端)的思路
4.https://blog.csdn.net/wangcg123/article/details/53837737 snmp trap
c:\usr\bin\snmptrap -v 2c -c public 10.45.89.87:162 "" NOTIFICATION-TEST-MIB::demo-notif SNMPv2-MIB::sysLocation.0 s "just here"
用下面命令来找出占用此端口的进程。
C:\Users\laiyu>netstat -ano | find "162" 。如果有输出则最后一个数字是进程号如2016。
查找占该进程的名称,继续执行下面命令:
C:\Users\laiyu>tasklist | findstr "2016"
找到后可以用任务管理器终止进程或者用下面的命令
C:\Users\laiyu>taskkill /pid 2016 /t /f
cd c:\usr\bin
c:\usr\bin\snmptrap.exe -v 1 -c public 10.88.33.71 .1.3.6.1.4.1.2294.3.1 192.168.8.74 6 100 12345 .1.3.6.1.4.1.2294.3.1.4 s ?? .1.3.6.1.4.1.2294.3.1.5 i 1122 .1.3.6.1.4.1.2294.3.1.6 s iii
/usr/bin/snmptrap -v 1 -c public 10.88.33.71 .1.3.6.1.4.1.2294.3.1 192.168.8.74 6 100 12345 .1.3.6.1.4.1.2294.3.1.4 s ?? .1.3.6.1.4.1.2294.3.1.5 i 1122
c:\usr\bin\snmptrap.exe -v 2c -c public 10.45.89.87 "" .1.3.6.1.4.1.2021.251.1 sysLocation.0 s "longtengfei"
c:\usr\bin\snmptrap.exe -v 2c -c public 10.88.33.71 "" .1.3.6.1.4.1.2021.251.1 sysLocation.0 s "longtengfei"
for /l %%i in (1,1,60) do (
echo %%i;
c:\usr\bin\snmptrap.exe -v 2c -c public 10.45.89.87 "" .1.3.6.1.4.1.2021.251.1 sysLocation.0 s "longtengfei";
)
pause
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Configuring_snmptrapd
https://howtodoinjava.com/java/multi-threading/java-thread-pool-executor-example/
https://juejin.im/entry/5b52ed7f6fb9a04fe11ae0d0 java阻塞队列BlockingQueue
https://www.cnblogs.com/daoqidelv/p/6884223.html 大文件拆分方案的java实践(附源码)
1.snmptrapd
/etc/rc.local auto restart added & in the end
snmptrapd -c c:/etc/snmp/snmptrapd.conf -d -f -Lo
ps -ef|grep snmptrapd
https://blog.csdn.net/yanhang1589/article/details/7292354 linux install net snmp
https://blog.csdn.net/jiangeeq/article/details/70144092
https://blog.csdn.net/u010411897/article/details/10781031 用snmptrapd接收SNMP trap信息,并将其写入指定文档
设置所有用户的访问权限:可执行,记录,传递:
authcommunity execute,log,net public
设置traphandle(即收到.1.3.6.1.4.1.2021.251.1类OID信息时,执行test.pl)
traphandle .1.3.6.1.4.1.2021.251.1 /home/long/test.pl
2.snmpd
# /usr/bin/snmpd -c /etc/snmpd.conf 加入到/etc/rc.d/rc.local中,成为开机自动启动)
新版snmp配置文件snmpd.conf详解,自定义OID
https://blog.csdn.net/qq_37819695/article/details/86299268
3.https://blog.csdn.net/yr512656630/article/details/84264836 java advent send or receive trap
https://blog.csdn.net/DaveBobo/article/details/51759907
使用AdventNet快速开发网管软件Agent端
开发网管软件的工具和源码包有很多,如Java的SNMP4J,C++的SNMP++,C的Net-SNMP和AdventNet Agent Toolkit C Edition工具包。这里我介绍一下使用AdventNet工具来开发Agent(代理端)的思路
4.https://blog.csdn.net/wangcg123/article/details/53837737 snmp trap
c:\usr\bin\snmptrap -v 2c -c public 10.45.89.87:162 "" NOTIFICATION-TEST-MIB::demo-notif SNMPv2-MIB::sysLocation.0 s "just here"
用下面命令来找出占用此端口的进程。
C:\Users\laiyu>netstat -ano | find "162" 。如果有输出则最后一个数字是进程号如2016。
查找占该进程的名称,继续执行下面命令:
C:\Users\laiyu>tasklist | findstr "2016"
找到后可以用任务管理器终止进程或者用下面的命令
C:\Users\laiyu>taskkill /pid 2016 /t /f
cd c:\usr\bin
c:\usr\bin\snmptrap.exe -v 1 -c public 10.88.33.71 .1.3.6.1.4.1.2294.3.1 192.168.8.74 6 100 12345 .1.3.6.1.4.1.2294.3.1.4 s ?? .1.3.6.1.4.1.2294.3.1.5 i 1122 .1.3.6.1.4.1.2294.3.1.6 s iii
/usr/bin/snmptrap -v 1 -c public 10.88.33.71 .1.3.6.1.4.1.2294.3.1 192.168.8.74 6 100 12345 .1.3.6.1.4.1.2294.3.1.4 s ?? .1.3.6.1.4.1.2294.3.1.5 i 1122
c:\usr\bin\snmptrap.exe -v 2c -c public 10.45.89.87 "" .1.3.6.1.4.1.2021.251.1 sysLocation.0 s "longtengfei"
c:\usr\bin\snmptrap.exe -v 2c -c public 10.88.33.71 "" .1.3.6.1.4.1.2021.251.1 sysLocation.0 s "longtengfei"
for /l %%i in (1,1,60) do (
echo %%i;
c:\usr\bin\snmptrap.exe -v 2c -c public 10.45.89.87 "" .1.3.6.1.4.1.2021.251.1 sysLocation.0 s "longtengfei";
)
pause
http://net-snmp.sourceforge.net/wiki/index.php/TUT:Configuring_snmptrapd
https://howtodoinjava.com/java/multi-threading/java-thread-pool-executor-example/
https://juejin.im/entry/5b52ed7f6fb9a04fe11ae0d0 java阻塞队列BlockingQueue
https://www.cnblogs.com/daoqidelv/p/6884223.html 大文件拆分方案的java实践(附源码)
上一篇: wmi