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

PgZabbix not working when waiting doesn't exist in pg_stat_activity #1

Closed
bilbolodz opened this issue Mar 14, 2019 · 6 comments
Closed
Assignees
Labels

Comments

@bilbolodz
Copy link

I've got a few postgres servers and at some pgzabbix in not working:

/usr/local/lib/pgzabbix-1.5.linux-x86_64.zip --read

  • psql.running 1
    [..]
  • psql.idle_tx_connections 0
    Traceback (most recent call last):
    File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "main", fname, loader, pkg_name)
    File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
    File "/main.py", line 4, in
    File "/pgzabbix/cmd.py", line 59, in main
    prototypes that will later be wrapped in a more sophisticated interface.
    File "/pgzabbix/init.py", line 35, in all_generic
    File "/pgzabbix/generic.py", line 57, in psql_locks_waiting
    psycopg2.ProgrammingError: column "waiting" does not exist
    LINE 1: select count(*) from pg_stat_activity where waiting = 'true'

Indeed there is such column in table: pg_stat_activity:

postgres=# \d+ pg_stat_activity
[..]
View definition:
SELECT s.datid,
d.datname,
s.pid,
s.usesysid,
u.rolname AS usename,
s.application_name,
s.client_addr,
s.client_hostname,
s.client_port,
s.backend_start,
s.xact_start,
s.query_start,
s.state_change,
s.wait_event_type,
s.wait_event,
s.state,
s.backend_xid,
s.backend_xmin,
s.query,
s.backend_type
FROM pg_stat_get_activity(NULL::integer) s(datid, pid, usesysid, application_name, state, query, wait_event_type, wait_event, xact_start, query_start, backend_start, state_change, client_addr, client_hostname, client_port, backend_xid, backend_xmin, backend_type, ssl, sslversion, sslcipher, sslbits, sslcompression, sslclientdn)
LEFT JOIN pg_database d ON s.datid = d.oid
LEFT JOIN pg_authid u ON s.usesysid = u.oid;

It's rather not connected with postgres version.

Not working:
psql (PostgreSQL) 10.6 (Ubuntu 10.6-0ubuntu0.18.04.1)
psql (PostgreSQL) 9.6.11
psql (PostgreSQL) 9.6.12

Working:
psql (PostgreSQL) 9.5.2
psql (PostgreSQL) 11.1 (Ubuntu 11.1-1.pgdg14.04+1)
psql (PostgreSQL) 9.4.5

Any ideas?

Best regards

Piotr

@bilbolodz
Copy link
Author

I've found something like these:
ManageIQ/manageiq#13200

@Spindel
Copy link
Owner

Spindel commented Mar 16, 2019

Interesting incompatibility with the Databases, I ought to fix that, yes!

@Spindel Spindel changed the title PgZabbix not working on some servers PgZabbix not working when waiting doesn't exist in pg_stat_activity Mar 16, 2019
@bilbolodz
Copy link
Author

Great. If you need some more information please as for more details.

@bilbolodz
Copy link
Author

Any news about patch?

@Spindel
Copy link
Owner

Spindel commented Mar 29, 2019

Aye, I haven't posted here , but it turns out that it's not the only setting that's differing between versions, so there's some overhaul going on to make it run on more modern releases.

@Spindel Spindel self-assigned this Mar 29, 2019
@Spindel Spindel added the bug label Mar 29, 2019
@Spindel
Copy link
Owner

Spindel commented Mar 29, 2019

so.. Right now I'm mighty confused actually.

Turns out I did drop support for postgres <10 last year, and have a tagged release of 1.6 with a tag reference in there on the release page.

6e9a312

However, I also can't find that release in my own tree, and can't check out that commit id, so something is fucky.

Either way, I've redone that on master, and the WAL changes and fixes are on master and on the 1.7 tag, now with full compat.

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

No branches or pull requests

2 participants