zabbix-tools / libzbxpgsql

Monitor PostgreSQL with Zabbix
http://cavaliercoder.com/libzbxpgsql/
Other
157 stars 64 forks source link

Disabling table and index discovery on a huge server #138

Closed ivoras closed 5 years ago

ivoras commented 5 years ago

Hi,

While trying to set up libzbxpgsql to monitor a large server, we encountered a big issue: the Zabbix process was complaining MySQL didn't respond on some queries. I've investigated and it looks like Zabbix was constructing multi-GB SQL query strings which include keys for all tables and indexes on all the databases on the server ... and there are hundreds of thousands of those, spread across hundreds of databases.

So, we're looking for a way to keep auto-discovery of databases, but disable discovery of tables and indexes.

Is that even possible?

ivoras commented 5 years ago

Found it... turns out even the number of databases is too large for Zabbix :(

cavaliercoder commented 5 years ago

This is possible! Simply disable the discovery rules for Indexes and Tables in the template. You can also provide a regex filter for the Database discover rule to target some subset of database.

I strongly recommend triaging any new templates before you apply them to make sure you won't see an explosion in cardinality. On larger scale deployments, I often start by disabling everything and gradually enabling items.