pg-monz / pg_monz

This is the Zabbix monitoring template for PostgreSQL Database.
Apache License 2.0
164 stars 81 forks source link

pg.stat_table: Zabbix trapper unsupported if table created with double quotes #48

Open andreyhammer opened 5 years ago

andreyhammer commented 5 years ago

If table created like: CREATE TABLE "Table" ( ... ); pgsql_tbl_funcs.sh return error like: relation public.table not found because public.table != public.Table I fixed this issue by addin double quotes around ${TABLENAME} in select pg_total_relation_size: select '\"$HOST_NAME\"', 'psql.table_total_size[$DBNAME,$SCHEMANAME,$TABLENAME]', $TIMESTAMP_QUERY, (select pg_total_relation_size('${SCHEMANAME}.\"${TABLENAME}\"'))" 2>&1

please review and fix if necessary

pengbo0328 commented 5 years ago

Thank you for reporting this issue.

I will test the fix.

pengbo0328 commented 5 years ago

I fixed this issue: https://github.com/pg-monz/pg_monz/commit/8c35c6324e6044ccf75f92278fb3c70aea9c4c9e

Thank you for your report. Could you close this issue.