configuration - 如何防止 snmpd 监听 161 端口?
问题描述
我试图强制 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 端口???
任何帮助表示赞赏。
解决方案
我发现它snmpd
总是读取 /etc/snmp/snmpd.conf 除非您使用该-C
选项明确禁用它。
以下命令有效。它只读取我的本地配置文件。
snmpd -f -DALL -C -c snmpd.conf
推荐阅读
- reactjs - 无法在 React JS 和 Django 通道之间建立连接
- powershell - Powershell:如何将结果添加到数组(ForEach-Object -Parallel)
- python - “ValueError:int() 的无效文字,基数为 10:'1,077'”当使用我用 youtube 教程制作的 cookie 点击器机器人时
- mysql - 使用 ssh 隧道将数据库连接到 microsoft power BI
- r - 将 Sankeynetwork 图与普通的 ggplot 结合起来
- javascript - 如何将html标签参数从javascript传递到flask服务器
- ruby-on-rails - 迁移 Rails 并连接回现有数据库
- json - 压缩/框架时,json-ld 可以展平深层嵌套的链接数据关系吗?
- python - Pandas isin() 给出 ValueError:Series 的真值是不明确的。使用 a.empty、a.bool()、a.item()、a.any() 或 a.all()
- xamarin.forms - 带有arcore的Xamarin android自定义视图