Page 2 of 4

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Tue Dec 22, 2015 3:08 pm
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.

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Tue Dec 22, 2015 3:20 pm
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

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Tue Dec 22, 2015 3:35 pm
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.

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Tue Dec 22, 2015 3:45 pm
by wolf57
see attached pdf file for the screen shot

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Tue Dec 22, 2015 3:48 pm
by Box293
I mean the screenshot "In nagios under services"

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Tue Dec 22, 2015 3:53 pm
by wolf57
Here's a screenshot of Nagios

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Tue Dec 22, 2015 5:25 pm
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

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Tue Dec 22, 2015 5:26 pm
by rkennedy
Can you post the host definition for pgtest-db?

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Wed Dec 23, 2015 9:03 am
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
}

Re: errors in config - CHECK_PGACTIVITY plugin

Posted: Wed Dec 23, 2015 9:31 am
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