This is a deprecated synonym for B<Statement>. It will be removed in version 5
of collectd.
-=item B<Param> I<hostname>|I<database>|I<username>
+=item B<Param> I<hostname>|I<database>|I<username>|I<interval>
Specify the parameters which should be passed to the SQL query. The parameters
are referred to in the SQL query as B<$1>, B<$2>, etc. in the same order as
The username used to connect to the database.
+=item I<interval>
+
+The interval collectd is using (as specified by the B<Interval> option).
+
=back
Please note that parameters are only supported by PostgreSQL's protocol
C_PSQL_PARAM_HOST = 1,
C_PSQL_PARAM_DB,
C_PSQL_PARAM_USER,
+ C_PSQL_PARAM_INTERVAL,
} c_psql_param_t;
typedef struct {
c_psql_query_t *query)
{
char *params[db->max_params_num];
+ char interval[64];
int i;
assert (db->max_params_num >= query->params_num);
case C_PSQL_PARAM_USER:
params[i] = db->user;
break;
+ case C_PSQL_PARAM_INTERVAL:
+ ssnprintf (interval, sizeof (interval), "%i", interval_g);
+ params[i] = interval;
+ break;
default:
assert (0);
}
param = C_PSQL_PARAM_DB;
else if (0 == strcasecmp (param_str, "username"))
param = C_PSQL_PARAM_USER;
+ else if (0 == strcasecmp (param_str, "interval"))
+ param = C_PSQL_PARAM_INTERVAL;
else {
log_err ("Invalid parameter \"%s\".", param_str);
return 1;