zalando / pg_view

Get a detailed, real-time view of your PostgreSQL database and system metrics
https://pypi.python.org/pypi/pg-view
Other
494 stars 49 forks source link

Unable to read postmaster.pid for default #96

Closed fluca1978 closed 6 years ago

fluca1978 commented 6 years ago

I've a remote FreeBSD machine running PostgreSQL 9.6.5 (procfs enabled, if that matters). From an ubuntu machine I try to use pg_view installed from the repostiory (de5325ac50).

Now when I try to start the pg_view command I have the error in the subject:

% pg_view -U postgres -d testdb -h 192.168.222.100 -o console -v
Unable to read postmaster.pid for default at /mnt/data1/pgdata
 HINT:             make sure Postgres is running
ERROR: 2017-11-14 10:53:05,369 Unable to read postmaster.pid for default at /mnt/data1/pgdata
 HINT:             make sure Postgres is running
failed to read pid of the postmaster on {'host': '192.168.222.100', 'user': 'postgres', 'database': 'testdb'}
ERROR: 2017-11-14 10:53:05,369 failed to read pid of the postmaster on {'host': '192.168.222.100', 'user': 'postgres', 'database': 'testdb'}
unable to continue with cluster default
ERROR: 2017-11-14 10:53:05,370 unable to continue with cluster default
No suitable PostgreSQL instances detected, exiting...
ERROR: 2017-11-14 10:53:05,370 No suitable PostgreSQL instances detected, exiting...
hint: use -v for details, or specify connection parameters manually in the configuration file (-c)
ERROR: 2017-11-14 10:53:05,370 hint: use -v for details, or specify connection parameters manually in the configuration file (-c)
Traceback (most recent call last):
  File "build/bdist.linux-x86_64/egg/pg_view/__init__.py", line 254, in main
    sys.exit(1)
SystemExit: 1

I'm using python 2.7. Of course, PostgreSQL is running, as well as the postmaster.pid file is in place. What am I missing?

alexeyklyukin commented 6 years ago

Queries from the system other than the one the database is running at are not supported, as pg_view uses information from local /proc in order to deliver system statistics. That is also the reason behind the fact that pg_view is currently Linux only. We would very much like to address both in 2.0, by allowing the system be collected by sprocs inside the remote database and querying the results from local pg_view.

There is a proof-on-concept PR from @a1exsh https://github.com/zalando/pg_view/pull/80