@cryptotaxi247 / netdata-1 / commits / a330fde43

Fix for ifi_oqdrops field on previous FreeBSD releases and FreeNAS

Vladimir Kobal committed Jan 9, 2017 at 13:31 UTC a330fde4302bb6d315d6dd7b3ca4cdd37d594c8b
1 file changed +2 -3
src/freebsd_sysctl.c
+2 -3
@@ -15,7 +15,6 @@
15 // NEEDED BY: struct sysctl_netisr_workstream, struct sysctl_netisr_work
16 #include <net/netisr.h>
17 // NEEDED BY: struct ifaddrs, getifaddrs()
18 -#define _IFI_OQDROPS // It is for FreeNAS only. Most probably in future releases of FreeNAS it will be removed
18 #include <net/if.h>
19 #include <ifaddrs.h>
20 // NEEDED BY do_tcp...
@@ -1280,14 +1279,14 @@ int do_freebsd_sysctl(int update_every, usec_t dt) {
1279 st->isdetail = 1;
1280
1281 rrddim_add(st, "inbound", NULL, 1, 1, RRDDIM_INCREMENTAL);
1283 -#ifdef __IFI_OQDROPS
1282 +#if __FreeBSD__ >= 11
1283 rrddim_add(st, "outbound", NULL, -1, 1, RRDDIM_INCREMENTAL);
1284 #endif
1285 }
1286 else rrdset_next(st);
1287
1288 rrddim_set(st, "inbound", IFA_DATA(iqdrops));
1290 -#ifdef __IFI_OQDROPS
1289 +#if __FreeBSD__ >= 11
1290 rrddim_set(st, "outbound", IFA_DATA(oqdrops));
1291 #endif
1292 rrdset_done(st);