[check_postgres] Stack with check_postgres

George Lytras george.lytras at shiftenergy.com
Fri Feb 25 13:34:19 UTC 2011


Hi Bucardo,

 

I 've been using your plugin for a few days now , it's being very helpful,
great jobl!!

 

I'm having 2 issues though, and I was wondering if you could help me out.

 

1).  I have a postgres function that returns two columns

 

result, data 

(int), (text)

 

If I run this command from postgres it returns the proper values and if I
run it from the linux command line like this:

 

/usr/local/nagios/libexec/check_postgres.pl -H $HOSTADDRESS$ -u postgres -db
monitordb --action=custom_query --critical=1 --query="SELECT * from
ops_get_status();"

 

It also returns the proper values - 

 

CRITICAL: DB "monitordb''| time=0.24 some data here 

 

But when I insert it in the commands.cfg and watch this through the Nagios
frontend it return (null).

The log file doesn't contain any detailed information for debugging this.
So, what can I do to get to the bottom of this issue - any help greatly
appreciated

 

 

2). It seems that I 'm having problems with quoting (single or double).

 

Again,if I run this from the linux command line like this:

 

/usr/local/nagios/libexec/check_postgres.pl -H $HOSTADDRESS$ -u postgres
--db=monitordb --action=custom_query --critical=20 --query="SELECT
count(fresh) as result FROM vwfreshness WHERE fresh='stale' "

 

POSTGRES_CUSTOM_QUERY OK: DB "monitordb" (host:..) 1 | time=0.45

 

Through Nagios I 'm also getting (null).

 

When I run the same command but check a column that it's values are integer,
e.g. 

 

/usr/local/nagios/libexec/check_postgres.pl -H $HOSTEDDRESS$ -u postgres
--db=monitordb --action=custom_query --critical=20 --query="SELECT
count(fresh) as result FROM vwfreshness WHERE some_column>100 "

 

I'm getting the correct results everywhere.

 

The quoting issue is really important for me, because I'm using check_by_ssh
for another DB and I don't know how to face the double quoting for the SQL
command, in the double quoting for the check_by_ssh command.

 

Thanks for your time,

 

George.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://mail.endcrypt.com/pipermail/check_postgres/attachments/20110225/e9afedc4/attachment.html 


More information about the Check_postgres mailing list