Skip to content

PgBouncer pool checks produce only time outputs in perfdata, not connection counts, etc. #105

@doconeill

Description

@doconeill

When doing the PgBouncer checks (pgb_pool_cl_active, etc.) the perfdata produced are only "time" entries, and it produces two time values - not sure if it is one for each pool or it is just duplicated. They go way with --showtime=0, but then no perfdata is displayed at all.

POSTGRES_PGB_POOL_CL_ACTIVE OK: DB "testpg" (host:172.24.222.50) dbname1=6 * dbname2=1 | time=0.00s time=0.00s

I made the following patch:

diff -c check_postgres.pl.orig check_postgres.pl
*** check_postgres.pl.orig      2015-06-30 08:58:51.000000000 -0700
--- check_postgres.pl   2016-04-13 09:33:21.414608073 -0700
***************
*** 5847,5852 ****
--- 5847,5855 ----
              next;
          }

+         $db->{perf} .= sprintf ' %s=%s;%s;%s',
+             perfname($i->{database}), $i->{$stat}, $warning, $critical;
+ 
          if ($critical and $i->{$stat} >= $critical) {
              add_critical $msg;
          }

Which works - except the first pool is duplicated in the output:

POSTGRES_PGB_POOL_CL_ACTIVE OK: DB "testpg" (host:172.24.1.150) dbname1=19 * dbname2=3 | dbname1=19;199;200 dbname1=19;199;200 dbname2=3;199;200

The value for $db->{perf} is correct before it returns out of the check_pgb_pool() call, so it must get duplicated elsewhere? What's funny is without my patch, it doesn't output any pool statistics at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions