You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It calculates a percentage per database while max_connections is defined for all databases.
An option should be added to take into account the sum of connections from all databasess.
Regards
The text was updated successfully, but these errors were encountered:
lucie-dubrunfaut
changed the title
centreon/centreon-plugins database::postgres::plugin --mode=backends
Plugin(database::postgres::plugin) - mode(backends): Add an option to take into account the sum of connections from all databasess.
Dec 23, 2024
If I understand correctly what is returned by the query of this plugin, we should have an extract of this form? (I don't have a dataset on which to check the query)
current
mc
datname
5
100
app_db
10
100
other_db
If so, I have a plugin return looking like this with --verboseflag:
OK: All client database connections are ok | 'app_db#database.clients.connected.count'=5;;;0;100'other_db#database.clients.connected.count'=10;;;0;100
Database 'app_db': 5.00% client connections limit reached (5 of max. 100)
Database 'other_db': 10.00% client connections limit reached (10 of max. 100)
So if all this is correct, I'm not sure I understand what you mean by "It calculates a percentage per database while max_connections is defined for all databases."?
Is this related to the nature of the query being made or the format of the data?
This is the query made:
SELECT
COUNT(datid) AS current,
(SELECT setting AS mc FROM pg_settings WHERE name = 'max_connections') AS mc,
d.datname
FROM pg_database d
LEFT JOIN pg_stat_activity s ON (s.datid = d.oid $noidle)
GROUP BY d.datname
ORDER BY d.datname
And for the enhancement suggestion "An option should be added to take into account the sum of connections from all databasess." Do you mean something that would give a "total connections" in this style of return?
OK: All client database connections are ok | 'database.client.total.count'=15;;;0;100 'app_db#database.clients.connected.count'=5;;;0;100'other_db#database.clients.connected.count'=10;;;0;100
Database 'app_db': 5.00% client connections limit reached (5 of max. 100)
Database 'other_db': 10.00% client connections limit reached (10 of max. 100)
Hello
I dont understand this mode.
It calculates a percentage per database while max_connections is defined for all databases.
An option should be added to take into account the sum of connections from all databasess.
Regards
The text was updated successfully, but these errors were encountered: