summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b49c1ce)
raw | patch | inline | side by side (parent: b49c1ce)
author | Daniel Hilst <danielhislt@gmail.com> | |
Thu, 3 Jan 2013 20:09:03 +0000 (18:09 -0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Fri, 18 Jan 2013 10:38:19 +0000 (11:38 +0100) |
src/dbi.c | patch | blob | history |
diff --git a/src/dbi.c b/src/dbi.c
index b3bdd13081d47484a5e3e96b3736d1e0832c8c61..7067a2d4a8231674a0745e3c321d194e610aac1b 100644 (file)
--- a/src/dbi.c
+++ b/src/dbi.c
char *select_db;
char *driver;
- char *hostname;
+ char *hostname;
cdbi_driver_option_t *driver_options;
size_t driver_options_num;
status = udb_query_pick_from_list (child, queries, queries_num,
&db->queries, &db->queries_num);
else if (strcasecmp ("Hostname", child->key) == 0)
- db->hostname = strdup(child->key);
-
+ status = cdbi_config_set_string(&db->hostname, child);
else
{
WARNING ("dbi plugin: Option `%s' not allowed here.", child->key);
sstrncpy (column_names[i], column_name, DATA_MAX_NAME_LEN);
} /* }}} for (i = 0; i < column_num; i++) */
- udb_query_prepare_result (q, prep_area, hostname_g,
+ udb_query_prepare_result (q, prep_area, (db->hostname ? db->hostname : hostname_g),
/* plugin = */ "dbi", db->name,
column_names, column_num, /* interval = */ 0);