[check_postgres] Existing active checks, upgrading version, PGSQL9+ compat

Guillaume Lelarge guillaume at lelarge.info
Fri Dec 28 08:24:29 UTC 2012


On Thu, 2012-12-27 at 09:42 -0600, Obringer, Adam wrote:
> Hi there,
> 
> We've been utilizing your check_postgres.pl script for quite a while, primarily for 8.x databases, and have enjoyed the thorough results within our distributed Nagios presence. We've recently started testing the most recent version of your script (2.19.0) assessing forward compatibility with the current version we are using, since we will have some Postgres 9.2 databases within our newly-built environments. A few things in particular are failing, and it seems due directly to things that have changed within the newer versions of the database. For reference, our older version we use production-wise is version 2.12.
> 
> Example:
> 
> A 'query length' check that we do, like this:
> 
> # Check PostgreSQL query runtime
> #   $ARG1$ = Warning threshold in minutes
> #   $ARG2$ = Critical threshold in minutes
> 
> define command {
>         command_name    check_postgresql_querytime
>         command_line    $USER2$/check_postgres.pl -H $HOSTADDRESS$ -u nagios -db nagios --action query_time -w "$ARG1$ minutes" -crit "$ARG2$ minutes"
> }
> 
> Outputs this:
> 
> POSTGRES_QUERY_TIME UNKNOWN: (host:test1.domain.com) ERROR: column "current_query" does not exist
> 
> 
> We know that 'current_query' has been since replaced by 'query', and I've gone as far as a mass find/replace within the perl script, but that hasn't covered it. It seems that this is either not a capability with the newer version of PG, or I'm completely missing something within the script that I can change within our Nagios service commands.
> 

Did you try the code available in the repository? because it supports
PostgreSQL 9.2 out of the box last time I checked.

> Additionally, we check PG bloat in this fashion:
> 
> # Check PostgreSQL bloat
> #  NOTE: This check needs a comma separated list of dbs to check
> #   $ARG1$ = Warning threshold
> #   $ARG2$ = Critical threshold
> #   $ARG3$ = Comma separated list of databases to check
> 
> define command {
>         command_name    check_postgresql_bloat
>         command_line    $USER2$/check_postgres.pl -H $HOSTADDRESS$ -u nagios -db $ARG3$ --action bloat -w $ARG1$ -crit $ARG2$
> }
> 
> Which returns these results:
> 
> ERROR: ERROR: function pg_size_pretty(integer) is not unique
> 

I'm a bit puzzled by this one. Is it still against a PostgreSQL 9.2
server? does it happen with other releases?


-- 
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com



More information about the Check_postgres mailing list