summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f229efa)
raw | patch | inline | side by side (parent: f229efa)
author | Florian Forster <octo@collectd.org> | |
Sun, 20 Jan 2013 14:43:15 +0000 (15:43 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sun, 20 Jan 2013 14:43:15 +0000 (15:43 +0100) |
Previously called "Hostname".
src/collectd.conf.in | patch | blob | history | |
src/collectd.conf.pod | patch | blob | history | |
src/dbi.c | patch | blob | history |
diff --git a/src/collectd.conf.in b/src/collectd.conf.in
index 81d70552801bc6ce78a2adba2024a91bb990e766..dead93b6154985d67cfb7269e5fcbbc1ae5ad70a 100644 (file)
--- a/src/collectd.conf.in
+++ b/src/collectd.conf.in
# #SelectDB "custdb0"
# Query "num_of_customers"
# #Query "..."
+# #Host "..."
# </Database>
#</Plugin>
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 5092bbe66cf10e77391c24218ec5c8193dba55e2..01346e14ca29e275351659575dc7e7ff05eb352d 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
blocks you want to refer to must be placed above the database block you want to
refer to them from.
+=item B<Host> I<Hostname>
+
+Sets the B<host> field of I<value lists> to I<Hostname> when dispatching
+values. Defaults to the global hostname setting.
+
=back
=head2 Plugin C<df>
diff --git a/src/dbi.c b/src/dbi.c
index acf3b7612b9d2a853b8fc1fb0852708cc0a6d630..80488d8478f6df99c748de2e4e39e872b1236701 100644 (file)
--- a/src/dbi.c
+++ b/src/dbi.c
char *select_db;
char *driver;
- char *hostname;
+ char *host;
cdbi_driver_option_t *driver_options;
size_t driver_options_num;
else if (strcasecmp ("Query", child->key) == 0)
status = udb_query_pick_from_list (child, queries, queries_num,
&db->queries, &db->queries_num);
- else if (strcasecmp ("Hostname", child->key) == 0)
- status = cf_util_get_string (child, &db->hostname);
+ else if (strcasecmp ("Host", child->key) == 0)
+ status = cf_util_get_string (child, &db->host);
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, (db->hostname ? db->hostname : hostname_g),
+ udb_query_prepare_result (q, prep_area, (db->host ? db->host : hostname_g),
/* plugin = */ "dbi", db->name,
column_names, column_num, /* interval = */ 0);