[collectd] [PATCH 1/3] postgresql plugin: Disable queries that do not include an SQL query string.
Sebastian Harl
sh at tokkee.org
Tue Aug 26 16:14:36 CEST 2008
Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
src/postgresql.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/src/postgresql.c b/src/postgresql.c
index 046cf5a..b1de07f 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 */
--
1.6.0.90.g436ed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080826/9ff3da1f/attachment.pgp
More information about the collectd
mailing list