- if_submit (stats.rx_bytes, stats.tx_bytes,
- t, interface_devices[i].dom, interface_devices[i].path,
- "if_octets");
- if_submit (stats.rx_packets, stats.tx_packets,
- t, interface_devices[i].dom, interface_devices[i].path,
- "if_packets");
- if_submit (stats.rx_errs, stats.tx_errs,
- t, interface_devices[i].dom, interface_devices[i].path,
- "if_errors");
- if_submit (stats.rx_drop, stats.tx_drop,
- t, interface_devices[i].dom, interface_devices[i].path,
- "if_dropped");
- }
+ if ((stats.rx_bytes != -1) && (stats.tx_bytes != -1))
+ submit_counter2 ("if_octets",
+ (counter_t) stats.rx_bytes, (counter_t) stats.tx_bytes,
+ t, interface_devices[i].dom, interface_devices[i].path);
+
+ if ((stats.rx_packets != -1) && (stats.tx_packets != -1))
+ submit_counter2 ("if_packets",
+ (counter_t) stats.rx_packets, (counter_t) stats.tx_packets,
+ t, interface_devices[i].dom, interface_devices[i].path);
+
+ if ((stats.rx_errs != -1) && (stats.tx_errs != -1))
+ submit_counter2 ("if_errors",
+ (counter_t) stats.rx_errs, (counter_t) stats.tx_errs,
+ t, interface_devices[i].dom, interface_devices[i].path);
+
+ if ((stats.rx_drop != -1) && (stats.tx_drop != -1))
+ submit_counter2 ("if_dropped",
+ (counter_t) stats.rx_drop, (counter_t) stats.tx_drop,
+ t, interface_devices[i].dom, interface_devices[i].path);
+ } /* for (nr_interface_devices) */