1. 安装 snmp
yum install net-snmp
如果系统版本较老,可修改yum源为阿里云的镜像源(参考下面链接)
2. 备份 snmpd 配置文件
cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
3. 修改 snmpd 配置文件
vi /etc/snmp/snmpd.conf
以下为参考截图
4. 启动 snmpd 服务,并设置为开机启动
systemctl start snmpd
systemctl enable snmpd
firewalld 开放端口 161-162/udp
firewall-cmd --zone=public --add-port=161-162/udp --permanent
firewall-cmd --reload
firewall-cmd --list-all
snmpwalk 命令参考
snmpwalk -v 2c -c community字符串 ip地址 .1.3.6.1.4
参考:
https://www.alibabacloud.com/help/en/ecs/support/the-yum-command-fails-with-the-http-error-404-not-found-trying-other-mirror-prompt
https://blog.csdn.net/weixin_44112083/article/details/141128069
https://www.cnblogs.com/lewisat/p/17939890