Redhat7.2 snmptrapd V2c测试

声明:文章仅用于个人测试目的。安装软件包:[root@labvm1 ~]# yum install -y net-snmp配置community name,本例为public[root@labvm1 ~]# cat /etc/snmp/snmptrapd.conf# Example configuration file for snmptrapd## No traps are handled by default, you must edit this file!#authCom.
摘要由CSDN通过智能技术生成

声明:文章仅用于个人测试目的。

安装软件包:

[root@labvm1 ~]# yum install -y net-snmp

配置community name,本例为public

[root@labvm1 ~]# cat /etc/snmp/snmptrapd.conf 
# Example configuration file for snmptrapd
#
# No traps are handled by default, you must edit this file!
#
authCommunity   log,execute,net public
# traphandle SNMPv2-MIB::coldStart    /usr/bin/bin/my_great_script cold
[root@labvm1 ~]# 

添加防火墙规则:

[root@labvm1 ~]# firewall-cmd --permanent --add-port=162/udp
success
[root@labvm1 ~]# firewall-cmd --reload
success
[root@labvm1 ~]# firewall-cmd --list-ports
162/udp
[root@labvm1 ~]# 

测试可以收到"SNMP tet trap".

[root@labvm1 snmp]# snmptrapd -f -Le
NET-SNMP version 5.7.2
2021-08-18 07:35:15 <UNKNOWN> [UDP: [1.2.3.4]:45734->[5.6.7.8]:162]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1629283926) 188 day
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值