From: Florian Forster Date: Sat, 13 Jan 2007 17:23:15 +0000 (+0100) Subject: load plugin: Set the hostname to something meaningfull, not `localhost'. X-Git-Tag: collectd-4.0.0~239 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;ds=sidebyside;h=f90d9e5891832703b3a6af2b72aefbecd091b406;p=collectd.git load plugin: Set the hostname to something meaningfull, not `localhost'. --- diff --git a/src/load.c b/src/load.c index bff629dc..e715dcf9 100644 --- a/src/load.c +++ b/src/load.c @@ -68,7 +68,14 @@ static void load_submit (double snum, double mnum, double lnum) vl.values = values; vl.values_len = 3; - strcpy (vl.host, "localhost"); /* FIXME */ + vl.time = time (NULL); + /* FIXME: do this globally */ + if (gethostname (vl.host, sizeof (vl.host)) != 0) + { + syslog (LOG_ERR, "load plugin: gethostname failed: %s", + strerror (errno)); + return; + } strcpy (vl.plugin, "load"); strcpy (vl.plugin_instance, ""); strcpy (vl.type_instance, "");