projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a75dbce
)
load plugin: Set the hostname to something meaningfull, not `localhost'.
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Sat, 13 Jan 2007 17:23:15 +0000
(18:23 +0100)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Sat, 13 Jan 2007 17:23:15 +0000
(18:23 +0100)
src/load.c
patch
|
blob
|
history
diff --git
a/src/load.c
b/src/load.c
index
bff629d
..
e715dcf
100644
(file)
--- 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, "");