From f90d9e5891832703b3a6af2b72aefbecd091b406 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sat, 13 Jan 2007 18:23:15 +0100 Subject: [PATCH] load plugin: Set the hostname to something meaningfull, not `localhost'. --- src/load.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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, ""); -- 2.30.2