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, "");
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));
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;
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
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));