[check_postgres] 2 quick ones

Guillaume Lelarge guillaume at lelarge.info
Thu Aug 23 17:55:13 UTC 2012


On Fri, 2012-08-10 at 11:25 -0400, lance raymond wrote:
> I saw a few people saying I can use pnp4nagios, what I am looking for (if
> it's possible) is to monitor postgres, running good, then monitor a
> database and graph the queries by type (inserts, reads, etc.)   Is it
> possible and is there a how-to and what to use?
> 

It's a quite hard question. Many tools allow you to do that, but none
are easy to setup.

We use a Nagios server with check_postgres to do this. It takes some
time to set it up, but it works great.

Graphing queries by type is not really possible unless you log every
queries and that you have a tool that will read and guess the query's
type in your log.

> I am running on ubuntu 12.04LTS, the checks work, all give some type of
> warnings, etc.   examples are;
> 
> ./check_postgres_query_time --port=5432 --warning='3 minutes' --critical='5
> minutes'Use of uninitialized value $check_postgres::opt{"output"} in lc at
> ./check_postgres_query_time line 711.
> POSTGRES_QUERY_TIME OK:  longest query: 0s | time=0.09 maxtime=0;180;300
> 
> ./check_postgres_database_size --warning='1 TB' --critical='1.1 t'
> Use of uninitialized value $check_postgres::opt{"output"} in lc at
> ./check_postgres_database_size line 711.
> POSTGRES_DATABASE_SIZE OK: DB "postgres" archive: 536501068600 (500 GB)
> api_stats: 6087480 (5945 kB) postgres: 6087480 (5945 kB) template0: 6087480
> (5945 kB) template1: 6087480 (5945 kB)  | time=0.17  archive=536501068600
> api_stats=6087480 postgres=6087480 template0=6087480 template1=6087480
> 
> ./check_postgres_disk_space --port=5432 --warning='90%' --critical='90%'
> Use of uninitialized value $check_postgres::opt{"output"} in lc at
> ./check_postgres_disk_space line 711.
> POSTGRES_DISK_SPACE OK:  FS /dev/mapper/archiveDB-DataBase mounted on
> /var/lib/postgresql is using 616.45 GB of 894.01 GB (73%) | time=0.14
> /dev/mapper/archiveDB-DataBase=661905776640
> 

They all are the same warning. It complains about the opt{"output"}
value. The line it gives you (711) is kinda weird to me. Which release
of check_postgres are you using?

> Aside from that, you have a typo in your example for disk_space; you have...
>   check_postgres_disk_space --port=5432 --warning='90%' --critical="90%'
> 
> the critical should be '90-%' , you have a " so you may want to change that.
> 

Yes, you're right. It's now fixed.


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



More information about the Check_postgres mailing list