summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 020e7b3)
raw | patch | inline | side by side (parent: 020e7b3)
author | Florian Forster <sifnfors@faui06.informatik.uni-erlangen.de> | |
Mon, 15 Jan 2007 13:00:10 +0000 (14:00 +0100) | ||
committer | Florian Forster <sifnfors@faui06.informatik.uni-erlangen.de> | |
Mon, 15 Jan 2007 13:00:10 +0000 (14:00 +0100) |
src/load.c | patch | blob | history | |
src/nfs.c | patch | blob | history | |
src/plugin.c | patch | blob | history | |
src/plugin.h | patch | blob | history | |
src/traffic.c | patch | blob | history |
diff --git a/src/load.c b/src/load.c
index 2cc761b6557fc782e08f0da1878d02970b75446a..3e60a43c021c423bcfdc4502cd979ea071c1fe59 100644 (file)
--- a/src/load.c
+++ b/src/load.c
vl.values = values;
vl.values_len = 3;
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.host, hostname);
strcpy (vl.plugin, "load");
strcpy (vl.plugin_instance, "");
strcpy (vl.type_instance, "");
diff --git a/src/nfs.c b/src/nfs.c
index d6e8516812721898633d2903321426e79516eadc..f585b974d227cbedc006446e32c584b07509e169 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
vl.values = values;
vl.values_len = 1;
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.host, hostname);
strcpy (vl.plugin, "nfs");
strncpy (vl.plugin_instance, plugin_instance,
sizeof (vl.plugin_instance));
diff --git a/src/plugin.c b/src/plugin.c
index 857643d023452452ce5b2bf59a8e94230dfe7bbf..b40d62a102fc1c9fd0dc7a39da539f0e1f049d4d 100644 (file)
--- a/src/plugin.c
+++ b/src/plugin.c
static char *plugindir = NULL;
+char hostname[DATA_MAX_NAME_LEN] = "localhost";
+
/*
* Static functions
*/
int (*callback) (void);
llentry_t *le;
+ gethostname (hostname, sizeof (hostname));
+
if (list_init == NULL)
return;
le = llist_search (list_data_set, name);
if (le == NULL)
+ {
+ DBG ("No such dataset registered: %s", name);
return (-1);
+ }
ds = (data_set_t *) le->value;
diff --git a/src/plugin.h b/src/plugin.h
index 3b94ff71a4f6ea3e398fc5249a39bb945c5da41d..107078e7ca6e75909d3ecd6559749a37575009e8 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/traffic.c b/src/traffic.c
index 59b59e8347f1dea5725ad538c79a20db586445da..5c5e4f74efd7ccae34180706c7dd7f4456a655b2 100644 (file)
--- a/src/traffic.c
+++ b/src/traffic.c
vl.values = values;
vl.values_len = 2;
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.host, hostname);
strcpy (vl.plugin, "interface");
strcpy (vl.plugin_instance, "");
strncpy (vl.type_instance, dev, sizeof (vl.type_instance));