pg-monz / pg_monz

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

Issue with grpsum and macro #58

Open Denden54 opened 5 years ago

Denden54 commented 5 years ago

I have an issue with the grpsum function for cluster monitoring.

The grpsum is based on this item : psql.primary_server[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR}]

But in the grpsum item, zabbix change the macros with the macros values (so zabbix is looking for the item psql.primary_server["/usr/local/bin","/usr/local/etc"], but the "real item" in the item list of zabbix is show as psql.primary_server[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR}].

Zabbix is sending us the error : No items for key psql.primary_server["/usr/local/bin","/usr/local/etc"] in group(s) MYGROUP"

pengbo0328 commented 4 years ago

You need to create a "PostgreSQL Cluster" host group and add all PostgreSQL host to that group.

Denden54 commented 4 years ago

Hello,

This is not a group issue. All my clusters hosts are in the zabbix group. The zabbix group is set in the macro as the documentation recquire.

The issue is that the grpsum command is looking for "psql.primary_server["/usr/local/bin","/usr/local/etc"]" item in hosts in the groups definied. But the item in the host item lists is "psql.primary_server[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR}]". So for zabbix, it's not the same item.

To resolve this issue, i had to remove macro in the item and use directly the path of script and conf in the items.

pengbo0328 commented 4 years ago

Which template did you apply to each PostgreSQL host? If you linked the template "Template App PostgreSQL" to each PostgreSQL host, then the macro $PGSCRIPTDIR and {$PGSCRIPT_CONFDIR} will be expanded in the host item, because the the macros are defined in the template "Template App PostgreSQL".