Defines the "database alias" or "service name" to connect to. Usually, these
names are defined in the file named C<$ORACLE_HOME/network/admin/tnsnames.ora>.
+=item B<Host> I<Host>
+
+Hostname to use when dispatching values for this database. Defaults to using
+the global hostname of the I<collectd> instance.
+
=item B<Username> I<Username>
Username used for authentication.
struct o_database_s
{
char *name;
+ char *host;
char *connect_id;
char *username;
char *password;
return (-1);
}
memset (db, 0, sizeof (*db));
+ db->name = NULL;
+ db->host = NULL;
+ db->connect_id = NULL;
+ db->username = NULL;
+ db->password = NULL;
status = o_config_set_string (&db->name, ci);
if (status != 0)
if (strcasecmp ("ConnectID", child->key) == 0)
status = o_config_set_string (&db->connect_id, child);
+ else if (strcasecmp ("Host", child->key) == 0)
+ status = o_config_set_string (&db->host, child);
else if (strcasecmp ("Username", child->key) == 0)
status = o_config_set_string (&db->username, child);
else if (strcasecmp ("Password", child->key) == 0)
} /* for (j = 1; j <= param_counter; j++) */
/* }}} End of the ``define'' stuff. */
- status = udb_query_prepare_result (q, prep_area, hostname_g,
+ status = udb_query_prepare_result (q, prep_area,
+ (db->host != NULL) ? db->host : hostname_g,
/* plugin = */ "oracle", db->name, column_names, column_num,
/* interval = */ 0);
if (status != 0)