summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d17101b)
raw | patch | inline | side by side (parent: d17101b)
author | Fabien Wernli <cpan@faxm0dem.org> | |
Thu, 27 Oct 2011 15:14:06 +0000 (17:14 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 25 Nov 2011 09:59:18 +0000 (10:59 +0100) |
src/interface.c | patch | blob | history |
diff --git a/src/interface.c b/src/interface.c
index 9aae5aef576d22623d986818aa4a5e21d41d2f99..d68240e1d35f95d73ff659c007815f17c4543328 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
if (kstat_read (kc, ksp[i], NULL) == -1)
continue;
- rx = get_kstat_value (ksp[i], "rbytes");
- tx = get_kstat_value (ksp[i], "obytes");
+ /* try to get 64bit counters */
+ rx = get_kstat_value (ksp[i], "rbytes64");
+ tx = get_kstat_value (ksp[i], "obytes64");
+ /* or fallback to 32bit */
+ if (rx == -1LL)
+ rx = get_kstat_value (ksp[i], "rbytes");
+ if (tx == -1LL)
+ tx = get_kstat_value (ksp[i], "obytes");
if ((rx != -1LL) || (tx != -1LL))
if_submit (ksp[i]->ks_name, "if_octets", rx, tx);
- rx = get_kstat_value (ksp[i], "ipackets");
- tx = get_kstat_value (ksp[i], "opackets");
+ /* try to get 64bit counters */
+ rx = get_kstat_value (ksp[i], "ipackets64");
+ tx = get_kstat_value (ksp[i], "opackets64");
+ /* or fallback to 32bit */
+ if (rx == -1LL)
+ rx = get_kstat_value (ksp[i], "ipackets");
+ if (tx == -1LL)
+ tx = get_kstat_value (ksp[i], "opackets");
if ((rx != -1LL) || (tx != -1LL))
if_submit (ksp[i]->ks_name, "if_packets", rx, tx);
+ /* no 64bit error counters yet */
rx = get_kstat_value (ksp[i], "ierrors");
tx = get_kstat_value (ksp[i], "oerrors");
if ((rx != -1LL) || (tx != -1LL))