Blame SOURCES/net-snmp-5.7.2-systemstats-ipv4.patch

34d7f3
1235697 - ipSystemStatsInOctets & ipSystemStatsHCInOctets for IPV4 not implemented with net-snmp in RHEL 7 
34d7f3
34d7f3
commit b4caf543cff7dba8f9acca2b9ea88c9b79dc39ee
34d7f3
Author: Niels Baggesen <nba@users.sourceforge.net>
34d7f3
Date:   Mon Oct 22 16:32:12 2012 +0200
34d7f3
34d7f3
    Pick up HC octets and McastOctets from /proc/net/netstat of current RHEL6
34d7f3
    and Fedora kernels.
34d7f3
34d7f3
diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
34d7f3
index fbfd8a2..3ba8646 100644
34d7f3
--- a/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
34d7f3
+++ b/agent/mibgroup/ip-mib/data_access/systemstats_linux.c
34d7f3
@@ -271,7 +271,7 @@ _additional_systemstats_v4(netsnmp_systemstats_entry* entry,
34d7f3
     FILE           *devin;
34d7f3
     char            line[1024];
34d7f3
     int             scan_count;
34d7f3
-    unsigned long long scan_vals[6];
34d7f3
+    unsigned long long scan_vals[12];
34d7f3
     int             retval = 0;
34d7f3
 
34d7f3
     DEBUGMSGTL(("access:systemstats:container:arch",
34d7f3
@@ -301,9 +301,11 @@ _additional_systemstats_v4(netsnmp_systemstats_entry* entry,
34d7f3
             memset(scan_vals, 0x0, sizeof(scan_vals));
34d7f3
             scan_count = sscanf(line,
34d7f3
                                 "%*s"   /* ignore `IpExt:' */
34d7f3
-                                "%llu %llu %llu %llu %llu %llu",
34d7f3
+                                "%llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu %llu",
34d7f3
                                 &scan_vals[0], &scan_vals[1], &scan_vals[2],
34d7f3
-                                &scan_vals[3], &scan_vals[4], &scan_vals[5]);
34d7f3
+                                &scan_vals[3], &scan_vals[4], &scan_vals[5],
34d7f3
+                                &scan_vals[6], &scan_vals[7], &scan_vals[8],
34d7f3
+                                &scan_vals[9], &scan_vals[10], &scan_vals[11]);
34d7f3
             if (scan_count < 6) {
34d7f3
                 snmp_log(LOG_ERR,
34d7f3
                         "error scanning addtional systemstats data"
34d7f3
@@ -331,6 +333,21 @@ _additional_systemstats_v4(netsnmp_systemstats_entry* entry,
34d7f3
             entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTPKTS] = 1;
34d7f3
             entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINBCASTPKTS] = 1;
34d7f3
             entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTBCASTPKTS] = 1;
34d7f3
+	    if (scan_count >= 12) {
34d7f3
+		entry->stats.HCInOctets.low        = scan_vals[6] & 0xffffffff;
34d7f3
+		entry->stats.HCInOctets.high       = scan_vals[6] >> 32;
34d7f3
+		entry->stats.HCOutOctets.low       = scan_vals[7] & 0xffffffff;
34d7f3
+		entry->stats.HCOutOctets.high      = scan_vals[7] >> 32;
34d7f3
+		entry->stats.HCInMcastOctets.low   = scan_vals[8] & 0xffffffff;
34d7f3
+		entry->stats.HCInMcastOctets.high  = scan_vals[8] >> 32;
34d7f3
+		entry->stats.HCOutMcastOctets.low  = scan_vals[9] & 0xffffffff;
34d7f3
+		entry->stats.HCOutMcastOctets.high = scan_vals[9] >> 32;
34d7f3
+		/* 10 and 11 are In/OutBcastOctets */
34d7f3
+		entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINOCTETS] = 1;
34d7f3
+		entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTOCTETS] = 1;
34d7f3
+		entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCINMCASTOCTETS] = 1;
34d7f3
+		entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTMCASTOCTETS] = 1;
34d7f3
+	    }
34d7f3
         }
34d7f3
     }
34d7f3