![RedHat 7 snmpd 服务因名称或服务未知而失败](https://linux22.com/image/714764/RedHat%207%20snmpd%20%E6%9C%8D%E5%8A%A1%E5%9B%A0%E5%90%8D%E7%A7%B0%E6%88%96%E6%9C%8D%E5%8A%A1%E6%9C%AA%E7%9F%A5%E8%80%8C%E5%A4%B1%E8%B4%A5.png)
我安装了 RedHat 7 服务器,但是无法启动 snmpd 服务,原因如下:
server11# systemctl status snmpd
snmpd.service - Simple Network Management Protocol (SNMP) Daemon.
Loaded: loaded (/usr/lib/systemd/system/snmpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2017-12-12 11:51:13 CET; 25min ago
Process: 20736 ExecStart=/usr/sbin/snmpd $OPTIONS -f (code=exited, status=1/FAILURE)
Main PID: 20736 (code=exited, status=1/FAILURE)
Dec 12 11:51:13 oitwi11 systemd[1]: Starting Simple Network Management Protocol (SNMP) Daemon....
Dec 12 11:51:13 oitwi11 snmpd[20736]: getaddrinfo: serverz1-oam Name or service not known
Dec 12 11:51:13 oitwi11 snmpd[20736]: getaddrinfo("serverz1-oam", NULL, ...): Name or service not known
Dec 12 11:51:13 oitwi11 snmpd[20736]: Error opening specified endpoint "serverz1-oam:161"
Dec 12 11:51:13 oitwi11 snmpd[20736]: Server Exiting with code 1
好吧,错误很明显,snmpd 服务找不到serverz1-oam主机名。因此,解决方案可能是将其添加到 hosts 文件中。但这并不正确,因为真正的主机名是“服务器11“。我检查了 /etc/snmp/snmpd.conf,但没有这样的配置可以更改。那么,我该如何指示 snmp 获取 server11 主机名的地址?
非常感谢卢卡斯
答案1
该死!明白了,它在这些配置文件上:
/etc/sysconfig/snmpd
/etc/sysconfig/snmptrapd
抱歉浪费了论坛空间!