Check PostgreSQL error relation

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
Quim
Posts: 12
Joined: Tue Nov 12, 2019 10:45 am

Check PostgreSQL error relation

Post by Quim »

Hello

I have a check for PostgreSQL but I get next error:

ERROR: relation public."table_name" does not exist

Command is defined:
define command {
command_name check_postgres_num_notifications_psql01
command_line $USER1$/check_postgres.pl -H $HOSTADDRESS$ -u admin_name -db db_name --action custom_query --query="SELECT count(*) FROM public."table_name" WHERE "column_name" = 0" -w $ARG1$ -c $ARG2$
}

Any help?
Thanks in advance
Quim
Posts: 12
Joined: Tue Nov 12, 2019 10:45 am

Re: Check PostgreSQL error relation

Post by Quim »

Hi

to solve it, it,s put simple quotes in parameter:

--query='i

Example:
define command {
command_name check_postgres_num_notifications_psql01
command_line $USER1$/check_postgres.pl -H $HOSTADDRESS$ -u admin_name -db db_name --action custom_query --query='SELECT count(*) FROM public."table_name" WHERE "column_name" = 0' -w $ARG1$ -c $ARG2$
}

Thanks
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Check PostgreSQL error relation

Post by benjaminsmith »

Hi nivyavn,

Looks like you got it working. We'll mark this one as solved.

Thank you for using the Nagiso Community Forum.

Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked