UnionTech OS Server 20安装snmp
## 查看系统 [rootiZb5g01h403pdu8w4b49ohZ ~]# cat /etc/os-release | head -5 PRETTY_NAMEUnionTech OS Server 20 NAMEUnionTech OS Server 20 VERSION_ID20 VERSION20 IDuos ## 尝试用apt安装 [rootiZb5g01h403pdu8w4b49ohZ ~]# apt update apt install -y snmpd snmp libsnmp-dev -bash: apt: command not found ## 不支持apt 查看支持什么 [rootiZb5g01h403pdu8w4b49ohZ ~]# which dnf yum zypper 2/dev/null; cat /etc/os-release | grep -iE VERSION|ID_LIKE|BASE /bin/dnf /bin/yum VERSION_ID20 VERSION20 VERSION_CODENAMEkongzi ## 1. 安装 [rootiZb5g01h403pdu8w4b49ohZ ~]# dnf install -y net-snmp net-snmp-utils ## 2. 写配置 cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak 2/dev/null cat /etc/snmp/snmpd.conf EOF # SSA平台 SNMP v2c 配置 rocommunity zhuhb0717 default rocommunity zhuhb0717 10.16.0.0/16 view all included .1 80 syslocation SSA-Monitor syscontact adminssa.local disk / load 12 10 5 includeAllDisks 10% EOF ## 3. 启动 自启 systemctl restart snmpd systemctl enable snmpd systemctl status snmpd ## 4. 自测 — 贴输出: snmpget -v 2c -c zhuhb0717 localhost 1.3.6.1.2.1.1.1.0 snmpget -v 2c -c zhuhb0717 localhost 1.3.6.1.4.1.2021.11.11.0 snmpget -v 2c -c zhuhb0717 localhost 1.3.6.1.4.1.2021.4.5.0 snmpwalk -v 2c -c zhuhb0717 localhost 1.3.6.1.2.1.25.2.3.1.3 snmpwalk -v 2c -c zhuhb0717 localhost 1.3.6.1.2.1.2.2.1.10