udb_query_prepare_result (q, prep_area, hostname_g,
/* plugin = */ "dbi", db->name,
- column_names, column_num);
+ column_names, column_num, /* interval = */ -1);
/* 0 = error; 1 = success; */
status = dbi_result_first_row (res); /* {{{ */
/* }}} End of the ``define'' stuff. */
status = udb_query_prepare_result (q, prep_area, hostname_g,
- /* plugin = */ "oracle", db->name, column_names, column_num);
+ /* plugin = */ "oracle", db->name, column_names, column_num,
+ /* interval = */ -1);
if (status != 0)
{
ERROR ("oracle plugin: o_read_database_query (%s, %s): "
host = db->host;
status = udb_query_prepare_result (q, prep_area, host, "postgresql",
- db->database, column_names, (size_t) column_num);
+ db->database, column_names, (size_t) column_num, db->interval);
if (0 != status) {
log_err ("udb_query_prepare_result failed with status %i.",
status);
char *plugin;
char *db_name;
+ int interval;
+
udb_result_preparation_area_t *result_prep_areas;
}; /* }}} */
return (-1);
}
+ if (q_area->interval > 0)
+ vl.interval = q_area->interval;
+
sstrncpy (vl.host, q_area->host, sizeof (vl.host));
sstrncpy (vl.plugin, q_area->plugin, sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, q_area->db_name, sizeof (vl.type_instance));
}
}
+ if (q_area->interval > 0)
+ vl.interval = q_area->interval;
+
sstrncpy (vl.host, q_area->host, sizeof (vl.host));
sstrncpy (vl.plugin, q_area->plugin, sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, q_area->db_name, sizeof (vl.type_instance));
sfree (prep_area->plugin);
sfree (prep_area->db_name);
+ prep_area->interval = -1;
+
for (r = q->results, r_area = prep_area->result_prep_areas;
r != NULL; r = r->next, r_area = r_area->next)
{
int udb_query_prepare_result (const udb_query_t const *q, /* {{{ */
udb_query_preparation_area_t *prep_area,
const char *host, const char *plugin, const char *db_name,
- char **column_names, size_t column_num)
+ char **column_names, size_t column_num, int interval)
{
udb_result_preparation_area_t *r_area;
udb_result_t *r;
prep_area->plugin = strdup (plugin);
prep_area->db_name = strdup (db_name);
+ prep_area->interval = interval;
+
if ((prep_area->host == NULL) || (prep_area->plugin == NULL)
|| (prep_area->db_name == NULL))
{
int udb_query_prepare_result (const udb_query_t const *q,
udb_query_preparation_area_t *prep_area,
const char *host, const char *plugin, const char *db_name,
- char **column_names, size_t column_num);
+ char **column_names, size_t column_num, int interval);
int udb_query_handle_result (const udb_query_t const *q,
udb_query_preparation_area_t *prep_area, char **column_values);
void udb_query_finish_result (const udb_query_t const *q,