summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 584f57c)
raw | patch | inline | side by side (parent: 584f57c)
author | Yoga Ramalingam <yramalingam1@bloomberg.net> | |
Fri, 4 Dec 2015 21:08:54 +0000 (16:08 -0500) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 8 Dec 2015 08:20:38 +0000 (09:20 +0100) |
Issue: #1416
src/interface.c | patch | blob | history |
diff --git a/src/interface.c b/src/interface.c
index e17711e3105ae31ccd106576ede46b72dc5b48a4..c3f5d40affe4c1a5dbb88e1a352858e0532c276a 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
int i;
derive_t rx;
derive_t tx;
+ char iname[DATA_MAX_NAME_LEN];
if (kc == NULL)
return (-1);
if (kstat_read (kc, ksp[i], NULL) == -1)
continue;
+ snprintf(iname, sizeof(iname), "%s_%d_%s", ksp[i]->ks_module, ksp[i]->ks_instance, ksp[i]->ks_name);
+
/* try to get 64bit counters */
rx = get_kstat_value (ksp[i], "rbytes64");
tx = get_kstat_value (ksp[i], "obytes64");
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);
+ if_submit (iname, "if_octets", rx, tx);
/* try to get 64bit counters */
rx = get_kstat_value (ksp[i], "ipackets64");
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);
+ if_submit (iname, "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))
- if_submit (ksp[i]->ks_name, "if_errors", rx, tx);
+ if_submit (iname, "if_errors", rx, tx);
}
/* #endif HAVE_LIBKSTAT */