Menu

#2951 Cannot build with ucd-snmp/lmSensors MIB: ucd-snmp/lmSensors.c:950:11: error: unknown type name 'sensors_feature_data'

linux
closed
nobody
None
7
2019-07-12
2019-06-25
No

Ubuntu 19.10
snmp v5.8-585-g4efee9f06

Configuring & compiling with:

./configure  --build=x86_64-pc-linux-gnu \
             --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
             --with-logfile="/var/log/snmpd.log" --with-persistent-directory="/var/net-snmp" \
             --enable-blumenthal-aes \
             --enable-embedded-perl \
             --enable-ipv6 \
             --enable-mib-config-checking \
             --enable-shared \
             --with-default-snmp-version="3" --with-sys-contact="noone@no.where" --with-sys-location="Unknown" \
             --with-mib-modules="agent_mibs agentx disman/event disman/schedule etherlike-mib host mibII misc/ipfwacc notification sctp-mib smux snmpv3mibs target tunnel ucd_snmp ucd-snmp/diskio ucd-snmp/lmSensors utilities" \
             --with-mysql \
             --with-openssl \
             --with-perl-modules \
             --without-python-modules \
             --with-security-modules="usm ksm tsm" \
             --with-systemd \
             --with-transports="UDP UDPIPv6 TCP TCPIPv6 DTLSUDP TLSTCP"

make

leads to:

ucd-snmp/diskio.c: In function 'getstats':
ucd-snmp/diskio.c:1428:2: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
  fgets(buffer, sizeof(buffer), parts);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ucd-snmp/diskio.c:1429:2: warning: ignoring return value of 'fgets', declared with attribute warn_unused_result [-Wunused-result]
  fgets(buffer, sizeof(buffer), parts);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libtool: compile:  gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I/usr/include/libnl3 -I../../snmplib -I/usr/include/libnl3 -D_GNU_SOURCE -D_ALL_SOURCE -D_THREAD_SAFE -D__EXTENSIONS__ -isystem /usr/include/mit-krb5 -g -O2 -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 -g -O2 -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -Wall -Wextra -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wimplicit-fallthrough=2 -Wlogical-op -Wno-format-truncation -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-type-limits -c ucd-snmp/diskio.c -o ucd-snmp/diskio.o >/dev/null 2>&1
/bin/bash ../../libtool  --mode=compile gcc -I../../include -I. -I../../agent -I../../agent/mibgroup  -I/usr/include/libnl3 -I../../snmplib -I/usr/include/libnl3 -D_GNU_SOURCE -D_ALL_SOURCE -D_THREAD_SAFE -D__EXTENSIONS__  -isystem /usr/include/mit-krb5  -g -O2 -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 -g -O2 -Ulinux -Dlinux=linux  -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE   -Wall -Wextra -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wimplicit-fallthrough=2 -Wlogical-op -Wno-format-truncation -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-type-limits -c -o ucd-snmp/lmSensors.lo ucd-snmp/lmSensors.c
libtool: compile:  gcc -I../../include -I. -I../../agent -I../../agent/mibgroup -I/usr/include/libnl3 -I../../snmplib -I/usr/include/libnl3 -D_GNU_SOURCE -D_ALL_SOURCE -D_THREAD_SAFE -D__EXTENSIONS__ -isystem /usr/include/mit-krb5 -g -O2 -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -DNETSNMP_REMOVE_U64 -g -O2 -Ulinux -Dlinux=linux -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/x86_64-linux-gnu/perl/5.28/CORE -Wall -Wextra -Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wimplicit-fallthrough=2 -Wlogical-op -Wno-format-truncation -Wno-missing-field-initializers -Wno-sign-compare -Wno-unused-parameter -Wno-type-limits -c ucd-snmp/lmSensors.c  -fPIC -DPIC -o ucd-snmp/.libs/lmSensors.o
ucd-snmp/lmSensors.c: In function '_sensor_load':
ucd-snmp/lmSensors.c:950:11: error: unknown type name 'sensors_feature_data'
     const sensors_feature_data *data;
           ^~~~~~~~~~~~~~~~~~~~
ucd-snmp/lmSensors.c:972:47: warning: passing argument 1 of 'sensors_get_detected_chips' from incompatible pointer type [-Wincompatible-pointer-types]
     while ((chip = sensors_get_detected_chips(&chip_nr))) {
                                               ^~~~~~~~
In file included from ucd-snmp/lmSensors.c:96:
/usr/include/sensors/sensors.h:130:26: note: expected 'const sensors_chip_name *' {aka 'const struct sensors_chip_name *'} but argument is of type 'int *'
 const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
ucd-snmp/lmSensors.c:972:20: error: too few arguments to function 'sensors_get_detected_chips'
     while ((chip = sensors_get_detected_chips(&chip_nr))) {
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ucd-snmp/lmSensors.c:96:
/usr/include/sensors/sensors.h:130:26: note: declared here
 const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
ucd-snmp/lmSensors.c:976:24: warning: implicit declaration of function 'sensors_get_all_features'; did you mean 'sensors_get_all_subfeatures'? [-Wimplicit-function-declaration]
         while ((data = sensors_get_all_features(*chip, &a, &b))) {
                        ^~~~~~~~~~~~~~~~~~~~~~~~
                        sensors_get_all_subfeatures
ucd-snmp/lmSensors.c:976:22: warning: assignment to 'const int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
         while ((data = sensors_get_all_features(*chip, &a, &b))) {
                      ^
ucd-snmp/lmSensors.c:980:22: error: request for member 'mode' in something not a structure or union
             if ((data->mode & SENSORS_MODE_R) &&
                      ^~
ucd-snmp/lmSensors.c:981:22: error: request for member 'mapping' in something not a structure or union
                 (data->mapping == SENSORS_NO_MAPPING) &&
                      ^~
ucd-snmp/lmSensors.c:981:35: error: 'SENSORS_NO_MAPPING' undeclared (first use in this function); did you mean 'SENSORS_COMPUTE_MAPPING'?
                 (data->mapping == SENSORS_NO_MAPPING) &&
                                   ^~~~~~~~~~~~~~~~~~
                                   SENSORS_COMPUTE_MAPPING
ucd-snmp/lmSensors.c:981:35: note: each undeclared identifier is reported only once for each function it appears in
ucd-snmp/lmSensors.c:982:47: error: request for member 'number' in something not a structure or union
                 !sensors_get_label(*chip, data->number, &label) &&
                                               ^~
ucd-snmp/lmSensors.c:982:36: error: incompatible type for argument 1 of 'sensors_get_label'
                 !sensors_get_label(*chip, data->number, &label) &&
                                    ^~~~~
In file included from ucd-snmp/lmSensors.c:96:
/usr/include/sensors/sensors.h:106:7: note: expected 'const sensors_chip_name *' {aka 'const struct sensors_chip_name *'} but argument is of type 'sensors_chip_name' {aka 'const struct sensors_chip_name'}
 char *sensors_get_label(const sensors_chip_name *name,
       ^~~~~~~~~~~~~~~~~
ucd-snmp/lmSensors.c:982:18: error: too many arguments to function 'sensors_get_label'
                 !sensors_get_label(*chip, data->number, &label) &&
                  ^~~~~~~~~~~~~~~~~
In file included from ucd-snmp/lmSensors.c:96:
/usr/include/sensors/sensors.h:106:7: note: declared here
 char *sensors_get_label(const sensors_chip_name *name,
       ^~~~~~~~~~~~~~~~~
ucd-snmp/lmSensors.c:983:18: warning: implicit declaration of function 'sensors_get_feature'; did you mean 'sensors_get_features'? [-Wimplicit-function-declaration]
                 !sensors_get_feature(*chip, data->number, &val)) {
                  ^~~~~~~~~~~~~~~~~~~
                  sensors_get_features
ucd-snmp/lmSensors.c:983:49: error: request for member 'number' in something not a structure or union
                 !sensors_get_feature(*chip, data->number, &val)) {
                                                 ^~
make[2]: *** [Makefile:100: ucd-snmp/lmSensors.lo] Error 1

The whole build log is attached.

1 Attachments

Discussion

  • Bart Van Assche

    Bart Van Assche - 2019-06-25

    Are you sure about the Ubuntu version? According to https://wiki.ubuntu.com/Releases the latest version is 19.04.

    Please also provide the lmsensors version.

     
  • Jean-christophe Manciot

    Yes I'm sure. I use the develoment version 'eoan'.

    lm-sensors:
      Installed: 1:3.5.0-3ubuntu1
    
     
  • Bart Van Assche

    Bart Van Assche - 2019-06-26

    How can I download and install Ubuntu 19.10?

     
  • Jean-christophe Manciot

    You need to

    - get 19.04
    - upgrade all packages with 'apt update && apt upgrade'
    - install the apt release upgrader with 'apt install ubuntu-release-upgrader-core'
    - upgrade to the next development distribution with 'do-release-upgrade --devel-release --frontend=DistUpgradeViewNonInteractive'
    - reboot the server
    
     
  • Bart Van Assche

    Bart Van Assche - 2019-06-27

    I can reproduce the build failure. Do you really need the UCD implementation of the sensors MIB (ucd-snmp/lmSensors)? I'm asking this because there is a newer implementation of the sensors MIB that builds fine on Ubuntu 19.10, namely hardware/sensors.

     
  • Jean-christophe Manciot

    hardware/sensors is fine if it can be interpreted/used by OpenNMS.
    ./configure --help does not show hardware/sensors Any other MIB not shown by ../configure --help that I should know about?

     
  • Bart Van Assche

    Bart Van Assche - 2019-06-27

    These are the MIBs I enable when running unit tests:

    deliver/deliverByNotify
    disman/event
    disman/expression
    disman/mteEventNotificationTable
    disman/mteEventTable
    disman/mteObjectsTable
    disman/mteTriggerBooleanTable
    disman/mteTriggerDeltaTable
    disman/mteTriggerExistenceTable
    disman/mteTriggerTable
    disman/mteTriggerThresholdTable
    disman/nslookup-mib
    disman/ping-mib
    disman/schedule
    disman/traceroute-mib
    etherlike-mib
    examples/data_set
    examples/delayed_instance
    examples/example
    examples/netSnmpHostsTable
    examples/notification
    examples/scalar_int
    examples/ucdDemoPublic
    examples/watched
    hardware/cpu
    hardware/fsys
    hardware/memory
    hardware/sensors
    host
    ip-forward-mib
    ip-mib/inetNetToMediaTable
    ip-mib/ipDefaultRouterTable
    ip-mib/ipv4InterfaceTable
    ip-mib/ipv6InterfaceTable
    ip-mib/ipv6ScopeZoneIndexTable
    mibII
    mibII/ipAddr
    mibII/mta_sendmail
    misc/ipfwacc
    rmon-mib
    sctp-mib
    smux
    snmp-notification-mib
    snmp-usm-dh-objects-mib
    tcp-mib
    testhandler
    tlstm-mib
    tsm-mib
    tunnel
    ucd-snmp/diskio
    ucd-snmp/extensible
    ucd-snmp/lmsensorsMib
    udp-mib

     
  • Jean-christophe Manciot

    Very helpful!
    Any reason why you don't use the following mibs?

    agent_mibs
    agentx
    notification
    snmpv3mibs
    target
    utilities
    

    Also, ./configure offers the possibility to use ucd_snmpmib: does it include all ucd_snmp/*?

     
  • Bart Van Assche

    Bart Van Assche - 2019-06-28

    I think that --with-mib-modules enables additional MIBs on top of the default and that the MIBs you mentioned are enabled by default. On the master branch the list I mentioned gets expanded by the configure script into the following:

    agent/extend
    agent/nsCache
    agent/nsDebug
    agent/nsLogging
    agent/nsModuleTable
    agent/nsTransactionTable
    agent/nsVacmAccessTable
    agent_mibs
    agentx
    agentx/agentx_config
    agentx/client
    agentx/master
    agentx/master_admin
    agentx/protocol
    agentx/subagent
    default_modules
    deliver/deliverByNotify
    disman/event
    disman/event/mteEvent
    disman/event/mteEventConf
    disman/event/mteEventNotificationTable
    disman/event/mteEventSetTable
    disman/event/mteEventTable
    disman/event/mteObjects
    disman/event/mteObjectsConf
    disman/event/mteObjectsTable
    disman/event/mteScalars
    disman/event/mteTrigger
    disman/event/mteTriggerBooleanTable
    disman/event/mteTriggerConf
    disman/event/mteTriggerDeltaTable
    disman/event/mteTriggerExistenceTable
    disman/event/mteTriggerTable
    disman/event/mteTriggerThresholdTable
    disman/expr/expErrorTable
    disman/expr/expExpression
    disman/expr/expExpressionConf
    disman/expr/expExpressionTable
    disman/expr/expObject
    disman/expr/expObjectConf
    disman/expr/expObjectTable
    disman/expr/expScalars
    disman/expr/expValue
    disman/expr/expValueTable
    disman/expression
    disman/nslookup-mib
    disman/nslookup/lookupCtlTable
    disman/nslookup/lookupResultsTable
    disman/ping-mib
    disman/ping/pingCtlTable
    disman/ping/pingProbeHistoryTable
    disman/ping/pingResultsTable
    disman/schedule
    disman/schedule/schedConf
    disman/schedule/schedCore
    disman/schedule/schedTable
    disman/traceroute-mib
    disman/traceroute/traceRouteCtlTable
    disman/traceroute/traceRouteHopsTable
    disman/traceroute/traceRouteProbeHistoryTable
    disman/traceroute/traceRouteResultsTable
    etherlike-mib
    etherlike-mib/data_access/dot3stats
    etherlike-mib/data_access/dot3stats_linux
    etherlike-mib/dot3StatsTable
    etherlike-mib/dot3StatsTable/dot3StatsTable
    etherlike-mib/dot3StatsTable/dot3StatsTable_data_access
    etherlike-mib/dot3StatsTable/dot3StatsTable_data_get
    etherlike-mib/dot3StatsTable/dot3StatsTable_data_set
    etherlike-mib/dot3StatsTable/dot3StatsTable_interface
    examples/data_set
    examples/delayed_instance
    examples/example
    examples/netSnmpHostsTable
    examples/netSnmpHostsTable_access
    examples/netSnmpHostsTable_checkfns
    examples/netSnmpHostsTable_checkfns_local
    examples/notification
    examples/scalar_int
    examples/ucdDemoPublic
    examples/watched
    hardware/cpu
    hardware/cpu/cpu
    hardware/cpu/cpu_linux
    hardware/fsys
    hardware/fsys/fsys_mntent
    hardware/fsys/hw_fsys
    hardware/memory
    hardware/memory/hw_mem
    hardware/memory/memory_linux
    hardware/sensors
    hardware/sensors/hw_sensors
    hardware/sensors/lmsensors_v3
    header_complex
    host
    host/data_access/swinst
    host/data_access/swinst_rpm
    host/data_access/swrun
    host/data_access/swrun_procfs_status
    host/hrSWInstalledTable
    host/hrSWRunPerfTable
    host/hrSWRunTable
    host/hr_device
    host/hr_disk
    host/hr_network
    host/hr_other
    host/hr_partition
    host/hr_print
    host/hr_proc
    host/hr_system
    host/hrh_filesys
    host/hrh_storage
    if-mib
    if-mib/data_access/interface
    if-mib/data_access/interface_ioctl
    if-mib/data_access/interface_linux
    if-mib/ifTable
    if-mib/ifTable/ifTable
    if-mib/ifTable/ifTable_data_access
    if-mib/ifTable/ifTable_interface
    if-mib/ifXTable
    if-mib/ifXTable/ifXTable
    if-mib/ifXTable/ifXTable_data_access
    if-mib/ifXTable/ifXTable_interface
    ip-forward-mib
    ip-forward-mib/data_access/route
    ip-forward-mib/data_access/route_common
    ip-forward-mib/data_access/route_ioctl
    ip-forward-mib/data_access/route_linux
    ip-forward-mib/inetCidrRouteTable
    ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable
    ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_data_access
    ip-forward-mib/inetCidrRouteTable/inetCidrRouteTable_interface
    ip-forward-mib/ipCidrRouteTable
    ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable
    ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_data_access
    ip-forward-mib/ipCidrRouteTable/ipCidrRouteTable_interface
    ip-mib
    ip-mib/data_access/arp
    ip-mib/data_access/arp_common
    ip-mib/data_access/arp_netlink
    ip-mib/data_access/defaultrouter
    ip-mib/data_access/defaultrouter_common
    ip-mib/data_access/defaultrouter_linux
    ip-mib/data_access/ipaddress
    ip-mib/data_access/ipaddress_common
    ip-mib/data_access/ipaddress_ioctl
    ip-mib/data_access/ipaddress_linux
    ip-mib/data_access/ipv6scopezone
    ip-mib/data_access/ipv6scopezone_common
    ip-mib/data_access/ipv6scopezone_linux
    ip-mib/data_access/scalars_common
    ip-mib/data_access/scalars_linux
    ip-mib/data_access/systemstats
    ip-mib/data_access/systemstats_common
    ip-mib/data_access/systemstats_linux
    ip-mib/inetNetToMediaTable
    ip-mib/inetNetToMediaTable/inetNetToMediaTable
    ip-mib/inetNetToMediaTable/inetNetToMediaTable_data_access
    ip-mib/inetNetToMediaTable/inetNetToMediaTable_interface
    ip-mib/ipAddressPrefixTable
    ip-mib/ipAddressPrefixTable/ipAddressPrefixTable
    ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_data_access
    ip-mib/ipAddressPrefixTable/ipAddressPrefixTable_interface
    ip-mib/ipAddressTable
    ip-mib/ipAddressTable/ipAddressTable
    ip-mib/ipAddressTable/ipAddressTable_data_access
    ip-mib/ipAddressTable/ipAddressTable_interface
    ip-mib/ipDefaultRouterTable
    ip-mib/ipDefaultRouterTable/ipDefaultRouterTable
    ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_access
    ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_data_get
    ip-mib/ipDefaultRouterTable/ipDefaultRouterTable_interface
    ip-mib/ipIfStatsTable
    ip-mib/ipIfStatsTable/ipIfStatsTable
    ip-mib/ipIfStatsTable/ipIfStatsTable_data_access
    ip-mib/ipIfStatsTable/ipIfStatsTable_data_get
    ip-mib/ipIfStatsTable/ipIfStatsTable_interface
    ip-mib/ipSystemStatsTable
    ip-mib/ipSystemStatsTable/ipSystemStatsTable
    ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access
    ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface
    ip-mib/ip_scalars
    ip-mib/ipv4InterfaceTable
    ip-mib/ipv4InterfaceTable/ipv4InterfaceTable
    ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_data_access
    ip-mib/ipv4InterfaceTable/ipv4InterfaceTable_interface
    ip-mib/ipv6InterfaceTable
    ip-mib/ipv6InterfaceTable/ipv6InterfaceTable
    ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_data_access
    ip-mib/ipv6InterfaceTable/ipv6InterfaceTable_interface
    ip-mib/ipv6ScopeZoneIndexTable
    ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable
    ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_data_access
    ip-mib/ipv6ScopeZoneIndexTable/ipv6ScopeZoneIndexTable_interface
    mibII
    mibII/at
    mibII/data_access/at_linux
    mibII/data_access/at_unix
    mibII/icmp
    mibII/ifTable
    mibII/ip
    mibII/ipAddr
    mibII/ipv6
    mibII/kernel_linux
    mibII/mta_sendmail
    mibII/route_write
    mibII/setSerialNo
    mibII/snmp_mib
    mibII/sysORTable
    mibII/system_mib
    mibII/tcp
    mibII/tcpTable
    mibII/udp
    mibII/udpTable
    mibII/updates
    mibII/vacm_conf
    mibII/vacm_context
    mibII/vacm_vars
    mibII/var_route
    misc/ipfwacc
    notification
    notification-log-mib
    notification-log-mib/notification_log
    notification/snmpNotifyFilterProfileTable
    notification/snmpNotifyFilterProfileTable_data
    notification/snmpNotifyTable
    notification/snmpNotifyTable_data
    rmon-mib
    rmon-mib/data_access/etherstats
    rmon-mib/data_access/etherstats_linux
    rmon-mib/etherStatsTable
    rmon-mib/etherStatsTable/etherStatsTable
    rmon-mib/etherStatsTable/etherStatsTable_data_access
    rmon-mib/etherStatsTable/etherStatsTable_data_get
    rmon-mib/etherStatsTable/etherStatsTable_data_set
    rmon-mib/etherStatsTable/etherStatsTable_interface
    sctp-mib
    sctp-mib/sctpAssocLocalAddrTable
    sctp-mib/sctpAssocRemAddrTable
    sctp-mib/sctpAssocTable
    sctp-mib/sctpLookupLocalPortTable
    sctp-mib/sctpLookupRemHostNameTable
    sctp-mib/sctpLookupRemIPAddrTable
    sctp-mib/sctpLookupRemPortTable
    sctp-mib/sctpLookupRemPrimIPAddrTable
    sctp-mib/sctpScalars
    sctp-mib/sctpScalars_common
    sctp-mib/sctpScalars_linux
    sctp-mib/sctpTables
    sctp-mib/sctpTables_common
    sctp-mib/sctpTables_linux
    smux
    smux/smux
    snmp-notification-mib
    snmp-notification-mib/snmpNotifyFilterTable
    snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable
    snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_access
    snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_data_storage
    snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable_interface
    snmp-usm-dh-objects-mib
    snmp-usm-dh-objects-mib/usmDHParameters
    snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters
    snmp-usm-dh-objects-mib/usmDHUserKeyTable
    snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable
    snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_access
    snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get
    snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_set
    snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_interface
    snmpv3/snmpEngine
    snmpv3/snmpMPDStats
    snmpv3/usmConf
    snmpv3/usmStats
    snmpv3/usmUser
    snmpv3mibs
    target
    target/snmpTargetAddrEntry
    target/snmpTargetAddrEntry_data
    target/snmpTargetParamsEntry
    target/snmpTargetParamsEntry_data
    target/target
    target/target_counters
    tcp-mib
    tcp-mib/data_access/tcpConn
    tcp-mib/data_access/tcpConn_common
    tcp-mib/data_access/tcpConn_linux
    tcp-mib/tcpConnectionTable
    tcp-mib/tcpConnectionTable/tcpConnectionTable
    tcp-mib/tcpConnectionTable/tcpConnectionTable_data_access
    tcp-mib/tcpConnectionTable/tcpConnectionTable_interface
    tcp-mib/tcpListenerTable
    tcp-mib/tcpListenerTable/tcpListenerTable
    tcp-mib/tcpListenerTable/tcpListenerTable_data_access
    tcp-mib/tcpListenerTable/tcpListenerTable_interface
    testhandler
    tlstm-mib
    tlstm-mib/snmpTlstmAddrTable
    tlstm-mib/snmpTlstmAddrTable/snmpTlstmAddrTable
    tlstm-mib/snmpTlstmCertToTSNTable
    tlstm-mib/snmpTlstmCertToTSNTable/snmpTlstmCertToTSNTable
    tlstm-mib/snmpTlstmParamsTable
    tlstm-mib/snmpTlstmParamsTable/snmpTlstmParamsTable
    tlstm-mib/snmpTlstmSession
    tlstm-mib/snmpTlstmSession/snmpTlstmSession
    tsm-mib
    tsm-mib/snmpTsmConfigurationUsePrefix
    tsm-mib/snmpTsmStats
    tsm-mib/snmpTsmStats/snmpTsmStats
    tunnel
    tunnel/tunnel
    ucd-snmp/disk_hw
    ucd-snmp/diskio
    ucd-snmp/dlmod
    ucd-snmp/errormib
    ucd-snmp/extensible
    ucd-snmp/file
    ucd-snmp/lmsensorsMib
    ucd-snmp/loadave
    ucd-snmp/logmatch
    ucd-snmp/memory
    ucd-snmp/pass
    ucd-snmp/pass_common
    ucd-snmp/pass_persist
    ucd-snmp/proc
    ucd-snmp/proxy
    ucd-snmp/versioninfo
    ucd-snmp/vmstat
    ucd_snmp
    udp-mib
    udp-mib/data_access/udp_endpoint
    udp-mib/data_access/udp_endpoint_common
    udp-mib/data_access/udp_endpoint_linux
    udp-mib/udpEndpointTable
    udp-mib/udpEndpointTable/udpEndpointTable
    udp-mib/udpEndpointTable/udpEndpointTable_data_access
    udp-mib/udpEndpointTable/udpEndpointTable_interface
    util_funcs
    util_funcs/get_pid_from_inode
    util_funcs/header_generic
    util_funcs/header_simple_table
    util_funcs/restart
    utilities
    utilities/execute
    utilities/iquery
    utilities/override

     
  • Jean-christophe Manciot

    Nice!
    You must have used a hidden ./configure option because I couldn't see anything allowing a complete list of all available mibs for the current host.
    I tried your list, but it fails to compile unfortuantely:

    host/data_access/swinst_rpm.c:78:15: warning: implicit declaration of function 'stat'; did you mean 'strcat'? [-Wimplicit-function-declaration]
         if (-1 == stat( pkg_directory, &stat_buf )) {
                   ^~~~
                   strcat
    host/data_access/swinst_rpm.c: In function 'netsnmp_swinst_arch_load':
    host/data_access/swinst_rpm.c:96:5: error: unknown type name 'rpmts'
         rpmts                 ts;
         ^~~~~
    host/data_access/swinst_rpm.c:98:5: error: unknown type name 'rpmdbMatchIterator'
         rpmdbMatchIterator    mi;
         ^~~~~~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:99:5: error: unknown type name 'Header'
         Header                h;
         ^~~~~~
    host/data_access/swinst_rpm.c:119:10: warning: implicit declaration of function 'rpmtsCreate'; did you mean 'timer_create'? [-Wimplicit-function-declaration]
         ts = rpmtsCreate();
              ^~~~~~~~~~~
              timer_create
    host/data_access/swinst_rpm.c:120:5: warning: implicit declaration of function 'rpmtsSetVSFlags' [-Wimplicit-function-declaration]
         rpmtsSetVSFlags( ts, (_RPMVSF_NOSIGNATURES|_RPMVSF_NODIGESTS));
         ^~~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:120:27: error: '_RPMVSF_NOSIGNATURES' undeclared (first use in this function); did you mean 'MSG_NOSIGNAL'?
         rpmtsSetVSFlags( ts, (_RPMVSF_NOSIGNATURES|_RPMVSF_NODIGESTS));
                               ^~~~~~~~~~~~~~~~~~~~
                               MSG_NOSIGNAL
    host/data_access/swinst_rpm.c:120:27: note: each undeclared identifier is reported only once for each function it appears in
    host/data_access/swinst_rpm.c:120:48: error: '_RPMVSF_NODIGESTS' undeclared (first use in this function)
         rpmtsSetVSFlags( ts, (_RPMVSF_NOSIGNATURES|_RPMVSF_NODIGESTS));
                                                    ^~~~~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:122:10: warning: implicit declaration of function 'rpmtsInitIterator' [-Wimplicit-function-declaration]
         mi = rpmtsInitIterator( ts, RPMDBI_PACKAGES, NULL, 0);
              ^~~~~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:122:33: error: 'RPMDBI_PACKAGES' undeclared (first use in this function)
         mi = rpmtsInitIterator( ts, RPMDBI_PACKAGES, NULL, 0);
                                     ^~~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:123:12: warning: comparison between pointer and integer
         if (mi == NULL)
                ^~
    host/data_access/swinst_rpm.c:126:25: warning: implicit declaration of function 'rpmdbNextIterator' [-Wimplicit-function-declaration]
         while (NULL != (h = rpmdbNextIterator( mi )))
                             ^~~~~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:126:17: warning: comparison between pointer and integer
         while (NULL != (h = rpmdbNextIterator( mi )))
                     ^~
    host/data_access/swinst_rpm.c:135:13: warning: implicit declaration of function 'headerLink'; did you mean 'readlink'? [-Wimplicit-function-declaration]
             h = headerLink( h );
                 ^~~~~~~~~~
                 readlink
    host/data_access/swinst_rpm.c:149:9: warning: implicit declaration of function 'headerGetEntry' [-Wimplicit-function-declaration]
             headerGetEntry( h, RPMTAG_NAME,        NULL, (void**)&n, NULL);
             ^~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:149:28: error: 'RPMTAG_NAME' undeclared (first use in this function); did you mean 'PACKAGE_NAME'?
             headerGetEntry( h, RPMTAG_NAME,        NULL, (void**)&n, NULL);
                                ^~~~~~~~~~~
                                PACKAGE_NAME
    host/data_access/swinst_rpm.c:150:28: error: 'RPMTAG_VERSION' undeclared (first use in this function); did you mean 'PACKAGE_VERSION'?
             headerGetEntry( h, RPMTAG_VERSION,     NULL, (void**)&v, NULL);
                                ^~~~~~~~~~~~~~
                                PACKAGE_VERSION
    host/data_access/swinst_rpm.c:151:28: error: 'RPMTAG_RELEASE' undeclared (first use in this function); did you mean 'ITERATOR_RELEASE'?
             headerGetEntry( h, RPMTAG_RELEASE,     NULL, (void**)&r, NULL);
                                ^~~~~~~~~~~~~~
                                ITERATOR_RELEASE
    host/data_access/swinst_rpm.c:152:28: error: 'RPMTAG_GROUP' undeclared (first use in this function)
             headerGetEntry( h, RPMTAG_GROUP,       NULL, (void**)&g, NULL);
                                ^~~~~~~~~~~~
    host/data_access/swinst_rpm.c:153:28: error: 'RPMTAG_INSTALLTIME' undeclared (first use in this function)
             headerGetEntry( h, RPMTAG_INSTALLTIME, NULL, (void**)&t, NULL);
                                ^~~~~~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:181:9: warning: implicit declaration of function 'headerFree' [-Wimplicit-function-declaration]
             headerFree( h );
             ^~~~~~~~~~
    host/data_access/swinst_rpm.c:183:5: warning: implicit declaration of function 'rpmdbFreeIterator' [-Wimplicit-function-declaration]
         rpmdbFreeIterator( mi );
         ^~~~~~~~~~~~~~~~~
    host/data_access/swinst_rpm.c:184:5: warning: implicit declaration of function 'rpmtsFree' [-Wimplicit-function-declaration]
         rpmtsFree( ts );
         ^~~~~~~~~
    
     
    • Bart Van Assche

      Bart Van Assche - 2019-06-29

      That MIB list is the result of analyzing the output of the following grep command:git grep -nH config_require agent/mibgroup.

      The host/data_access/swinst_rpm code can only be built on RPM-based systems so not on Debian systems.

       
  • Jean-christophe Manciot

    The solution is to remove host/data_access/swinst_rpm and it compiles fine!

     
  • Jean-christophe Manciot

    However, now snmpd crashes:

    # systemctl restart snmpd
    # systemctl status snmpd
     snmpd.service - Simple Network Management Protocol (SNMP) daemon.
       Loaded: loaded (/lib/systemd/system/snmpd.service; enabled; vendor preset: enabled)
       Active: failed (Result: core-dump) since Sat 2019-06-29 13:59:16 CEST; 2s ago
      Process: 10028 ExecStart=/usr/sbin/snmpd -f (code=dumped, signal=SEGV)
     Main PID: 10028 (code=dumped, signal=SEGV)
    
    Jun 29 13:59:16 samsung5-ubuntu systemd[1]: Started Simple Network Management Protocol (SNMP) daemon..
    Jun 29 13:59:16 samsung5-ubuntu systemd[1]: snmpd.service: Main process exited, code=dumped, status=11/SEGV
    Jun 29 13:59:16 samsung5-ubuntu systemd[1]: snmpd.service: Failed with result 'core-dump'.
    

    syslog:

    Jun 29 13:59:16 samsung5-ubuntu systemd[1]: Started Simple Network Management Protocol (SNMP) daemon..
    Jun 29 13:59:16 samsung5-ubuntu kernel: [15752.463112] snmpd[10028]: segfault at d0 ip 00007f7c43ac409b sp 00007ffe621de8e0 error 4 in libnetsnmp.so.35.0.0[7f7c43a35000+96000]
    Jun 29 13:59:16 samsung5-ubuntu kernel: [15752.463120] Code: 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 f3 0f 1e fa 41 54 49 89 f4 55 48 89 d5 53 48 89 fb eb 08 0f 1f 44 00 00 48 89 c3 <48> 8b 83 d0 00 00 00 48 85 c0 75 f1 48 83 bb d8 00 00 00 00 74 26
    Jun 29 13:59:16 samsung5-ubuntu systemd[1]: snmpd.service: Main process exited, code=dumped, status=11/SEGV
    Jun 29 13:59:16 samsung5-ubuntu systemd[1]: snmpd.service: Failed with result 'core-dump'.
    
     

    Last edit: Jean-christophe Manciot 2019-06-29
  • Jean-christophe Manciot

    Debugging with gdb:

    # ./libtool --mode=execute gdb agent/snmpd
    GNU gdb (Ubuntu 8.3-0ubuntu1) 8.3
    Copyright (C) 2019 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "x86_64-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>.
    Find the GDB manual and other documentation resources online at:
        <http://www.gnu.org/software/gdb/documentation/>.
    
    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from /media/actionmystique/SAMSUNG5-Shared/home/actionmystique/src/SNMP/git-snmp/agent/.libs/snmpd...
    (gdb) run -f -Lo
    Starting program: /media/actionmystique/SAMSUNG5-Shared/home/actionmystique/src/SNMP/git-snmp/agent/.libs/snmpd -f -Lo
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    
    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff7af5687 in CONTAINER_CLEAR (x=0x0, f=0x7ffff7d352d3 <sctpLookupLocalPortTable_entry_clear>, c=0x0) at container.c:491
    491     while(x->next)
    (gdb) bt
    #0  0x00007ffff7af5687 in CONTAINER_CLEAR (x=0x0, f=0x7ffff7d352d3 <sctpLookupLocalPortTable_entry_clear>, c=0x0) at container.c:491
    #1  0x00007ffff7d3531e in sctpLookupLocalPortTable_container_clear (container=0x0) at sctp-mib/sctpLookupLocalPortTable.c:280
    #2  0x00007ffff7d39a7e in sctpTables_fill_lookup (containers=0x7fffffffda90) at sctp-mib/sctpTables_common.c:389
    #3  0x00007ffff7d39bda in sctpTables_load () at sctp-mib/sctpTables_common.c:447
    #4  0x00007ffff7d34974 in _cache_load (cache=0x555555869e00, vmagic=0x555555869790) at sctp-mib/sctpAssocTable.c:415
    #5  0x00007ffff7f6097b in _cache_load (cache=0x555555869e00) at helpers/cache_handler.c:735
    #6  0x00007ffff7f5fd7d in netsnmp_cache_handler_get (cache=0x555555869e00) at helpers/cache_handler.c:395
    #7  0x00007ffff7d340b2 in initialize_table_sctpAssocTable () at sctp-mib/sctpAssocTable.c:116
    #8  0x00007ffff7d33e7d in init_sctpAssocTable () at sctp-mib/sctpAssocTable.c:28
    #9  0x00007ffff7d914b3 in init_mib_modules () at ../agent/mibgroup/mib_module_inits.h:109
    #10 0x0000555555558cc6 in main (argc=3, argv=0x7fffffffdd88) at snmpd.c:906
    (gdb) 
    
     
  • Jean-christophe Manciot

    A workaround is to configure without any sctp-mib:

    # systemctl restart snmpd
    root@samsung5-ubuntu:/media/actionmystique/SAMSUNG5-Shared/home/actionmystique/src/SNMP# systemctl status snmpd
     snmpd.service - Simple Network Management Protocol (SNMP) daemon.
       Loaded: loaded (/lib/systemd/system/snmpd.service; enabled; vendor preset: enabled)
       Active: active (running) since Sat 2019-06-29 15:20:59 CEST; 1s ago
     Main PID: 4947 (snmpd)
        Tasks: 1 (limit: 4915)
       Memory: 9.6M
       CGroup: /system.slice/snmpd.service
               └─4947 /usr/sbin/snmpd -f
    
    Jun 29 15:20:59 samsung5-ubuntu systemd[1]: Started Simple Network Management Protocol (SNMP) daemon..
    
     
  • Bart Van Assche

    Bart Van Assche - 2019-07-12
    • status: open --> closed
     

Log in to post a comment.