Ad Widget

Collapse

Graphing PostgreSQL database connections count grouped by database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omfgppc
    Junior Member
    • Jul 2020
    • 1

    #1

    Graphing PostgreSQL database connections count grouped by database

    Hello,

    I am currently using libzbxpgsql for monitoring postgresql servers and I am mostly happy with how that is working but I can't quite figure out how to graph something like:

    SELECT datname, count(*) from pg_stat_activity
    AND application_name ~'MyApp'
    GROUP BY datname ;

    Result for graphing on 2 axis should be:
    x0=db1, y0=10
    x1=db2, y1=40
    x2=db3, y2=2
    etc.

    Any ideas?
Working...