From: Sebastian Harl Date: Fri, 26 Mar 2010 20:30:17 +0000 (+0100) Subject: postgresql plugin: Use the "right" `interval' when passing a param to a query. X-Git-Tag: collectd-4.10.0~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87cdeb24ec6f02f623c9077e35904c0b7bec4a93;p=thirdparty%2Fcollectd.git postgresql plugin: Use the "right" `interval' when passing a param to a query. … i.e., use the database specific interval, if configured. --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index 943a08976..e5782e0f5 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -3052,7 +3052,8 @@ The username used to connect to the database. =item I -The interval collectd is using (as specified by the B option). +The interval with which this database is queried (as specified by the database +specific or global B options). =back diff --git a/src/postgresql.c b/src/postgresql.c index 6698e0ee4..0141b23e2 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -315,7 +315,8 @@ static PGresult *c_psql_exec_query_params (c_psql_database_t *db, params[i] = db->user; break; case C_PSQL_PARAM_INTERVAL: - ssnprintf (interval, sizeof (interval), "%i", interval_g); + ssnprintf (interval, sizeof (interval), "%i", + db->interval > 0 ? db->interval : interval_g); params[i] = interval; break; default: