SNMPd: Cannot open /proc/bus/pci

2019-07-21 01:31发布

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?

3条回答
一夜七次
2楼-- · 2019-07-21 01:41

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.

查看更多
Explosion°爆炸
3楼-- · 2019-07-21 01:47

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.

查看更多
The star\"
4楼-- · 2019-07-21 01:56

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

查看更多
登录 后发表回答