Check PostgreSQL error relation

Engage with the community of users including those using the open source solutions.
Includes Nagios Core, Plugins, and NCPA

Check PostgreSQL error relation

Postby Quim » Tue Feb 23, 2021 7:27 am

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

Postby Quim » Tue Feb 23, 2021 7:48 am

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


Return to Community Support

Who is online

Users browsing this forum: Google [Bot] and 36 guests