我正在尝试强制snmpd侦听端口1610 (而不是默认端口161)。
当我打开调试时,除了我指定的任何其他代理地址之外,snmpd似乎还坚持侦听端口161。
我在Ubuntu上运行net-snmp 5.7.2。
这是我的snmpd.conf:
agentaddress dtlsudp:localhost:1610
agentuser root
agentgroup root下面是我如何启动snmpd:snmpd -f -r -DALL -c snmpd.conf
我可以看到snmpd解析配置文件并识别出所需的端口1610,但它也尝试侦听端口161!
read_config:parser: Found a parser. Calling it: agentaddress / dtlsudp:localhost:1610
snmpd_ports: port spec: udp:127.0.0.1:161,udp:localhost:1610,dtlsudp:localhost:1610,udp:localhost:1610,dtlsudp:localhost:1610
netsnmp_ds_set_string: Setting APP:2 = "udp:127.0.0.1:161,udp:localhost:1610,dtlsudp:localhost:1610,udp:localhost:1610,dtlsudp:localhost:1610"
snmp_agent: final port spec: "udp:127.0.0.1:161,udp:localhost:1610,dtlsudp:localhost:1610,udp:localhost:1610,dtlsudp:localhost:1610"如何防止snmpd监听161端口?
感谢您的帮助。
发布于 2020-01-31 02:14:34
我发现,除非使用-C选项显式禁用,否则snmpd总是读取/etc/snmp/snmpd.conf。
以下命令起作用了。它只读取我的本地配置文件。
snmpd -f -DALL -C -c snmpd.confhttps://stackoverflow.com/questions/59988109
复制相似问题