没有来自 buildroot 的 net-snmp 的 IP 信息 ipaddrtable 和 ipaddresstable 都丢失

问题描述

我无法从 SNMP 获取 IP 地址。如果我试图从 ipaddrtable 或 ipaddresstable 获取任何信息,我只会在此 OID 的代理上获得“没有此类对象”。
我需要在 buildroot 或 netsnmp 中配置什么吗?

如果我是 snmpwalk ip,这就是我得到的:

IP-MIB::ipv4InterfaceTableLastChange.0 = Timeticks: (5424123) 15:04:01.23
IP-MIB::ipv4InterfaceReasmMaxSize.1 = INTEGER: 65535
IP-MIB::ipv4InterfaceReasmMaxSize.2 = INTEGER: 65535
IP-MIB::ipv4InterfaceReasmMaxSize.102 = INTEGER: 65535
IP-MIB::ipv4InterfaceEnableStatus.1 = INTEGER: up(1)
IP-MIB::ipv4InterfaceEnableStatus.2 = INTEGER: up(1)
IP-MIB::ipv4InterfaceEnableStatus.102 = INTEGER: up(1)
IP-MIB::ipv4InterfaceRetransmitTime.1 = Gauge32: 1000 milliseconds
IP-MIB::ipv4InterfaceRetransmitTime.2 = Gauge32: 1000 milliseconds
IP-MIB::ipv4InterfaceRetransmitTime.102 = Gauge32: 1000 milliseconds
IP-MIB::ipv6InterfaceTableLastChange.0 = Timeticks: (0) 0:00:00.00
IP-MIB::ipv6InterfaceReasmMaxSize.1 = Gauge32: 65535 octets
IP-MIB::ipv6InterfaceReasmMaxSize.2 = Gauge32: 65535 octets
IP-MIB::ipv6InterfaceIdentifier.1 = STRING:
IP-MIB::ipv6InterfaceIdentifier.2 = STRING: 0:1ff:fe01:2821
IP-MIB::ipv6InterfaceEnableStatus.1 = INTEGER: up(1)
IP-MIB::ipv6InterfaceEnableStatus.2 = INTEGER: up(1)
IP-MIB::ipv6InterfaceReachableTime.1 = Gauge32: 30000 milliseconds
IP-MIB::ipv6InterfaceReachableTime.2 = Gauge32: 30000 milliseconds
IP-MIB::ipv6InterfaceRetransmitTime.1 = Gauge32: 1000 milliseconds
IP-MIB::ipv6InterfaceRetransmitTime.2 = Gauge32: 1000 milliseconds
IP-MIB::ipv6InterfaceForwarding.1 = INTEGER: notForwarding(2)
IP-MIB::ipv6InterfaceForwarding.2 = INTEGER: notForwarding(2)
IP-MIB::ipv6InterfaceForwarding.2.1.1.4 = Wrong Type (should be INTEGER): IpAddress: 0.0.0.0
IP-MIB::ipv6InterfaceForwarding.2.1.2.4 = Wrong Type (should be INTEGER): IpAddress: 0.0.0.0
IP-MIB::ipv6InterfaceForwarding.2.1.3.4 = INTEGER: notForwarding(2)
IP-MIB::ipv6InterfaceForwarding.2.1.4.4 = INTEGER: 0
IP-MIB::ipv6InterfaceForwarding.2.1.5.4 = INTEGER: forwarding(1)
IP-MIB::ipv6InterfaceForwarding.2.1.6.4 = INTEGER: 0

我希望至少有一些关于具有 IP 的 eth0 和 ppp0 的信息
ipaddr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <broADCAST,MULTICAST,LOWER_UP> mtu 1500 qdisc mq qlen 1000
    link/ether 02:00:01:01:28:21 brd ff:ff:ff:ff:ff:ff
    inet 192.168.172.135/24 brd 192.168.172.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::1ff:fe01:2821/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,broADCAST,UP> mtu 1500 qdisc mq qlen 1000
    link/ether 06:00:01:01:28:21 brd ff:ff:ff:ff:ff:ff
4: tunl0@NONE: <NOARP> mtu 1480 qdisc noop qlen 1
    link/ipip 0.0.0.0 brd 0.0.0.0
102: ppp0: <POINTOPOINT,NOARP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 3
    link/ppp
    inet 10.217.130.155 peer 10.64.64.64/32 scope global ppp0
       valid_lft forever preferred_lft forever

额外信息

buildroot 版本: 2020.02.8

sysORID

SNMPv2-MIB::sysORID.1 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.2 = OID: SNMP-VIEW-BASED-ACM-MIB::vacmBasicGroup
SNMPv2-MIB::sysORID.3 = OID: TUNNEL-MIB::tunnelMIB
SNMPv2-MIB::sysORID.4 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.5 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORID.6 = OID: SNMP-USER-BASED-SM-MIB::usmMIBCompliance

SNMP 版本

./net-snmp-config --version
5.8

SNMP 模块

./net-snmp-config --snmpd-module-list | tr ' ' '\n' | grep ip
ip-mib/data_access/ipaddress_common
ip-mib/data_access/ipaddress_linux
misc/ipfwacc
ip-mib/data_access/ipaddress_ioctl
ip-mib/ipv4InterfaceTable/ipv4InterfaceTable
ip-mib/ipv6InterfaceTable/ipv6InterfaceTable
ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface
ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access
ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface
ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access

SNMP 配置

./net-snmp-config --configure-options
 '--target=arm-buildroot-linux-gnueabi' '--host=arm-buildroot-linux-gnueabi' '--build=x86_64-pc-linux-gnu' '--prefix=/usr' '--exec-prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--program-prefix=' '--disable-gtk-doc' '--disable-gtk-doc-html' '--disable-doc' '--disable-docs' '--disable-documentation' '--with-xmlto=no' '--with-fop=no' '--disable-dependency-tracking' '--enable-ipv6' '--disable-nls' '--enable-static' '--enable-shared' '--with-persistent-directory=/var/lib/snmp' '--with-defaults' '--enable-mini-agent' '--without-rpm' '--with-logfile=none' '--without-kmem-usage' '--enable-as-needed' '--without-perl-modules' '--disable-embedded-perl' '--disable-perl-cc-checks' '--disable-scripts' '--with-default-snmp-version=1' '--enable-silent-libtool' '--enable-mfd-rewrites' '--with-sys-contact=root@localhost' '--with-sys-location=UnkNown' '--with-mib-modules=host ucd-snmp/dlmod ucd-snmp/proc agentx ucd-snmp/disk ucd-snmp/diskio ucd-snmp/loadave ucd-snmp/memory ucd-snmp/file agent/extend disman/event disman/schedule ucd-snmp/pass ucd-snmp/pass_persist ucd-snmp/vmstat ucd-snmp/extensible ucd-snmp/errormib ucd-snmp/lmsensorsMib ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable tunnel misc/ipfwacc utilities ip-mib/data_access/ipaddress_common ip-mib/data_access/ipaddress_linux' '--with-out-mib-modules=' '--disable-manuals' '--with-endianness=little' '--with-nl' '--with-openssl=/data/buildroot/buildroot-2020.02.8/output/host/arm-buildroot-linux-gnueabi/sysroot/usr/include/openssl' '--with-security-modules=tsm,usm' '--with-transports=DTLSUDP,TLSTCP' '--enable-agent' '--enable-applications' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=arm-buildroot-linux-gnueabi' 'target_alias=arm-buildroot-linux-gnueabi' 'CC=/data/buildroot/buildroot-2020.02.8/output/host/bin/arm-buildroot-linux-gnueabi-gcc' 'CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os  ' 'LDFLAGS=' 'LIBS=-L/data/buildroot/buildroot-2020.02.8/output/host/bin/../arm-buildroot-linux-gnueabi/sysroot/usr/lib -lssl -lcrypto ' 'CPPFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64' 'CPP=/data/buildroot/buildroot-2020.02.8/output/host/bin/arm-buildroot-linux-gnueabi-cpp' 'PKG_CONfig=/data/buildroot/buildroot-2020.02.8/output/host/bin/pkg-config'

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)