From: Sebastian Harl Date: Tue, 26 Aug 2008 14:14:36 +0000 (+0200) Subject: postgresql plugin: Disable queries that do not include an SQL query string. X-Git-Tag: collectd-4.5.0~30 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=760f0c791b1c403ed53a96e14c50ad1a044af026;p=collectd.git postgresql plugin: Disable queries that do not include an SQL query string. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/postgresql.c b/src/postgresql.c index 046cf5a6..b1de07fd 100644 --- a/src/postgresql.c +++ b/src/postgresql.c @@ -773,6 +773,14 @@ static int c_psql_config_query (oconfig_item_t *ci) else log_warn ("Ignoring unknown config key \"%s\".", c->key); } + + if (NULL == query->query) { + log_err ("Query \"%s\" does not include an SQL query string - " + "please check your configuration.", query->name); + c_psql_query_delete (query); + --queries_num; + return 1; + } return 0; } /* c_psql_config_query */