summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2b9c9ac)
raw | patch | inline | side by side (parent: 2b9c9ac)
author | Yoga Ramalingam <yramalingam1@bloomberg.net> | |
Mon, 7 Dec 2015 15:09:08 +0000 (10:09 -0500) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 8 Dec 2015 08:21:01 +0000 (09:21 +0100) |
Issue: #1416
src/interface.c | patch | blob | history |
diff --git a/src/interface.c b/src/interface.c
index c3f5d40affe4c1a5dbb88e1a352858e0532c276a..d9a0db3a6aea532976cb6bf12406a50724577afd 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
static int config_keys_num = 2;
static ignorelist_t *ignorelist = NULL;
+static _Bool unique_name = 0;
#ifdef HAVE_LIBKSTAT
#define MAX_NUMIF 256
invert = 0;
ignorelist_set_invert (ignorelist, invert);
}
+ else if (strcasecmp (key, "UniqueName") == 0)
+ {
+ if (IS_TRUE (value))
+ unique_name = 1;
+ }
else
{
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);
+ if (unique_name)
+ snprintf(iname, sizeof(iname), "%s_%d_%s", ksp[i]->ks_module, ksp[i]->ks_instance, ksp[i]->ks_name);
+ else
+ snprintf(iname, sizeof(iname), "%s", ksp[i]->ks_name);
/* try to get 64bit counters */
rx = get_kstat_value (ksp[i], "rbytes64");