Focal Fossa : snmpd log alerts continuously if ipv6 is disabled

Bug #1871307 reported by Cyril Buquet on 2020-04-07
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Low
Rafael David Tinoco

Bug Description

On ubuntu server with ipv6 disabled, snmpd log alerts continuously
"ipaddress_linux: could not open /proc/net/if_inet6: No such file or directory"

Package (not accepted by bug report) : snmpd

How to test :
1) Add ipv6.disable=1 to GRUB_CMDLINE_LINUX_DEFAULT into /etc/default/grub
2) update-grub
3) remove or comment "agentaddress 127.0.0.1,[::1]" into /etc/snmp/snmpd.conf
4) systemctl enable snmpd
5) reboot
6) systemctl status snmpd
7) grep if_inet6 /var/log/syslog

Other information about this problem :
https://bugzilla.redhat.com/show_bug.cgi?id=1719351
https://sourceforge.net/p/net-snmp/bugs/2903/

Related branches

Paul White (paulw2u) on 2020-04-07
affects: ubuntu → net-snmp (Ubuntu)
tags: added: focal

Fixed by upstream commit:

commit cd09fd82522861830aaf9d237b26eef5f9ba50d2
Author: Bart Van Assche <email address hidden>
Date: Wed Nov 21 20:47:42 2018 -0800

    MIB-II: Only log once that opening /proc/net/if_inet6 failed

    If IPv6 has been disabled (ipv6.disable=1) then opening /proc/net/if_inet6
    fails. Only log this once instead of thousand of times a day.

    Reported-by: Fif <email address hidden>

diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
index 5ddead3e0..280575ce3 100644
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
@@ -234,7 +234,7 @@ _load_v6(netsnmp_container *container, int idx_offset)

 #define PROCFILE "/proc/net/if_inet6"
     if (!(in = fopen(PROCFILE, "r"))) {
- snmp_log_perror("ipaddress_linux: could not open " PROCFILE);
+ NETSNMP_LOGONCE((LOG_ERR, "ipaddress_linux: could not open " PROCFILE));
         return -2;
     }

Changed in net-snmp (Ubuntu):
status: New → Confirmed
assignee: nobody → Rafael David Tinoco (rafaeldtinoco)
importance: Undecided → Low

I've done a merge request to be reviewed by the server team before uploading the fix.

Thanks for reporting this!

Cyril Buquet (cyril11) wrote :

Thanks you for your work

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.8+dfsg-2ubuntu2

---------------
net-snmp (5.8+dfsg-2ubuntu2) focal; urgency=medium

  * d/p/lp1871307-log-once-proc-net-if_inet6-failure.patch (LP: #1871307):
    - MIB-II: Only log once that opening /proc/net/if_inet6 failed

 -- Rafael David Tinoco <email address hidden> Thu, 09 Apr 2020 12:30:45 +0000

Changed in net-snmp (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers