安装 Net-SNMP
CentOS及其它RedHat系列产品提供了net-snmp的二进制包。我们可以直接从源里安装。
Example
yum install net-snmp net-snmp-devel net-snmp-utils
说明:net-snmp-devel是为了使用net-snmp-config, net-snmp-utils是为了使用snmpwalk。
配置 Net-SNMP
Example
create-snmpv3-user -ro -A snmp@jiankongbao -a MD5 jiankongbao
以上命令,创建一个snmpv3用户,只读,使用MD5,用户名为jiankongbao,密码为snmp@jiankongbao。
注意:运行之前请先停用net-snmp服务。
Example
service snmpd stop
运行 Net-SNMP
运行 Net-SNMP 服务的方法比较简单,不过Net-SNMP服务的名字是snmpd。
Example
service snmpd start
如果要加入开机自动运行服务列表:
Example
chkconfig snmpd on
检测 Net-SNMP
我们可以使用 snmpwalk 来检测snmp服务是否正常开启。
Example
snmpwalk -v 3 -u jiankongbao -a MD5 -A "snmp@jiankongbao" -l authNoPriv 127.0.0.1 sysDescr
如果一切正常,就会返回正常结果
有防火墙的情况下,得把udp 161 端口打开了
[root@zhudoubaby ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT udp -- anywhere anywhere state NEW udp dpt:snmp (必须的)
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:smtp (不用)
使用过程错误记录
注意:有时输入service snmpd status 后出现
snmpd dead but pid file exists
或者
snmpd dead but subsys locked
原因是没有先输入snmpd,原理还不是很明白,但是先记着吧。
荒野乱斗国际版 (BrawlStars)最新版本v56.274
下载一波超人内置修改器菜单版 安卓版v1.0.2
下载敢达决战官方正版 安卓版v6.7.9
下载敢达决战 安卓版v6.7.9
下载继承了一座戏园子无限声望铜钱版 内置菜单最新版v1.7
继承了一座戏园子折相思版是游戏的破解版本,在该版本中为玩家提
山河半世橙光清软金手指版 无限鲜花v3.24
山河半世是一款超级好玩的橙光恋爱游戏,在游戏中玩家们需要扮演
蓬莱手游折相思版 安卓版v1.0.0
蓬莱免广告版是游戏的修改版本,在该版本中为玩家去除了广告,玩
当红影后橙光游戏破解版2025 最新版v1.0
当红影后橙光破解版是一款超级好玩的娱乐圈题材的橙光游戏,在这
忽然成了万人迷清软完结版 无限鲜花版v12.15
忽然成了万人迷破解版是一款非常好玩的男性向橙光游戏,在有一天