【发布时间】:2020-03-25 22:52:55
【问题描述】:
我想使用 snmp 来监控我的 localhost,并已在 Ubuntu 18.03 上使用apt install snmp 安装了相应的软件包。在没有更改默认配置的情况下,我使用systemctl start snmpd 启动了守护进程。启动守护进程后,lsof -i -n | grep snmpd 的输出如下:
snmpd 14668 Debian-snmp 12u IPv4 13252990 0t0 UDP 127.0.0.1:snmp
snmpd 14668 Debian-snmp 13u IPv4 13252988 0t0 UDP *:41898
我想知道输出的第二行,因为端口已向外部开放。重新启动守护程序会将打开的端口更改为另一个(随机?)高端口号。我一直在查找这种行为几个小时,但找不到任何解释。
谁能向我解释这里发生了什么或如何禁用/删除开放端口?
配置
AgentAdress 配置如下:
# /etc/snmp/snmpd.conf
# Listen for connections from the local system only
agentAddress udp:127.0.0.1:161
守护程序已启动,具有以下选项:
# /etc/default/snmp
# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -p /run/snmpd.pid'
ps aux | grep snmpd的输出
/usr/sbin/snmpd -Lsd -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux mteTrigger mteTriggerConf -f
【问题讨论】: