Page 1 of 1

check_postgres.pl - Invalid format returned by custom query

Posted: Tue Aug 19, 2014 1:57 am
by poldas
Hi,

I want to use custom query with check_postgres.pl but have a problem query return Invalid format returned by custom query and add warning and critical value to result (15,20)

Code: Select all

root@ubuntu:/usr/local/nagios/libexec# check_postgres.pl -H 192.168.1.100 -p 5333 -db XXX -dbuser postgres -dbpass XXX -w 15 -c 20 --action custom_query --query="select id from bank where column1='ZZZ'"

Code: Select all

POSTGRES_CUSTOM_QUERY UNKNOWN: DB "XXX" (host:192.168.1.100) (port=5333) Invalid format returned by custom query | time=0.32s id=10;15;20

Re: check_postgres.pl - Invalid format returned by custom qu

Posted: Tue Aug 19, 2014 5:13 pm
by abrist
Does the query work without the warning and critical thresholds?

Re: check_postgres.pl - Invalid format returned by custom qu

Posted: Fri Aug 22, 2014 8:19 am
by poldas
Yes, it does

Re: check_postgres.pl - Invalid format returned by custom qu

Posted: Fri Aug 22, 2014 3:06 pm
by abrist
You most likely need to define the valtype if you want to use thresholds with value types other than integers:
http://bucardo.org/check_postgres/check ... stom_query
Are you trying to compare the returned value from the query to your thresholds?
What is the intent of the thresholds?
If the id column from the bank table is not an integer, that would explain the type error.