From 4e3117fff9417061b06d3632544d99678c1943bb Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 20 Jan 2013 15:43:15 +0100 Subject: [PATCH] dbi plugin, collectd.conf(5): Document the "Host" option. Previously called "Hostname". --- src/collectd.conf.in | 1 + src/collectd.conf.pod | 5 +++++ src/dbi.c | 8 ++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 81d70552..dead93b6 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -335,6 +335,7 @@ # #SelectDB "custdb0" # Query "num_of_customers" # #Query "..." +# #Host "..." # # diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 5092bbe6..01346e14 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -1391,6 +1391,11 @@ query needs to be defined I this statement, i.Ee. all query blocks you want to refer to must be placed above the database block you want to refer to them from. +=item B I + +Sets the B field of I to I when dispatching +values. Defaults to the global hostname setting. + =back =head2 Plugin C diff --git a/src/dbi.c b/src/dbi.c index acf3b761..80488d84 100644 --- a/src/dbi.c +++ b/src/dbi.c @@ -48,7 +48,7 @@ struct cdbi_database_s /* {{{ */ char *select_db; char *driver; - char *hostname; + char *host; cdbi_driver_option_t *driver_options; size_t driver_options_num; @@ -298,8 +298,8 @@ static int cdbi_config_add_database (oconfig_item_t *ci) /* {{{ */ 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); @@ -557,7 +557,7 @@ static int cdbi_read_database_query (cdbi_database_t *db, /* {{{ */ 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); -- 2.30.2