summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d54dc98)
raw | patch | inline | side by side (parent: d54dc98)
author | Florian Forster <octo@collectd.org> | |
Wed, 21 Sep 2016 09:58:39 +0000 (11:58 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Wed, 21 Sep 2016 10:06:19 +0000 (12:06 +0200) |
Issue: #1951
96 files changed:
index 71fb5f8b85a0d0236d83e8f67497057566e131a6..adeae8c383801a088479340f727d83737967b5d9 100644 (file)
* have the same timestamp. */
/* vl.time = cdtime(); */
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "myplugin", sizeof (vl.plugin));
/* it is strongly recommended to use a type defined in the types.db file
diff --git a/src/apache.c b/src/apache.c
index 578b8deeff2f89d4443eee4beafe79562c25eeb5..7ccdb60d56a91963d5ca99e08ca9346c6695ea23 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, (st->host != NULL) ? st->host : hostname_g,
- sizeof (vl.host));
+ if (st->host != NULL)
+ sstrncpy (vl.host, st->host, sizeof (vl.host));
sstrncpy (vl.plugin, "apache", sizeof (vl.plugin));
if (st->name != NULL)
diff --git a/src/apcups.c b/src/apcups.c
index 821bd65edbed1f3fd70244aed5d1e3866e7d32d9..937f2a0696052bb0c3ce16422e5a8bf42097e91c 100644 (file)
--- a/src/apcups.c
+++ b/src/apcups.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "apcups", sizeof (vl.plugin));
- sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
diff --git a/src/apple_sensors.c b/src/apple_sensors.c
index 06ca7a85958661aab3851aae6d4be497dd99dcb7..17c822ff3c91ca9f44a52188ac2d9ecb5faebd18 100644 (file)
--- a/src/apple_sensors.c
+++ b/src/apple_sensors.c
vl.values = &(value_t) { .gauge = val };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "apple_sensors", sizeof (vl.plugin));
- sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/aquaero.c b/src/aquaero.c
index 08271f87a4b4bdf8124676ec4322ee4932bb9cdd..8872409fcc118c691c4a0a85cdbdf0e14c00fb6b 100644 (file)
--- a/src/aquaero.c
+++ b/src/aquaero.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "aquaero", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/ascent.c b/src/ascent.c
index 16568e6ca27a3d69ce5860458499ce9182862277..b14be3c0d709528bf226b9980127b091c3c692b5 100644 (file)
--- a/src/ascent.c
+++ b/src/ascent.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ascent", sizeof (vl.plugin));
if (plugin_instance != NULL)
diff --git a/src/barometer.c b/src/barometer.c
index 998932daa826c308f95ce50fcb8c6958820ac527..53c55b844247b2e19d091fd270501fd5ec025e16 100644 (file)
--- a/src/barometer.c
+++ b/src/barometer.c
norm_pressure = abs_to_mean_sea_level_pressure(pressure);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "barometer", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "mpl115", sizeof (vl.plugin_instance));
norm_pressure = abs_to_mean_sea_level_pressure(pressure);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "barometer", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "mpl3115", sizeof (vl.plugin_instance));
norm_pressure = abs_to_mean_sea_level_pressure(pressure);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "barometer", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "bmp085", sizeof (vl.plugin_instance));
diff --git a/src/battery.c b/src/battery.c
index ebf41debdab783fdf2b676e2219a994f86e1959b..a909b755fe324fa66dfc0cb6e903b5c120ff3166 100644 (file)
--- a/src/battery.c
+++ b/src/battery.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "battery", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/battery_statefs.c b/src/battery_statefs.c
index 03729fdb0c9d4900fe5d55bc72c1c9f375e2ee9d..a0ff18725276341c0dc88f8e6f4b8f5b9bef5bfb 100644 (file)
--- a/src/battery_statefs.c
+++ b/src/battery_statefs.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, "battery", sizeof(vl.plugin));
/* statefs supports 1 battery at present */
sstrncpy(vl.plugin_instance, "0", sizeof(vl.plugin_instance));
diff --git a/src/bind.c b/src/bind.c
index 09de4a3f7679bf8c94217e3d7a276f15a299dd79..9703c0a5cc5b9d5181e289382919c0ba9e15f876 100644 (file)
--- a/src/bind.c
+++ b/src/bind.c
vl.values_len = 1;
if (config_parse_time)
vl.time = TIME_T_TO_CDTIME_T (ts);
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, "bind", sizeof(vl.plugin));
if (plugin_instance) {
sstrncpy(vl.plugin_instance, plugin_instance,
diff --git a/src/ceph.c b/src/ceph.c
index 64d87855fbb0f820ea1a8e8f6d09eeb61894154c..7c5c8a5be989f048f023215a0922588079623ac7 100644 (file)
--- a/src/ceph.c
+++ b/src/ceph.c
}
vtmp->vlist = (value_list_t)VALUE_LIST_INIT;
- sstrncpy(vtmp->vlist.host, hostname_g, sizeof(vtmp->vlist.host));
sstrncpy(vtmp->vlist.plugin, "ceph", sizeof(vtmp->vlist.plugin));
sstrncpy(vtmp->vlist.plugin_instance, io->d->name, sizeof(vtmp->vlist.plugin_instance));
diff --git a/src/cgroups.c b/src/cgroups.c
index f7c7e0d6345676ab77c79d8c6f0a880331b75273..2584eff01edd2a71d1b7acc69f1ac02b400d49ec 100644 (file)
--- a/src/cgroups.c
+++ b/src/cgroups.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cgroups", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/chrony.c b/src/chrony.c
index 353ede792f0627aae2e512439151349f050aeccd..77ba8cc460564d42ed6b8794080a36234e3c0199 100644 (file)
--- a/src/chrony.c
+++ b/src/chrony.c
vl.values_len = 1;
/* XXX: Shall g_chrony_host/g_chrony_port be reflected in the plugin's output? */
- /* hostname_g is set in daemon/collectd.c (from config, via gethostname or by resolving localhost) */
- /* defined as: char hostname_g[DATA_MAX_NAME_LEN]; (never NULL) */
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, PLUGIN_NAME_SHORT, sizeof(vl.plugin));
if (g_chrony_plugin_instance != NULL)
{
diff --git a/src/conntrack.c b/src/conntrack.c
index 4a72b2f61dc91d2b1eab973363139f65d03e6412..26f62786b242872dd89c4a943358f3d0164b2d45 100644 (file)
--- a/src/conntrack.c
+++ b/src/conntrack.c
vl.values = &conntrack;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "conntrack", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
if (type_instance != NULL)
diff --git a/src/contextswitch.c b/src/contextswitch.c
index 3bd6d9f53cc849421760fa211dfab9caddb106a7..834fbd74cd9182c7931c6a2ce898cb98650c01cc 100644 (file)
--- a/src/contextswitch.c
+++ b/src/contextswitch.c
vl.values = &(value_t) { .derive = context_switches };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "contextswitch", sizeof (vl.plugin));
sstrncpy (vl.type, "contextswitch", sizeof (vl.type));
diff --git a/src/cpu.c b/src/cpu.c
index fbd071432c3d09824c685c31e33fa21ed102a373..424a5b52e726bf52d3223768e34644cc929db45e 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cpu", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, cpu_state_names[cpu_state],
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cpu", sizeof (vl.plugin));
sstrncpy (vl.type, "count", sizeof (vl.type));
diff --git a/src/cpufreq.c b/src/cpufreq.c
index a2cc3ad242ab72058888e069c65cddc438c2e559..285ee6c6819931b8635aca06d1ac088dff67601b 100644 (file)
--- a/src/cpufreq.c
+++ b/src/cpufreq.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cpufreq", sizeof (vl.plugin));
sstrncpy (vl.type, "cpufreq", sizeof (vl.type));
ssnprintf (vl.type_instance, sizeof (vl.type_instance), "%i", cpu_num);
diff --git a/src/cpusleep.c b/src/cpusleep.c
index 5de0e470bf2c3c1b7bddc1fb465740da2c082ec6..31bb25d67ed4ba618f0133deac0a082d80c5ec13 100644 (file)
--- a/src/cpusleep.c
+++ b/src/cpusleep.c
vl.values = &(value_t) { .derive = cpu_sleep };
vl.values_len = 1;
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, "cpusleep", sizeof(vl.plugin));
sstrncpy(vl.type, "total_time_in_ms", sizeof(vl.type));
diff --git a/src/curl.c b/src/curl.c
index 8401e6ca412e6bc4fd46c17ac4fa391d8ede87ec..1a5258e59552bfc34024e4fc1e8d34c72c533b3e 100644 (file)
--- a/src/curl.c
+++ b/src/curl.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "curl", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, wm->type, sizeof (vl.type));
vl.values = &(value_t) { .gauge = (gauge_t) code };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "curl", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "response_code", sizeof (vl.type));
vl.values = &(value_t) { .gauge = CDTIME_T_TO_DOUBLE (response_time) };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "curl", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "response_time", sizeof (vl.type));
index ffcaa90a118a131e7d727c46e68844670227f2e3..377336f6f18ee7dd022590f1183f32d50a3f6d9f 100644 (file)
vl.values = values;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, data->plugin, sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, data->plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/df.c b/src/df.c
index 632787b22be41b678f68487ac6347a6411c7715e..d9ffa8b16ab32203b51b1ab74179078d5c74f182 100644 (file)
--- a/src/df.c
+++ b/src/df.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "df", sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance,
diff --git a/src/disk.c b/src/disk.c
index 2c0d8b595dfe391e298b2582bd93cdd024c7c778..a07288d13336958f232e9616f93e10084bedcf08 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
@@ -325,7 +324,6 @@ static void submit_io_time (char const *plugin_instance, derive_t io_time, deriv
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "disk_io_time", sizeof (vl.type));
vl.values = &(value_t) { .gauge = in_progress };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "disk", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, disk_name, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "pending_operations", sizeof (vl.type));
diff --git a/src/dns.c b/src/dns.c
index ae53710b24783dbf5193eacd242833e07e6414af..04e5a1e6459671d04aab853256616514a3ad5a32 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
vl.values = &(value_t) { .derive = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "dns", sizeof (vl.plugin));
sstrncpy (vl.type, "dns_octets", sizeof (vl.type));
diff --git a/src/dpdkstat.c b/src/dpdkstat.c
index 584254377b0f5454f3abdd253c2afabecbf17773..0af803f129cefcdc765785a99a25646b1fe164ac 100644 (file)
--- a/src/dpdkstat.c
+++ b/src/dpdkstat.c
const struct rte_eth_xstats *xstats,
uint32_t counters, cdtime_t port_read_time) {
for (uint32_t j = 0; j < counters; j++) {
- value_list_t dpdkstat_vl = VALUE_LIST_INIT;
+ value_list_t vl = VALUE_LIST_INIT;
char *type_end;
- dpdkstat_vl.values = &(value_t){.derive = (derive_t)xstats[j].value};
- dpdkstat_vl.values_len = 1; /* Submit stats one at a time */
- dpdkstat_vl.time = port_read_time;
- sstrncpy(dpdkstat_vl.host, hostname_g, sizeof(dpdkstat_vl.host));
- sstrncpy(dpdkstat_vl.plugin, "dpdkstat", sizeof(dpdkstat_vl.plugin));
- sstrncpy(dpdkstat_vl.plugin_instance, dev_name,
- sizeof(dpdkstat_vl.plugin_instance));
+ vl.values = &(value_t){.derive = (derive_t)xstats[j].value};
+ vl.values_len = 1; /* Submit stats one at a time */
+ vl.time = port_read_time;
+ sstrncpy(vl.plugin, "dpdkstat", sizeof(vl.plugin));
+ sstrncpy(vl.plugin_instance, dev_name,
+ sizeof(vl.plugin_instance));
type_end = strrchr(xstats[j].name, '_');
if ((type_end != NULL) &&
(strncmp(xstats[j].name, "rx_", strlen("rx_")) == 0)) {
if (strncmp(type_end, "_errors", strlen("_errors")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_errors", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_rx_errors", sizeof(vl.type));
} else if (strncmp(type_end, "_dropped", strlen("_dropped")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_dropped", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_rx_dropped", sizeof(vl.type));
} else if (strncmp(type_end, "_bytes", strlen("_bytes")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_octets", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_rx_octets", sizeof(vl.type));
} else if (strncmp(type_end, "_packets", strlen("_packets")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_packets", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_rx_packets", sizeof(vl.type));
} else if (strncmp(type_end, "_placement", strlen("_placement")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_errors", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_rx_errors", sizeof(vl.type));
} else if (strncmp(type_end, "_buff", strlen("_buff")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_rx_errors", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_rx_errors", sizeof(vl.type));
} else {
/* Does not fit obvious type: use a more generic one */
- sstrncpy(dpdkstat_vl.type, "derive", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "derive", sizeof(vl.type));
}
} else if ((type_end != NULL) &&
(strncmp(xstats[j].name, "tx_", strlen("tx_"))) == 0) {
if (strncmp(type_end, "_errors", strlen("_errors")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_tx_errors", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_tx_errors", sizeof(vl.type));
} else if (strncmp(type_end, "_dropped", strlen("_dropped")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_tx_dropped", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_tx_dropped", sizeof(vl.type));
} else if (strncmp(type_end, "_bytes", strlen("_bytes")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_tx_octets", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_tx_octets", sizeof(vl.type));
} else if (strncmp(type_end, "_packets", strlen("_packets")) == 0) {
- sstrncpy(dpdkstat_vl.type, "if_tx_packets", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "if_tx_packets", sizeof(vl.type));
} else {
/* Does not fit obvious type: use a more generic one */
- sstrncpy(dpdkstat_vl.type, "derive", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "derive", sizeof(vl.type));
}
} else if ((type_end != NULL) &&
(strncmp(xstats[j].name, "flow_", strlen("flow_"))) == 0) {
if (strncmp(type_end, "_filters", strlen("_filters")) == 0) {
- sstrncpy(dpdkstat_vl.type, "operations", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "operations", sizeof(vl.type));
} else if (strncmp(type_end, "_errors", strlen("_errors")) == 0) {
- sstrncpy(dpdkstat_vl.type, "errors", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "errors", sizeof(vl.type));
} else if (strncmp(type_end, "_filters", strlen("_filters")) == 0) {
- sstrncpy(dpdkstat_vl.type, "filter_result", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "filter_result", sizeof(vl.type));
}
} else if ((type_end != NULL) &&
(strncmp(xstats[j].name, "mac_", strlen("mac_"))) == 0) {
if (strncmp(type_end, "_errors", strlen("_errors")) == 0) {
- sstrncpy(dpdkstat_vl.type, "errors", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "errors", sizeof(vl.type));
}
} else {
/* Does not fit obvious type, or strrchr error:
* use a more generic type */
- sstrncpy(dpdkstat_vl.type, "derive", sizeof(dpdkstat_vl.type));
+ sstrncpy(vl.type, "derive", sizeof(vl.type));
}
- sstrncpy(dpdkstat_vl.type_instance, xstats[j].name,
- sizeof(dpdkstat_vl.type_instance));
- plugin_dispatch_values(&dpdkstat_vl);
+ sstrncpy(vl.type_instance, xstats[j].name,
+ sizeof(vl.type_instance));
+ plugin_dispatch_values(&vl);
}
}
diff --git a/src/drbd.c b/src/drbd.c
index 70f03cab280ce8426cbaaa99ea8c2f20d244fa4b..40a3eb22fa851b9d969683e8413c37053a640b79 100644 (file)
--- a/src/drbd.c
+++ b/src/drbd.c
}
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "drbd", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/email.c b/src/email.c
index 97fbdfe6f634aa7efefb7ebf157fe1757f6e60b5..1027eb90ad1fed60e77219fa8b71dc399ab315e7 100644 (file)
--- a/src/email.c
+++ b/src/email.c
@@ -657,7 +657,6 @@ static void email_submit (const char *type, const char *type_instance, gauge_t v
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "email", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/entropy.c b/src/entropy.c
index b385c2a75b2d65aaee05ae8046a0806704d92f69..02ea9e113b5b34af4fb6fa3a0d3a157a7fab2274 100644 (file)
--- a/src/entropy.c
+++ b/src/entropy.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "entropy", sizeof (vl.plugin));
sstrncpy (vl.type, "entropy", sizeof (vl.type));
diff --git a/src/ethstat.c b/src/ethstat.c
index f0b8d9f01f6d87c779d56e3d95cf0e5b4384b7cb..6dccb45f14fb7afe536cd8dc5807b5dd6b56ecca 100644 (file)
--- a/src/ethstat.c
+++ b/src/ethstat.c
vl.values = &(value_t) { .derive = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ethstat", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, device, sizeof (vl.plugin_instance));
if (map != NULL)
diff --git a/src/exec.c b/src/exec.c
index dfd4b05f59a95fc5409ab8b6a86aaba00b49df59..3a09cb73cb5447605bbe677017434b4f5616adbf 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
CDTIME_T_TO_DOUBLE (plugin_get_interval ()));
setenv ("COLLECTD_INTERVAL", buffer, /* overwrite = */ 1);
- ssnprintf (buffer, sizeof (buffer), "%s", hostname_g);
+ sstrncpy (buffer, hostname_g, sizeof (buffer));
setenv ("COLLECTD_HOSTNAME", buffer, /* overwrite = */ 1);
#else
ssnprintf (buffer, sizeof (buffer), "COLLECTD_INTERVAL=%.3f",
diff --git a/src/fhcount.c b/src/fhcount.c
index a2f5aa8c9aabf87dc8623b2b9ac99a9023cb84ae..00bd7325a53da8ec48623cb49c612784b9e6a83f 100644 (file)
--- a/src/fhcount.c
+++ b/src/fhcount.c
vl.values_len = 1;
// Compose the metric
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, "fhcount", sizeof(vl.plugin));
sstrncpy(vl.type, type, sizeof(vl.type));
sstrncpy(vl.type_instance, type_instance, sizeof(vl.type_instance));
diff --git a/src/filecount.c b/src/filecount.c
index c1e53a2d52e504845dc6a453acebedf7d3a84b6d..74bc5fb3828bf3006235b47d77c2ea45c14d9a64 100644 (file)
--- a/src/filecount.c
+++ b/src/filecount.c
vl.values = &(value_t) { .gauge = (gauge_t) dir->files_num };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "filecount", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dir->instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "files", sizeof (vl.type));
diff --git a/src/fscache.c b/src/fscache.c
index 33633d63247db02deb1c7a909d228557b90184c2..3a5baf5bb11e1eac7ca367227a32a52bf3d80a62 100644 (file)
--- a/src/fscache.c
+++ b/src/fscache.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy(vl.host, hostname_g, sizeof (vl.host));
sstrncpy(vl.plugin, "fscache", sizeof (vl.plugin));
sstrncpy(vl.plugin_instance, section, sizeof (vl.plugin_instance));
sstrncpy(vl.type, "fscache_stat", sizeof(vl.type));
diff --git a/src/gps.c b/src/gps.c
index d5b7176b44560073260bef643ea88d811ecb80f3..644967b3b7ec79c2bc4e2c977138dd34086041b3 100644 (file)
--- a/src/gps.c
+++ b/src/gps.c
@@ -224,7 +224,6 @@ static void cgps_submit (const char *type, gauge_t value, const char *type_insta
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "gps", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/hddtemp.c b/src/hddtemp.c
index 31960b54e9166b2d3be9eb20f82888668ceb90c0..7ce1e98aa7d4d7c7e1b607e9ccd23386379a62f2 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "hddtemp", sizeof (vl.plugin));
sstrncpy (vl.type, "temperature", sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/hugepages.c b/src/hugepages.c
index f62df8304e7150877cb0eed790b9c866d808b1b8..1eb8b0c271de156c38211fc568e4e00748691801 100644 (file)
--- a/src/hugepages.c
+++ b/src/hugepages.c
vl.values = &(value_t) { .gauge = NAN };
vl.values_len = 1;
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, g_plugin_name, sizeof(vl.plugin));
if (info->node) {
ssnprintf(vl.plugin_instance, sizeof(vl.plugin_instance), "%s-%zuKb",
diff --git a/src/interface.c b/src/interface.c
index 849de955ed1be50916a880c694f6eb6a5a21dbe1..c0021d336c807b26084c94de70f40fde5cfb147c 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "interface", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/ipc.c b/src/ipc.c
index d6d2bbd56850a11ade0239b564f296508417d23f..7f909e26dabad189fc383ab2ff7603ffdcb8bc88 100644 (file)
--- a/src/ipc.c
+++ b/src/ipc.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ipc", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/ipmi.c b/src/ipmi.c
index a42b787fe5a40e1b67126a7eaa884371d91b026e..3267275dadac14d21f24a592658cd952cd829188 100644 (file)
--- a/src/ipmi.c
+++ b/src/ipmi.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ipmi", sizeof (vl.plugin));
sstrncpy (vl.type, list_item->sensor_type, sizeof (vl.type));
sstrncpy (vl.type_instance, list_item->sensor_name, sizeof (vl.type_instance));
diff --git a/src/iptables.c b/src/iptables.c
index 35975e6d8adff4979a18c841fabe57035eec416f..657b6ba0a5c340ca9ace0e8ff6de9c9b93bc0eff 100644 (file)
--- a/src/iptables.c
+++ b/src/iptables.c
return (0);
}
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ip6tables", sizeof (vl.plugin));
status = ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
return (0);
}
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "iptables", sizeof (vl.plugin));
status = ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
diff --git a/src/ipvs.c b/src/ipvs.c
index d2ceb50bc2c8ba6685f0fa69b8d44e6bdacf552c..6bd868eb5b75c4700d68513c8c6088fa52b49c4b 100644 (file)
--- a/src/ipvs.c
+++ b/src/ipvs.c
vl.values = &(value_t) { .derive = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ipvs", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, pi, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "connections", sizeof (vl.type));
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ipvs", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, pi, sizeof (vl.plugin_instance));
sstrncpy (vl.type, t, sizeof (vl.type));
diff --git a/src/irq.c b/src/irq.c
index cb444a47309c1bad1701e7389acd9eec5a037f8f..06c50ff3ab0962efa55ab8e9165edcb36b511ca3 100644 (file)
--- a/src/irq.c
+++ b/src/irq.c
vl.values = &(value_t) { .derive = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "irq", sizeof (vl.plugin));
sstrncpy (vl.type, "irq", sizeof (vl.type));
sstrncpy (vl.type_instance, irq_name, sizeof (vl.type_instance));
diff --git a/src/load.c b/src/load.c
index a3f6bb1f8516c784e226a4cd7e8bc661fd52f41d..53854d148868d0e16f87e3c5f6b2c5653417e6da 100644 (file)
--- a/src/load.c
+++ b/src/load.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "load", sizeof (vl.plugin));
sstrncpy (vl.type, "load", sizeof (vl.type));
diff --git a/src/lpar.c b/src/lpar.c
index 0e32c834506f6aa2cf85b48643e3c5f10ba5c4ae..69a56e1cdea3e9508c0b3bc14ab5aace5a622deb 100644 (file)
--- a/src/lpar.c
+++ b/src/lpar.c
sstrncpy (vl.host, serial, sizeof (vl.host));
sstrncpy (vl.plugin_instance, hostname_g, sizeof (vl.plugin));
}
- else
- {
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
- }
sstrncpy (vl.plugin, "lpar", sizeof (vl.plugin));
sstrncpy (vl.type, "vcpu", sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/lvm.c b/src/lvm.c
index 77cb6eb885c1e6afcbe62b40a60169f3d24ca66e..0d0f524b8bba919fc4bba38c5e1970a81ff44339 100644 (file)
--- a/src/lvm.c
+++ b/src/lvm.c
vl.values = &(value_t) { .gauge = (gauge_t) ivalue };
vl.values_len = 1;
- sstrncpy(vl.host, hostname_g, sizeof (vl.host));
sstrncpy(vl.plugin, "lvm", sizeof (vl.plugin));
sstrncpy(vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy(vl.type, "df_complex", sizeof (vl.type));
diff --git a/src/madwifi.c b/src/madwifi.c
index 42474bc7050c313aa967e8c59a7962dccc47fbaa..82c7e2faaae071cd0d108a9838e9325e0decc4ec 100644 (file)
--- a/src/madwifi.c
+++ b/src/madwifi.c
vl.values = val;
vl.values_len = len;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "madwifi", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/mbmon.c b/src/mbmon.c
index b72be896be4de7b8188ec5222fe8021c08a57d3e..87e54fa18406dd44a4d07a2822b00a90c79083fe 100644 (file)
--- a/src/mbmon.c
+++ b/src/mbmon.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "mbmon", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/md.c b/src/md.c
index db85c46c2891d55195bd2c4d480423f280cfeee5..793b172281c3eb0c22e8f9be8ee221a7f3c93d77 100644 (file)
--- a/src/md.c
+++ b/src/md.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "md", sizeof (vl.plugin));
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%i", minor);
diff --git a/src/memcachec.c b/src/memcachec.c
index 97e75c0c3ff3e49765f8624869a1a0562345da44..766637b7f1a00a4c4003ec75dd59a73557b65ad2 100644 (file)
--- a/src/memcachec.c
+++ b/src/memcachec.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "memcachec", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, wp->instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, wm->type, sizeof (vl.type));
diff --git a/src/memcached.c b/src/memcached.c
index 77cadebb9a2962cc9a953372641325fd7fbe260c..bd83b46eeb26782ea8983cb485e2f233ddba42a9 100644 (file)
--- a/src/memcached.c
+++ b/src/memcached.c
{
char const *host = st->host;
- /* Set vl->host to hostname_g, if:
+ /* Keep default hostname, if:
* - Legacy mode is used.
* - "Socket" option is given (doc: "Host option is ignored").
* - "Host" option is not provided.
* - "Host" option is set to "localhost" or "127.0.0.1". */
- if ((strcmp (st->name, "__legacy__") == 0)
- || (st->socket != NULL)
- || (st->host == NULL)
- || (strcmp ("127.0.0.1", st->host) == 0)
- || (strcmp ("localhost", st->host) == 0))
- host = hostname_g;
+ if ((strcmp (st->name, "__legacy__") != 0)
+ && (st->socket == NULL)
+ && (st->host != NULL)
+ && (strcmp ("127.0.0.1", st->host) != 0)
+ && (strcmp ("localhost", st->host) != 0))
+ sstrncpy (vl->host, host, sizeof (vl->host));
sstrncpy (vl->plugin, "memcached", sizeof (vl->plugin));
- sstrncpy (vl->host, host, sizeof (vl->host));
if (strcmp (st->name, "__legacy__") != 0)
sstrncpy (vl->plugin_instance, st->name, sizeof (vl->plugin_instance));
}
diff --git a/src/memory.c b/src/memory.c
index 16b8e09fbac720d6c32f7a919bf2f46cc793713e..55e7de16e4af6de4a571ec6897353d9af5ff70e5 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
vl.values = v;
vl.values_len = STATIC_ARRAY_SIZE (v);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "memory", sizeof (vl.plugin));
sstrncpy (vl.type, "memory", sizeof (vl.type));
vl.time = cdtime ();
diff --git a/src/mic.c b/src/mic.c
index 5ec382ba10e879bf5f8362578c54f940b77ee157..51e677598d51ab8bf174e7e9990bec99b2afffbc 100644 (file)
--- a/src/mic.c
+++ b/src/mic.c
vl.values = &(value_t) { .gauge = ((gauge_t)value) * 1024.0 };
vl.values_len = 1;
- strncpy (vl.host, hostname_g, sizeof (vl.host));
strncpy (vl.plugin, "mic", sizeof (vl.plugin));
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance), "%i", micnumber);
strncpy (vl.type, "memory", sizeof (vl.type));
diff --git a/src/multimeter.c b/src/multimeter.c
index 2ffcc8f2ca97d2de8743418e051610dd54f22651..9321daf8e9176831903ec89e1aee70def9f5cd3a 100644 (file)
--- a/src/multimeter.c
+++ b/src/multimeter.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "multimeter", sizeof (vl.plugin));
sstrncpy (vl.type, "multimeter", sizeof (vl.type));
diff --git a/src/netapp.c b/src/netapp.c
index e83a475388e5704ac39486a027f502accfcb352a..c532062645b97b2292df079e9fbd2150eb75efa0 100644 (file)
--- a/src/netapp.c
+++ b/src/netapp.c
if (host != NULL)
sstrncpy (vl.host, host, sizeof (vl.host));
- else
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "netapp", sizeof (vl.plugin));
if (plugin_inst != NULL)
sstrncpy (vl.plugin_instance, plugin_inst, sizeof (vl.plugin_instance));
diff --git a/src/netlink.c b/src/netlink.c
index 786056d49341623eff23359af52ba8fb7485eb2a..70c10c9dc88bbc69428b43faa962db6f5532cd43 100644 (file)
--- a/src/netlink.c
+++ b/src/netlink.c
vl.values = &(value_t) { .derive = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "netlink", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/network.c b/src/network.c
index f6815f6db82cfa6f5724e310bf4e18562f81c5dc..484e610053bc3d4248c127de9e82a32dcd693f52 100644 (file)
--- a/src/network.c
+++ b/src/network.c
vl.values = values;
vl.values_len = 2;
vl.time = 0;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "network", sizeof (vl.plugin));
/* Octets received / sent */
diff --git a/src/nfs.c b/src/nfs.c
index c128c8173fea1a494333da877765ab8f9bf208fb..d080cd6e55b4ee782f6704d19a19cdb34a267c9f 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
value_list_t vl = VALUE_LIST_INIT;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "nfs", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/nginx.c b/src/nginx.c
index 3850accf05c663cce1a7f799781c4142b9b7bd80..7283488f5de49189c5d6c5ac9b3df0ee31be40f1 100644 (file)
--- a/src/nginx.c
+++ b/src/nginx.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "nginx", sizeof (vl.plugin));
- sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
if (inst != NULL)
diff --git a/src/ntpd.c b/src/ntpd.c
index ccdecd98302e26362e2c3de949d52f513249c689..7f6f982aac824cc3ef63255bf01b809c3226ea70 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
@@ -317,9 +317,7 @@ static void ntpd_submit (const char *type, const char *type_inst, gauge_t value)
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ntpd", sizeof (vl.plugin));
- sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
diff --git a/src/numa.c b/src/numa.c
index 8f5bf4803821c9fe40be370f4c5c5ee0d4cd4520..e16538324f98aaa881b52c5e8d611a16340e1a28 100644 (file)
--- a/src/numa.c
+++ b/src/numa.c
vl.values = &v;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "numa", sizeof (vl.plugin));
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance), "node%i", node);
sstrncpy (vl.type, "vmpage_action", sizeof (vl.type));
diff --git a/src/olsrd.c b/src/olsrd.c
index 3bf71280b46b51d4e1690472fac2feb1b4633d93..3a36723d6770b212691c696810620f88332957c5 100644 (file)
--- a/src/olsrd.c
+++ b/src/olsrd.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "olsrd", sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance,
diff --git a/src/onewire.c b/src/onewire.c
index 0b4b6f56d5e9a148cc9c2b0ae21a8f7e7fa91b7a..c333fead4455b9e84e0d0653c5712c8fc8d2667d 100644 (file)
--- a/src/onewire.c
+++ b/src/onewire.c
return 0;
}
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "onewire", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, name, sizeof (vl.plugin_instance));
/* traverse list and check entries */
for (traverse = direct_list; traverse != NULL; traverse = traverse->next)
{
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "onewire", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, traverse->address, sizeof (vl.plugin_instance));
diff --git a/src/openldap.c b/src/openldap.c
index dd3226d3a193d1478d8f3ec8ce06b0226b01e9fb..d5e58b1a67d0f9b2295097a7b5705188b517b6dd 100644 (file)
--- a/src/openldap.c
+++ b/src/openldap.c
@@ -169,11 +169,7 @@ static void cldap_submit_value (const char *type, const char *type_instance, /*
vl.values = &value;
vl.values_len = 1;
- if ((st->host == NULL)
- || (strcmp ("", st->host) == 0)
- || (strcmp ("localhost", st->host) == 0))
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
- else
+ if ((st->host != NULL) && (strcmp ("localhost", st->host) != 0))
sstrncpy (vl.host, st->host, sizeof (vl.host));
sstrncpy (vl.plugin, "openldap", sizeof (vl.plugin));
diff --git a/src/openvpn.c b/src/openvpn.c
index 81ffa89988f218edf6ef9b6538b90d43614f1808..1310c00ba45c14f6f8718d34b36b8bdd51254bba 100644 (file)
--- a/src/openvpn.c
+++ b/src/openvpn.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin));
sstrncpy (vl.type, "users", sizeof (vl.type));
if (pinst != NULL)
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin));
if (pinst != NULL)
sstrncpy (vl.plugin_instance, pinst,
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "openvpn", sizeof (vl.plugin));
if (pinst != NULL)
sstrncpy (vl.plugin_instance, pinst,
diff --git a/src/pf.c b/src/pf.c
index d7a5a15cff11b4cd3d2baf07297161fcc56867f3..ecaa869c0658c6a549899288ce18c2e05566b953 100644 (file)
--- a/src/pf.c
+++ b/src/pf.c
vl.values = values;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "pf", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof(vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof(vl.type_instance));
diff --git a/src/pinba.c b/src/pinba.c
index 76b765b8c0b4e096398da12601e64f1f4e06fcbf..5571ff2600b3cd98c5f1c236323fe97d50db26c5 100644 (file)
--- a/src/pinba.c
+++ b/src/pinba.c
value_list_t vl = VALUE_LIST_INIT;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "pinba", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, res->name, sizeof (vl.plugin_instance));
diff --git a/src/ping.c b/src/ping.c
index 39e9de51098ce16f2df873fedfe0a4df95880165..64408491d410c71b7d4f6322b60de8175139660c 100644 (file)
--- a/src/ping.c
+++ b/src/ping.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ping", sizeof (vl.plugin));
- sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
sstrncpy (vl.type_instance, host, sizeof (vl.type_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/powerdns.c b/src/powerdns.c
index eb541800363b2f67a47b6f11812a752bf8b1af3b..7e9e8747cb6e8b2bc5e36ec9b496bb06af5b02cc 100644 (file)
--- a/src/powerdns.c
+++ b/src/powerdns.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "powerdns", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
if (type_instance != NULL)
diff --git a/src/processes.c b/src/processes.c
index f470c84caf27cf02dc7b76feb9a5d6075097c132..4e8ca273cdfee4f587d88244e1be9ccc5c29aae1 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "processes", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
sstrncpy (vl.type, "ps_state", sizeof (vl.type));
value_t values[2];
vl.values = values;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "processes", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, ps->name, sizeof (vl.plugin_instance));
vl.values = &(value_t) { .derive = value };
vl.values_len = 1;
- sstrncpy(vl.host, hostname_g, sizeof (vl.host));
sstrncpy(vl.plugin, "processes", sizeof (vl.plugin));
sstrncpy(vl.plugin_instance, "", sizeof (vl.plugin_instance));
sstrncpy(vl.type, "fork_rate", sizeof (vl.type));
diff --git a/src/protocols.c b/src/protocols.c
index ae35c42533bcf208c8d15829c12f044759974858..f7fd256ba0dae662e06a313413363d7f10d99811 100644 (file)
--- a/src/protocols.c
+++ b/src/protocols.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "protocols", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, protocol_name, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "protocol_counter", sizeof (vl.type));
diff --git a/src/redis.c b/src/redis.c
index 7f57571ed9f1f5f0c60d13531c39d10a4f76a6ff..c3c8efa5c80cc790b8a88ba88f501d70a2512baa 100644 (file)
--- a/src/redis.c
+++ b/src/redis.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "redis", sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance,
diff --git a/src/rrdcached.c b/src/rrdcached.c
index 07eac7b67c1672a6b1da902a03d0c983d1fe2b41..3db89b5e6b2d7336788fdb3c06f69e464367abf4 100644 (file)
--- a/src/rrdcached.c
+++ b/src/rrdcached.c
if (!config_collect_stats)
return (-1);
- if ((strncmp ("unix:", daemon_address, strlen ("unix:")) == 0)
- || (daemon_address[0] == '/'))
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
- else
+ if ((strncmp ("unix:", daemon_address, strlen ("unix:")) != 0)
+ && (daemon_address[0] != '/'))
sstrncpy (vl.host, daemon_address, sizeof (vl.host));
sstrncpy (vl.plugin, "rrdcached", sizeof (vl.plugin));
diff --git a/src/sensors.c b/src/sensors.c
index f13b3ea18f4c294ed30d0d30030bd5d12614c6e9..438cd7464ae09793eb8d52e038b6024519503960 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "sensors", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/serial.c b/src/serial.c
index 482232024123a5f7172588716fe2b5884fe51c92..dc868fc2da3489558eb59ddcbcde29f07d6cdd47 100644 (file)
--- a/src/serial.c
+++ b/src/serial.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "serial", sizeof (vl.plugin));
sstrncpy (vl.type, "serial_octets", sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance,
diff --git a/src/sigrok.c b/src/sigrok.c
index 5b850040f30b4f324e29480172b402e7d55a3ea6..78837cf825a18b57990726e3a84e5f44a1ce663e 100644 (file)
--- a/src/sigrok.c
+++ b/src/sigrok.c
analog = packet->payload;
vl.values = &(value_t) { .gauge = analog->data[0] };
vl.values_len = 1;
- sstrncpy(vl.host, hostname_g, sizeof(vl.host));
sstrncpy(vl.plugin, "sigrok", sizeof(vl.plugin));
- ssnprintf(vl.plugin_instance, sizeof(vl.plugin_instance),
- "%s", cfdev->name);
+ sstrncpy(vl.plugin_instance, cfdev->name, sizeof(vl.plugin_instance));
sstrncpy(vl.type, sigrok_value_type(analog), sizeof(vl.type));
plugin_dispatch_values(&vl);
diff --git a/src/smart.c b/src/smart.c
index 52e78a1586770f0458407459ed82023b70091d52..285eb860e480d7c5944658e793ca9b0a25088768 100644 (file)
--- a/src/smart.c
+++ b/src/smart.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "smart", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
@@ -117,7 +116,6 @@ static void smart_handle_disk_attribute(SkDisk *d, const SkSmartAttributeParsedD
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "smart", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, dev, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "smart_attribute", sizeof (vl.type));
diff --git a/src/statsd.c b/src/statsd.c
index 82ae387b0c4024b3994ae8042538b36f1628df1b..491fe4239d35e4748a34c00931aed3643cc74aff 100644 (file)
--- a/src/statsd.c
+++ b/src/statsd.c
@@ -756,7 +756,6 @@ static int statsd_metric_submit_unsafe (char const *name, statsd_metric_t *metri
vl.values = &(value_t) { .gauge = NAN };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "statsd", sizeof (vl.plugin));
if (metric->type == STATSD_GAUGE)
diff --git a/src/swap.c b/src/swap.c
index 3cc9516e567c07da468c889610eccd4180e4b220..403b148b3c2b8e38f15353251eccf86e44f46a83 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
vl.values = &(value_t) { .gauge = NAN };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance,
vl.values = &(value_t) { .derive = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
sstrncpy (vl.type, "swap_io", sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/table.c b/src/table.c
index 81e946145fd858c0031f3452629b1357ca58d484..7181795ed45c1e18ab3a2e6862e9e61e2fc300e7 100644 (file)
--- a/src/table.c
+++ b/src/table.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "table", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, tbl->instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, res->type, sizeof (vl.type));
diff --git a/src/tail_csv.c b/src/tail_csv.c
index faeb56f8eeb71c7e9a9de03cd98775248b1a7b29..b8cd0b8c9e4d80d6c91a676b9b7b0bc83e258283 100644 (file)
--- a/src/tail_csv.c
+++ b/src/tail_csv.c
vl.values_len = 1;
vl.values = &v;
- sstrncpy(vl.host, hostname_g, sizeof (vl.host));
sstrncpy(vl.plugin, "tail_csv", sizeof(vl.plugin));
if (id->instance != NULL)
sstrncpy(vl.plugin_instance, id->instance, sizeof(vl.plugin_instance));
diff --git a/src/tape.c b/src/tape.c
index 8ec9bf28dcefc303a8e0cbf8495341b46cb508c6..c7d56c736b4a1d1261b165517aede4b32ae7239a 100644 (file)
--- a/src/tape.c
+++ b/src/tape.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "tape", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/tcpconns.c b/src/tcpconns.c
index e74e4bc8856d6360472a44d52a7dae93a3586ca2..8c93405eb57286fe3ce7a012809c57cd32f498a7 100644 (file)
--- a/src/tcpconns.c
+++ b/src/tcpconns.c
{
vl->values = values;
vl->values_len = 1;
- sstrncpy (vl->host, hostname_g, sizeof (vl->host));
sstrncpy (vl->plugin, "tcpconns", sizeof (vl->plugin));
sstrncpy (vl->type, "tcp_connections", sizeof (vl->type));
}
diff --git a/src/teamspeak2.c b/src/teamspeak2.c
index a709e79dd21308f2d8c42551c9e0f619a9a1c1cd..1bd969bd9e158dcbf6d7bb92c5fd9e68f70ce599 100644 (file)
--- a/src/teamspeak2.c
+++ b/src/teamspeak2.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
if (plugin_instance != NULL)
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "teamspeak2", sizeof (vl.plugin));
if (plugin_instance != NULL)
diff --git a/src/ted.c b/src/ted.c
index f167546baf755a19cf400f6ac089e36212020806..001eddf42aede512fd285b045145d52bd95a48d8 100644 (file)
--- a/src/ted.c
+++ b/src/ted.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ted", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/thermal.c b/src/thermal.c
index aa95dac334fa721cea9a1acfc258b3524fb3228e..09d9157efca218771b6c491eb1e4c9d90ebb4b6d 100644 (file)
--- a/src/thermal.c
+++ b/src/thermal.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "thermal", sizeof(vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance,
diff --git a/src/turbostat.c b/src/turbostat.c
index e74cba285ca2ac6f1834f5137fe74b9368ae401e..31321490309d7a63c0fb449e0944e3b1b835042c 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, PLUGIN_NAME, sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
diff --git a/src/uptime.c b/src/uptime.c
index 34c3e85a42bec59b11ff91dc652c8478ed8d50fb..f0e1a6f42df4c48106a128ab2227037aa56f7171 100644 (file)
--- a/src/uptime.c
+++ b/src/uptime.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "uptime", sizeof (vl.plugin));
sstrncpy (vl.type, "uptime", sizeof (vl.type));
diff --git a/src/users.c b/src/users.c
index ce626ae3a902e32d47c410cd354a5afe7b6deb36..e0c5116846cd5d5b3f2add69725118e21fd3f131 100644 (file)
--- a/src/users.c
+++ b/src/users.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "users", sizeof (vl.plugin));
sstrncpy (vl.type, "users", sizeof (vl.plugin));
diff --git a/src/varnish.c b/src/varnish.c
index 18f5902fc686a9005fc2fbc15d7f1c4b917bee1d..e1464dc40cccf155bb2e38514d779feed7dc522e 100644 (file)
--- a/src/varnish.c
+++ b/src/varnish.c
vl.values = &value;
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
-
sstrncpy (vl.plugin, "varnish", sizeof (vl.plugin));
if (plugin_instance == NULL)
plugin_instance = "default";
-
ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
"%s-%s", plugin_instance, category);
diff --git a/src/vmem.c b/src/vmem.c
index 027f7bdde163918eea9cd2b5a60d202bb1c0658f..98c4c2a0592f7c75bcfaf61330ee6f24e95f0ea7 100644 (file)
--- a/src/vmem.c
+++ b/src/vmem.c
vl.values = values;
vl.values_len = values_len;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "vmem", sizeof (vl.plugin));
if (plugin_instance != NULL)
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
diff --git a/src/vserver.c b/src/vserver.c
index f3a2b5a4eeadb8dea5aaaa0ca5bdcb45db41a99b..c6a628eed1d2981e8bd87450048e14ff60ae4b86 100644 (file)
--- a/src/vserver.c
+++ b/src/vserver.c
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "if_octets", sizeof (vl.type));
vl.values = values;
vl.values_len = STATIC_ARRAY_SIZE (values);
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, "load", sizeof (vl.type));
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "vserver", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/wireless.c b/src/wireless.c
index 7d57fea9dc926e3a4423050a26b6428fd0aade53..16aad50f48db267d5aa33adc6b664686efc8c0c1 100644 (file)
--- a/src/wireless.c
+++ b/src/wireless.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "wireless", sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/xencpu.c b/src/xencpu.c
index 93575df22887ff9e3935f9ee741654918079807b..de375d2682a1eb0e281b4d5a711a0f6073139d0b 100644 (file)
--- a/src/xencpu.c
+++ b/src/xencpu.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "xencpu", sizeof (vl.plugin));
sstrncpy (vl.type, "percent", sizeof (vl.type));
sstrncpy (vl.type_instance, "load", sizeof (vl.type_instance));
diff --git a/src/xmms.c b/src/xmms.c
index 2ba30827c608a9ab1c93cbf1373cf1aa43f727a4..5a2774bb033470b79c775266ba4c46114ae7c0dd 100644 (file)
--- a/src/xmms.c
+++ b/src/xmms.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "xmms", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
diff --git a/src/zfs_arc.c b/src/zfs_arc.c
index e4110859ffded2c26915b62b1a49f2fad804b43b..ad287bb107eed0e9e50b2974e95349a779f9d9b2 100644 (file)
--- a/src/zfs_arc.c
+++ b/src/zfs_arc.c
@@ -145,7 +145,6 @@ static void za_submit (const char* type, const char* type_instance, value_t* val
vl.values = values;
vl.values_len = values_len;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "zfs_arc", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/zone.c b/src/zone.c
index d9e46f5ad1ea690ca022b2732c09a3918046f558..bd51c55ec8b53374f2454e2031e4c2e02dd4b4e1 100644 (file)
--- a/src/zone.c
+++ b/src/zone.c
vl.values = values;
vl.values_len = 1; /*STATIC_ARRAY_SIZE (values);*/
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "zone", sizeof (vl.plugin));
sstrncpy (vl.type, "percent", sizeof (vl.type));
sstrncpy (vl.type_instance, zone, sizeof (vl.type_instance));
diff --git a/src/zookeeper.c b/src/zookeeper.c
index 7e551918d2303b5fa68d759a63cc981e4ef20f86..539112e85d1e7120f7aa8be7585f53f9887100f3 100644 (file)
--- a/src/zookeeper.c
+++ b/src/zookeeper.c
vl.values = &(value_t) { .gauge = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "zookeeper", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
if (type_inst != NULL)
vl.values = &(value_t) { .derive = value };
vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "zookeeper", sizeof (vl.plugin));
sstrncpy (vl.type, type, sizeof (vl.type));
if (type_inst != NULL)