Page 1 of 1

Longest query is no visibel in postgres database

Posted: Thu May 02, 2019 12:18 am
by biswajit.banerjee
Hi Team,

We are facing problem in Nagios xi only database name is being shown,not the longest query:

command:
/usr/local/nagios/libexec/check_pgactivity -s longest_query -h '' -w 10 -c 15

Re: Longest query is no visibel in postgres database

Posted: Thu May 02, 2019 11:35 am
by npolovenko
Hello, @biswajit.banerjee. Please run this command from the command line and show me the output:
/usr/local/nagios/libexec/check_pgactivity -s longest_query -h -w 10 -c 15
Also, click on the service in the web interface and let me know if you see the full output(including the query) in the "Service Status Detail"?

Re: Longest query is no visibel in postgres database

Posted: Wed May 08, 2019 3:45 am
by biswajit.banerjee
Output of service in the web interface:
/usr/local/nagios/libexec/check_nrpe -H XXXXXX -t 30 -c check_longest_query
POSTGRES_LONGEST_QUERY CRITICAL: MyCareConfig: 1w 13h27m40s | 'ETLLog max'=NaNs;180000;54000 'ETLLog avg'=NaNs;180000;54000 'ETLLog #queries'=0 'postgres max'=NaNs;180000;54000 'postgres avg'=NaNs;180000;54000 'postgres #queries'=0 'template1 max'=0s;180000;54000 'template1 avg'=0s;180000;54000 'template1 #queries'=1 'MyCareConfig max'=653260s;180000;54000 'MyCareConfig avg'=336923.433333333s;180000;54000 'MyCareConfig #queries'=30

Output is not showing query name.

Re: Longest query is no visibel in postgres database

Posted: Wed May 08, 2019 1:57 pm
by npolovenko
@biswajit.banerjee, I ran this plugin in the lab to check the same on my Postgres database, and it's not showing the longest query name either.
Please check the list of all available potgres plugins that we have below. There might be an alternative plugin that fits your needs.
https://exchange.nagios.org/index.php?o ... d=postgres