Giter Club home page Giter Club logo

Comments (10)

julmon avatar julmon commented on May 20, 2024

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

from pg_activity.

slotrans avatar slotrans commented on May 20, 2024

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...

from pg_activity.

julmon avatar julmon commented on May 20, 2024

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.

from pg_activity.

slotrans avatar slotrans commented on May 20, 2024

my psutil is 2.1.0

from pg_activity.

julmon avatar julmon commented on May 20, 2024

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

Could you try it ?

Thank you,

from pg_activity.

slotrans avatar slotrans commented on May 20, 2024

That fixed it, thank you!

from pg_activity.

slotrans avatar slotrans commented on May 20, 2024

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

from pg_activity.

Deewiant avatar Deewiant commented on May 20, 2024

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.

from pg_activity.

julmon avatar julmon commented on May 20, 2024

Hi,

Latest version (1.2.0) has been pushed on pypi.

Thanks,

from pg_activity.

slotrans avatar slotrans commented on May 20, 2024

Thanks, this makes it easier to keep my servers updated

from pg_activity.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.