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

Mem / Swap / Load etc. not displaying #32

Closed
slotrans opened this issue May 8, 2014 · 10 comments
Closed

Mem / Swap / Load etc. not displaying #32

slotrans opened this issue May 8, 2014 · 10 comments

Comments

@slotrans
Copy link

slotrans commented May 8, 2014

I am connecting locally but these stats are not showing. Are there any known issues that might cause this? What can I do to troubleshoot?

@julmon
Copy link
Contributor

julmon commented May 8, 2014

You should run pg_activity with 'postgres' user privileges (or 'root').

@slotrans
Copy link
Author

slotrans commented May 8, 2014

I have tried both postgres and root with the same results. At any rate that shouldn't matter since ordinary users can see memory usage and load stats through uptime, top, etc.

I noticed the following query in Data.pg_is_local(self,):
SELECT inet_server_addr() AS inet_server_addr, inet_client_addr() AS inet_client_addr

When pg_activity is connected over a unix domain socket, both of those functions return null, which psycopg2 translates to None, and str(None) is 'None' rather than '' so the length test returns false. Strangely though, if I use -h localhost, both functions return '127.0.0.1', so the equality test should return true, but I still don't get memory and load stats.

I was able to get them to show up by completely commenting out all the "am I local" tests...

@julmon
Copy link
Contributor

julmon commented May 8, 2014

Thanks for these informations.

What psutil version you have ? I've just discovered that the new psutil versions > 2.0 bring a new API and I can reproduce this behaviour with a 2.1.1.

@slotrans
Copy link
Author

slotrans commented May 8, 2014

my psutil is 2.1.0

@julmon
Copy link
Contributor

julmon commented May 8, 2014

Just commited a fixe : f00fc2a
It works for me with psutil 2 and older versions.

Could you try it ?

Thank you,

@slotrans
Copy link
Author

That fixed it, thank you!

@slotrans
Copy link
Author

Seems to be broken again in pg_activity 1.0.2 (from PyPI), tried with psutil 2.1.3 (current) and 2.1.0, psycopg2 2.5.4 if that matters

@slotrans slotrans reopened this Nov 18, 2014
@Deewiant
Copy link

Deewiant commented Jan 9, 2015

It's not broken again, it's just that the latest release at PyPI, i.e. the 1.0.2 you mentioned, dates from 2013-06 and the fix was committed 2014-05. The current git master works just fine.

@julmon
Copy link
Contributor

julmon commented Feb 4, 2015

Hi,

Latest version (1.2.0) has been pushed on pypi.

Thanks,

@julmon julmon closed this as completed Feb 4, 2015
@slotrans
Copy link
Author

slotrans commented Feb 4, 2015

Thanks, this makes it easier to keep my servers updated

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