errors in config - CHECK_PGACTIVITY plugin

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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: errors in config - CHECK_PGACTIVITY plugin

Post by Box293 »

Lets echo the exit code to see what the plugin is returning:

Code: Select all

su nagios
check_pgactivity -h pgtest-db -s backends -w 80 -c 95
echo $?
Also, can you provide a screenshot of the error.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wolf57
Posts: 20
Joined: Tue Dec 22, 2015 11:49 am

Re: errors in config - CHECK_PGACTIVITY plugin

Post by wolf57 »

Is this how you wanted the commands run?

nagios@montwo:~$ check_pgactivity -h pgtest-db -s backends -w 80 -c 95
POSTGRES_BACKENDS OK: 2 connections on 297 | postgres=1;80;95;0;297 nagios=0;80;95;0;297 phppgadmin=0;80;95;0;297 repmgrdb=0;80;95;0;297 opm=0;80;95;0;297 test4=0;80;95;0;297 template1=1;80;95;0;297 ima=0;80;95;0;297 test2=0;80;95;0;297 test1=0;80;95;0;297 test3=0;80;95;0;297 maximum_connections=297;80;95;0;297
nagios@montwo:~$ echo $?
0
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: errors in config - CHECK_PGACTIVITY plugin

Post by Box293 »

Yes, it exited with an 0 so that means it's an OK state.
wolf57 wrote:Sorry the restart worked but in Nagios under the Services it shows (Service check did not exit properly)
Can you show this with a screenshot please.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wolf57
Posts: 20
Joined: Tue Dec 22, 2015 11:49 am

Re: errors in config - CHECK_PGACTIVITY plugin

Post by wolf57 »

see attached pdf file for the screen shot
Attachments
check_pgactivity.pdf
(216.02 KiB) Downloaded 174 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: errors in config - CHECK_PGACTIVITY plugin

Post by Box293 »

I mean the screenshot "In nagios under services"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
wolf57
Posts: 20
Joined: Tue Dec 22, 2015 11:49 am

Re: errors in config - CHECK_PGACTIVITY plugin

Post by wolf57 »

Here's a screenshot of Nagios
Attachments
nagios.pdf
(241.46 KiB) Downloaded 344 times
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: errors in config - CHECK_PGACTIVITY plugin

Post by Box293 »

In the left pane under System click Configuration
Select Services
Click Continue
In the top right type in check_pgactivity
Click Update
Can you send a screenshot of that
You might need two as it will get wide
Click the Check Command (it's a hyperlink)
Can you send a screenshot of that
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: errors in config - CHECK_PGACTIVITY plugin

Post by rkennedy »

Can you post the host definition for pgtest-db?
Former Nagios Employee
wolf57
Posts: 20
Joined: Tue Dec 22, 2015 11:49 am

Re: errors in config - CHECK_PGACTIVITY plugin

Post by wolf57 »

define host {
host_name pgtest-db
alias pgtest-db
address 10.xx.x.xxx
hostgroups postgres-hosts
check_command check-host-alive
max_check_attempts 3
check_period workhours
contacts wolf
contact_groups db-group
notification_interval 5
notification_period workhours
register 1
}
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: errors in config - CHECK_PGACTIVITY plugin

Post by Box293 »

Seeing as your host definition uses an IP address and your testing has been using the dns object as the address, let's test the command using the IP Address. Also, do an nslookup on the address and the dns, do they match:

Code: Select all

su nagios
check_pgactivity -h 10.xx.x.xxx -s backends -w 80 -c 95
nslookup 10.xx.x.xxx
nslookup pgtest-db
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked