Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for pg96 #33

Open
petercelentano opened this issue Nov 16, 2016 · 2 comments
Open

Support for pg96 #33

petercelentano opened this issue Nov 16, 2016 · 2 comments

Comments

@petercelentano
Copy link

Hello,

There seems to be some issues using pg_monz with PostgreSQL 9.6 databases. Some calls (such as for pg_stat_activity have changed enough that they no longer work properly with pg_monz. I found and fixed that issue locally (by modifying line 34 in pgsql_server_funcs.sh), but there seem to be other functions that do not work (such as cache hit ratio, deadlocks, committed/rolledback transaction, etc).

I've started troubleshooting them and will contribute back any fixes I find, but I am also not sure how the project would like to handle the changes (few people are using pg96 since it is fairly new, but what would be the preferred method to handle different versions of the same functions depending on the pg version)?

@cleitondomazak
Copy link

I had the issue and solved of same way.

And really, those others problem happends to me.

@skrobul
Copy link

skrobul commented Mar 1, 2017

for anyone looking to fix pgsql_server_funcs.sh to work in 9.6:

--- pg_monz/pgsql_server_funcs.sh
+++ pg_monz/pgsql_server_funcs.sh
@@ -32,7 +32,7 @@ case "$APP_NAME" in
                                                union all \
                                                select '\"$HOST_NAME\"', 'psql.idle_tx_connections', $TIMESTAMP_QUERY, (select count(*) from pg_stat_activity where state = 'idle in transaction') \
                                                union all \
-                                               select '\"$HOST_NAME\"', 'psql.locks_waiting', $TIMESTAMP_QUERY, (select count(*) from pg_stat_activity where waiting = 'true') \
+                                               select '\"$HOST_NAME\"', 'psql.locks_waiting', $TIMESTAMP_QUERY, (select count(*) from pg_stat_activity where wait_event IS NOT NULL) \
                                                union all \
                                                select '\"$HOST_NAME\"', 'psql.server_maxcon', $TIMESTAMP_QUERY, (select setting::int from pg_settings where name = 'max_connections')" 2>&1
                                        )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants