It appears that some recent linux kernels have introduced some new device that
shows up in /proc/net/dev, but has no statistics. Instead of 0 entries, it
actually contains the text "No statistics available.". This causes the ifTable
data_access code to complain that scanf didn't parse enough values. This patch
ignores devices with no statistics. I'm calling for votes to include it in
5.4.1...

Index: agent/mibgroup/if-mib/data_access/interface_linux.c
===================================================================
--- agent/mibgroup/if-mib/data_access/interface_linux.c (revision 16558)
+++ agent/mibgroup/if-mib/data_access/interface_linux.c (working copy)
@@ -333,6 +333,11 @@
     while (*stats == ' ')
         stats++;

+    if ((*stats == 'N') &&
+        (0 == strncmp(stats, "No statistics available",
+                      sizeof("No statistics available"))))
+        return -1;
+
     /*
      * Now parse the rest of the line (i.e. starting from 'stats')
      *      to extract the relevant statistics, and populate

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to