summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 41c58bb)
raw | patch | inline | side by side (parent: 41c58bb)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 28 Feb 2007 09:41:55 +0000 (10:41 +0100) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Wed, 28 Feb 2007 09:41:55 +0000 (10:41 +0100) |
hostname_g: Hostname we're running on. May be set in the configfile with the
`Hostname'-option. This replaces the global `hostname'-variable exported by
`plugin.c'.
interval_g: Interval in which we query the read plugins. This replaces the
`COLLECTD_STEP'-define and is configurable using the `Interval'-option.
`Hostname'-option. This replaces the global `hostname'-variable exported by
`plugin.c'.
interval_g: Interval in which we query the read plugins. This replaces the
`COLLECTD_STEP'-define and is configurable using the `Interval'-option.
35 files changed:
diff --git a/src/apache.c b/src/apache.c
index 5156ff66de6d91b080b010e2c7b221f85712ad88..973ad8656ef4f3c3b288ae1db04a46ae7ee63e27 100644 (file)
--- a/src/apache.c
+++ b/src/apache.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "apache");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "apache");
strcpy (vl.plugin_instance, "");
diff --git a/src/apcups.c b/src/apcups.c
index 3060e18c8a66965fbf5955b8fb48bc03e4fa39b3..e23bc9e130b91053109e4dcea06785bd95a4481d 100644 (file)
--- a/src/apcups.c
+++ b/src/apcups.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "apcups");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
diff --git a/src/apple_sensors.c b/src/apple_sensors.c
index 33660a92e5268e4e71a9ea31aa87c1348718ea12..29d509157723e7939acbf2988ad899764025010e 100644 (file)
--- a/src/apple_sensors.c
+++ b/src/apple_sensors.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "apple_sensors");
strcpy (vl.plugin_instance, "");
strcpy (vl.type_instance, type_instance);
diff --git a/src/battery.c b/src/battery.c
index e52c2c80657d9c97f114116202fee105a38ae1eb..8a74b3db2768e7e71088dfe895356883402bf20a 100644 (file)
--- a/src/battery.c
+++ b/src/battery.c
@@ -132,7 +132,7 @@ static void battery_submit (const char *plugin_instance, const char *type, doubl
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "battery");
strcpy (vl.plugin_instance, plugin_instance);
diff --git a/src/collectd.c b/src/collectd.c
index ab5564ead694502e0dd510804a406a1bf4e7376c..68a70bacd90e66fccd80fb46a8a5af1f6d1d8525 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
#include "plugin.h"
#include "configfile.h"
-static int loop = 0;
-
+/*
+ * Global variables
+ */
+char hostname_g[DATA_MAX_NAME_LEN];
+int interval_g;
#if HAVE_LIBKSTAT
kstat_ctl_t *kc;
#endif /* HAVE_LIBKSTAT */
-/*
- * exported variables
- */
-time_t curtime;
+static int loop = 0;
static void sigIntHandler (int signal)
{
loop++;
}
+static int init_global_variables (void)
+{
+ const char *str;
+
+ str = global_option_get ("Hostname");
+ if (str != NULL)
+ {
+ strncpy (hostname_g, str, sizeof (hostname_g));
+ }
+ else
+ {
+ if (gethostname (hostname_g, sizeof (hostname_g)) != 0)
+ {
+ fprintf (stderr, "`gethostname' failed and no "
+ "hostname was configured.\n");
+ return (-1);
+ }
+ }
+ DBG ("hostname_g = %s;", hostname_g);
+
+ str = global_option_get ("Interval");
+ if (str == NULL)
+ str = COLLECTD_STEP;
+ interval_g = atoi (str);
+ if (interval_g <= 0)
+ {
+ fprintf (stderr, "Cannot set the interval to a correct value.\n"
+ "Please check your settings.\n");
+ return (-1);
+ }
+ DBG ("interval_g = %i;", interval_g);
+
+ return (0);
+} /* int init_global_variables */
+
static int change_basedir (const char *orig_dir)
{
char *dir = strdup (orig_dir);
static int do_loop (void)
{
- int step;
-
struct timeval tv_now;
struct timeval tv_next;
struct timespec ts_wait;
- step = atoi (COLLECTD_STEP);
- if (step <= 0)
- step = 10;
-
while (loop == 0)
{
if (gettimeofday (&tv_next, NULL) < 0)
syslog (LOG_ERR, "gettimeofday failed: %s", strerror (errno));
return (-1);
}
- tv_next.tv_sec += step;
+ tv_next.tv_sec += interval_g;
#if HAVE_LIBKSTAT
update_kstat ();
#endif
- /* `curtime' is used by many (all?) plugins as the
- * data-sample-time passed to RRDTool */
- curtime = time (NULL);
/* Issue all plugins */
plugin_read_all (&loop);
struct sigaction sigIntAction;
struct sigaction sigTermAction;
char *configfile = CONFIGFILE;
- const char *datadir;
+ const char *basedir;
#if COLLECT_DAEMON
struct sigaction sigChldAction;
pid_t pid;
* Change directory. We do this _after_ reading the config and loading
* modules to relative paths work as expected.
*/
- if ((datadir = global_option_get ("BaseDir")) == NULL)
+ if ((basedir = global_option_get ("BaseDir")) == NULL)
{
- fprintf (stderr, "Don't have a datadir to use. This should not happen. Ever.");
+ fprintf (stderr, "Don't have a basedir to use. This should not happen. Ever.");
return (1);
}
- else if (change_basedir (datadir))
+ else if (change_basedir (basedir))
{
- fprintf (stderr, "Error: Unable to change to directory `%s'.\n", datadir);
+ fprintf (stderr, "Error: Unable to change to directory `%s'.\n", basedir);
return (1);
}
+ /*
+ * Set global variables or, if that failes, exit. We cannot run with
+ * them being uninitialized. If nothing is configured, then defaults
+ * are being used. So this means that the user has actually done
+ * something wrong.
+ */
+ if (init_global_variables () != 0)
+ return (1);
+
#if COLLECT_DAEMON
/*
* fork off child
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index ecf7ef687bfd448df5a0cbcc2a0cd0a9aaac0832..3d387079b4134c5e115636b6b6fa6e0edf04e9b2 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
Sets the file to write debugging output to. This is only used if compiled with
debugging enabled. It's ignored otherwise.
+=item B<Interval> I<Seconds>
+
+Configures the interval in which to query the read plugins. Obviously smaller
+values lead to a higher system load produces by collectd, while higher values
+lead to more coarse statistics. Please note that changing this value may render
+your RRD-files unuseable, if you use the C<rrdtool plugin>. You have been
+warned.
+
=back
=head1 PLUGIN OPTIONS
diff --git a/src/collectd.h b/src/collectd.h
index 7784d5540845de90172ac9da7662fcbd442df139..c544bf5cbffa7623ee19a4d835817b6b6dbc59e1 100644 (file)
--- a/src/collectd.h
+++ b/src/collectd.h
#define STATIC_ARRAY_LEN(array) (sizeof (array) / sizeof ((array)[0]))
-extern time_t curtime;
-
-int pidfile_set (const char *file);
-const char *pidfile_get (void);
+extern char hostname_g[];
+extern int interval_g;
/* int main (int argc, char **argv); */
diff --git a/src/configfile.c b/src/configfile.c
index a8f902fd20823f80283375b739e3563915b9a3c5..a5ae4961fda2bfd5901c41d19b164a75eb781410 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
static cf_global_option_t cf_global_options[] =
{
- {"BaseDir", NULL, PKGLOCALSTATEDIR},
- {"LogFile", NULL, LOGFILE},
- {"PIDFile", NULL, PIDFILE}
+ {"BaseDir", NULL, PKGLOCALSTATEDIR},
+ {"LogFile", NULL, LOGFILE},
+ {"PIDFile", NULL, PIDFILE},
+ {"Hostname", NULL, NULL},
+ {"Interval", NULL, "10"}
};
static int cf_global_options_num = STATIC_ARRAY_LEN (cf_global_options);
{
int i;
+ DBG ("option = %s; value = %s;", option, value);
+
for (i = 0; i < cf_global_options_num; i++)
if (strcasecmp (cf_global_options[i].key, option) == 0)
break;
diff --git a/src/cpu.c b/src/cpu.c
index 437f7587366eb86df69c856bbb5d1a6baf016d2f..285841e4d8b93d3f4c475653a791194450171848 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "cpu");
snprintf (vl.plugin_instance, sizeof (vl.type_instance),
"%i", cpu_num);
diff --git a/src/cpufreq.c b/src/cpufreq.c
index e53e49523814264bfc03ce900165cf70fa1dc835..008ef39f1029b128c0d237994cb4293e5c9a9dff 100644 (file)
--- a/src/cpufreq.c
+++ b/src/cpufreq.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "cpufreq");
snprintf (vl.type_instance, sizeof (vl.type_instance),
"%i", cpu_num);
diff --git a/src/df.c b/src/df.c
index dd5e13824660c34da87231606029531fed4e99eb..fde5d9ae503692b492286604f561c747350f850a 100644 (file)
--- a/src/df.c
+++ b/src/df.c
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "df");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, df_name, sizeof (vl.type_instance));
diff --git a/src/disk.c b/src/disk.c
index 3cb86e7e29149e3fb0fa5e0f5a053ffef6924f50..af7c01a60e39da34d92635d9c0b9a0c5b1276621 100644 (file)
--- a/src/disk.c
+++ b/src/disk.c
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "disk");
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/dns.c b/src/dns.c
index 332ef0ea2c25a2305e1d08255e2cdf57e33f3232..56df1845ad512a3ea3c2e0f3f6061cd7760bb097 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "dns");
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "dns");
plugin_dispatch_values ("dns_octets", &vl);
diff --git a/src/entropy.c b/src/entropy.c
index 7e0a8174cf36ff6b62d18102fa85afd531939581..68c57daf1220b48682185be6490f42d37fd4580f 100644 (file)
--- a/src/entropy.c
+++ b/src/entropy.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "entropy");
strcpy (vl.plugin_instance, "");
strcpy (vl.type_instance, "");
diff --git a/src/exec.c b/src/exec.c
index 836c881d5dfe0b93bf526ae82e6b880b3515c4a0..ee8f8bf9886a38136a9f3dafec6cec1801c6aa7a 100644 (file)
--- a/src/exec.c
+++ b/src/exec.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "exec");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "exec");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/hddtemp.c b/src/hddtemp.c
index 3f37d507977e86f91ba1a7c5d6a835cfd941f303..03990f223d5d2892829aa36a24021d1cacc70d2a 100644 (file)
--- a/src/hddtemp.c
+++ b/src/hddtemp.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "hddtemp");
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/irq.c b/src/irq.c
index 6e1f92ec112ed210bc10ff00f51b1f5cb9fa74b0..5826dc3d8fe3db46d44bb258f65ee06773d60e3c 100644 (file)
--- a/src/irq.c
+++ b/src/irq.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "irq");
status = snprintf (vl.type_instance, sizeof (vl.type_instance),
diff --git a/src/load.c b/src/load.c
index 491a985e432c1752a504f9f953808741c93ad76a..4b36221375245f6012cba5618df101743ca67f9c 100644 (file)
--- a/src/load.c
+++ b/src/load.c
vl.values = values;
vl.values_len = 3;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "load");
strcpy (vl.plugin_instance, "");
strcpy (vl.type_instance, "");
diff --git a/src/mbmon.c b/src/mbmon.c
index 0d9cd163215b1fd63dffca298c9cbaa3235e8fd2..e03f2f9b627d5ad61454e4ccd77993e5d74ecd3f 100644 (file)
--- a/src/mbmon.c
+++ b/src/mbmon.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "mbmon");
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/memory.c b/src/memory.c
index d92ecf30550dd56097c41f9d0108f3b3b18193d6..38a6dc2d3474d4d1d8924be78f1cd1bea95b44ce 100644 (file)
--- a/src/memory.c
+++ b/src/memory.c
vl.values = values;
vl.values_len = 4;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "memory");
plugin_dispatch_values ("memory", &vl);
diff --git a/src/multimeter.c b/src/multimeter.c
index d1cf1903e8f64d5ae5c3af9af202f1178c6b429c..8cb18c81227ae84e714f2f5a37eff8533250966b 100644 (file)
--- a/src/multimeter.c
+++ b/src/multimeter.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "multimeter");
plugin_dispatch_values ("multimeter", &vl);
diff --git a/src/mysql.c b/src/mysql.c
index a928172b51126abbb64cb093ca8bd90a171b5f6a..a2604e409629d3b6874036bac2a01bc4231a942e 100644 (file)
--- a/src/mysql.c
+++ b/src/mysql.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "mysql");
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 5;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "mysql");
plugin_dispatch_values ("mysql_qcache", &vl);
vl.values = values;
vl.values_len = 4;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "mysql");
plugin_dispatch_values ("mysql_threads", &vl);
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "mysql");
plugin_dispatch_values ("mysql_octets", &vl);
diff --git a/src/nfs.c b/src/nfs.c
index 1dc64b78a1d948a2b9112ceb3c9484691f60042a..004c8f5e968a9305be5a4c7e2eafbb0f3438ab97 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "nfs");
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/ntpd.c b/src/ntpd.c
index 366c24b485f61939c4646bf1755245e2f7349c47..e4a230b3cc7942ea39b4707f6656b59d365bd19f 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "ntpd");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, type_inst, sizeof (vl.type_instance));
diff --git a/src/ping.c b/src/ping.c
index 61bad09fd2807385f4594e12d433ebe63feabb3c..48cea55c57f6e173d348e280d0f12bba976404ce 100644 (file)
--- a/src/ping.c
+++ b/src/ping.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "ping");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, host, sizeof (vl.type_instance));
diff --git a/src/plugin.c b/src/plugin.c
index 1a029e40ba5060375865723859fec957787fa780..852a693e23ea5dc9bebd41cf96aae0aa9070fddc 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
static char *plugindir = NULL;
-char hostname[DATA_MAX_NAME_LEN] = "localhost";
-
/*
* Static functions
*/
llentry_t *le;
int status;
- gethostname (hostname, sizeof (hostname));
-
if (list_init == NULL)
return;
diff --git a/src/plugin.h b/src/plugin.h
index b0bdbee12f164a3fc96b0c1bd4f1d85f69c44998..ef84a46f5da0c85b84d7b0297df53a09fe3e19cd 100644 (file)
--- a/src/plugin.h
+++ b/src/plugin.h
unsigned int delay; /* how many more iterations we still need to wait */
} complain_t;
-extern char hostname[DATA_MAX_NAME_LEN];
-
/*
* NAME
* plugin_set_dir
diff --git a/src/processes.c b/src/processes.c
index c22f0f6f8265e160f61971624a58955744c24638..37d0a75ec0ba70d87175eec77fd026f28b9cfc99 100644 (file)
--- a/src/processes.c
+++ b/src/processes.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "processes");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, state, sizeof (vl.type_instance));
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "processes");
strncpy (vl.plugin_instance, ps->name, sizeof (vl.plugin_instance));
diff --git a/src/rrdtool.c b/src/rrdtool.c
index 91be7b616754b730fef9dd57f5676ddb4b443dfc..8154df9d8d53d5d6d4c2620b68f72d431781dd1e 100644 (file)
--- a/src/rrdtool.c
+++ b/src/rrdtool.c
return (-1);
memset (rra_def, '\0', (rra_max + 1) * sizeof (char *));
- step = atoi (COLLECTD_STEP);
+ step = interval_g;
+ /* FIXME: Use config here */
rows = atoi (COLLECTD_ROWS);
if ((step <= 0) || (rows <= 0))
char **ds_def;
int ds_num;
int i, j;
+ char step[16];
int status = 0;
if (check_create_dir (filename))
return (-1);
}
+ status = snprintf (step, sizeof (step), "%i", interval_g);
+ if ((status < 1) || (status >= sizeof (step)))
+ {
+ syslog (LOG_ERR, "rrdtool plugin: snprintf failed.");
+ return (-1);
+ }
+
argv[0] = "create";
argv[1] = filename;
argv[2] = "-s";
- argv[3] = COLLECTD_STEP;
+ argv[3] = step;
j = 4;
for (i = 0; i < ds_num; i++)
diff --git a/src/sensors.c b/src/sensors.c
index 99b925685fa755de65013176d98a6e8cdaff8926..b1454a6e7e970c7cdf706ce92a408e750372f530 100644 (file)
--- a/src/sensors.c
+++ b/src/sensors.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "sensors");
strcpy (vl.plugin_instance, plugin_instance);
strcpy (vl.type_instance, type_instance);
diff --git a/src/serial.c b/src/serial.c
index 6ca752c6bc5e2141810c6d8aa6378daf03486035..8f8e433b8f494a5f3eee387ca594657b802b6a07 100644 (file)
--- a/src/serial.c
+++ b/src/serial.c
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "serial");
strncpy (vl.type_instance, type_instance,
sizeof (vl.type_instance));
diff --git a/src/swap.c b/src/swap.c
index f03a5a9ef930186ecf7e4461b795fff6918da039..8e040443773eab4bab77d3d7498b7e5058d6f24e 100644 (file)
--- a/src/swap.c
+++ b/src/swap.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "swap");
strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
diff --git a/src/tape.c b/src/tape.c
index e0b8b51199bd0ff948764d29a283d65b5a9abb62..85a63a8965b14f6984c9b6874c918b3befe336b6 100644 (file)
--- a/src/tape.c
+++ b/src/tape.c
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "tape");
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/traffic.c b/src/traffic.c
index 5fc55d757eecf414fb2e9d232289b38822f1f450..619208c88438e3bc4b352057166a9f8741c85ca9 100644 (file)
--- a/src/traffic.c
+++ b/src/traffic.c
vl.values = values;
vl.values_len = 2;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "interface");
strncpy (vl.type_instance, dev, sizeof (vl.type_instance));
diff --git a/src/wireless.c b/src/wireless.c
index 929d5d8a711608dc6c7b47e3dd025e3a8dbe058c..104145315b88a9aa3e366f6adf2bf24fb7402e96 100644 (file)
--- a/src/wireless.c
+++ b/src/wireless.c
vl.values = values;
vl.values_len = 1;
vl.time = time (NULL);
- strcpy (vl.host, hostname);
+ strcpy (vl.host, hostname_g);
strcpy (vl.plugin, "wireless");
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));