SNMPd: Cannot open /proc/bus/pci

情到浓时终转凉″ 提交于 2020-01-04 20:47:12

问题


I cross-compiled NET-SNMP 5.7.1 from sources to a PowerPC using ELDK-3.1. When I try to load the snmpd daemon in my embedded board, I see the message:

# snmpd -f -Lo
pcilib: Cannot open /proc/bus/pci
pcilib: Cannot find any working access method.

Of course my PPC board has no PCI, and I wonder why is netsnmp looking for it.

In more than one place I see this same message (sourceforge, mail-archive, google-groups), but ir has no answer at all. Another variant, with a little but unhelpful responses at (archlinuxarm).

Can anybody please help me?


回答1:


I'm assuming you're on a Linux target.

Net-SNMP's changelog lists "[PATCH 3057093]: allow linux to use libpci for creating useful ifDescr strings".

The configure script will search for an available libpci, and, having found one, will define HAVE_PCI_LOOKUP_NAME and HAVE_PCI_PCI_H. To disable this code: after configuring, you can change those defines in include/net-snmp/net-snmp-config.h, then rebuild. The affected code is in agent/mibgroup/if-mib/data_access/interface_linux.c.




回答2:


There's also a patch in this bug report: http://sourceforge.net/p/net-snmp/bugs/2449/




回答3:


I resolved the issue using the stock snmpd that comes with the Raspbian.

In /etc/snmp/snmpd.conf file I isolated the issue to the following line

agentAddress udp:161,udp6:[::1]:161

Instead of listening on all interfaces, if I specify the the ip address of the eth0 interface i.e.:

agentAddress udp:10.0.1.5:161,udp6:[::1]:161

Then snmpd starts fine.

My speculation is that the stock snmpd tries to enumerate all possible interfaces including the pci ones.



来源:https://stackoverflow.com/questions/9470494/snmpd-cannot-open-proc-bus-pci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!