]> granicus.if.org Git - sysstat/commitdiff
Adjust fields captured by when scanning /proc/net/snmp for ICMP stats. Fixes #77.
authorbeejeebus <justin.p.randell@gmail.com>
Mon, 3 Aug 2015 17:00:48 +0000 (13:00 -0400)
committerbeejeebus <justin.p.randell@gmail.com>
Mon, 3 Aug 2015 17:00:48 +0000 (13:00 -0400)
rd_stats.c

index c7db1e5bf3516648035520d4e5a4118673c9b18c..153cfd9b12fd92add7c64c6dd34d3501b6780306 100644 (file)
@@ -1240,9 +1240,9 @@ void read_net_icmp(struct stats_net_icmp *st_net_icmp)
 
                if (!strncmp(line, "Icmp:", 5)) {
                        if (sw) {
-                               sscanf(line + 5, "%lu %*u %*u %*u %*u %*u %*u "
-                                      "%lu %lu %lu %lu %lu %lu %lu %*u %*u %*u %*u "
-                                      "%*u %*u %lu %lu %lu %lu %lu %lu",
+                               sscanf(line + 5, "%lu %*u %*u %*u %*u %*u %*u %*u "   // 1 - 8,   capture 1
+                                      "%lu %lu %lu %lu %lu %lu %lu %*u %*u %*u %*u " // 9 - 19,  capture 9,10,11,12,13,14,15
+                                      "%*u %*u %lu %lu %lu %lu %lu %lu",             // 20 - 27, capture 22,23,24,25,26,27
                                       &st_net_icmp->InMsgs,
                                       &st_net_icmp->InEchos,
                                       &st_net_icmp->InEchoReps,