check_postgres.pl - Invalid format returned by custom query

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
poldas
Posts: 2
Joined: Thu Aug 07, 2014 2:26 am

check_postgres.pl - Invalid format returned by custom query

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post by abrist »

Does the query work without the warning and critical thresholds?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
poldas
Posts: 2
Joined: Thu Aug 07, 2014 2:26 am

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

Post by poldas »

Yes, it does
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

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

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked