summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9e46dab)
raw | patch | inline | side by side (parent: 9e46dab)
author | Florian Forster <octo@collectd.org> | |
Thu, 14 Jun 2012 12:46:03 +0000 (14:46 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 14 Jun 2012 12:46:03 +0000 (14:46 +0200) |
src/collectd.conf.pod | patch | blob | history | |
src/oracle.c | patch | blob | history |
diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod
index 5fee0d00e7b292498aa8f3b47bfa0fd273052f2c..66ead9c57e83ddc5fdf784b3c5d8468c1dda290c 100644 (file)
--- a/src/collectd.conf.pod
+++ b/src/collectd.conf.pod
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.
diff --git a/src/oracle.c b/src/oracle.c
index 4415b489e6d55c0712840f1313b65be5af11072c..05213e010feb91e715c59dfb3c072069494ac95f 100644 (file)
--- a/src/oracle.c
+++ b/src/oracle.c
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)