Page 1 of 3

Unable to see PostgreSQL services on OPM UI

Posted: Thu Aug 18, 2016 6:46 am
by giles
I have installed and configured check_pgactivity. But no PostgreSQL Service is showing on OPM UI. I have contacted with OPM Support they are saying that the problem is on Nagios end.

I have added following lines in command.cgf

define command {
command_name check_pgactivity
command_line $USER1$/check_pgactivity --service bgwriter -U nagios_dispatcher -h $HOSTADDRESS$ $_SERVICEOPTION_THRESHOLD$
}

and following lines in services_nagios2.cfg

define service {
host_name localhost
service_description check_pgactivity
check_command check_pgactivity!-U nagios_dispatcher -s bgwriter -w 80% -c 95%
max_check_attempts 3
check_interval 3
retry_interval 3
check_period 24x7
notification_interval 5
notification_period 24x7
}

I am using ubuntu 14.04.

Regards,
Giles.

Re: Unable to see PostgreSQL services on OPM UI

Posted: Thu Aug 18, 2016 10:34 am
by rkennedy
Are you able to test the command over the CLI, to get it working to your needs? Then, show us the full input / output so we can help to see how the check should be running.

It looks like you're overlapping, which could be causing issues. Could you show us a screenshot of what the status is reporting?

Code: Select all

command_line $USER1$/check_pgactivity --service bgwriter -U nagios_dispatcher -h $HOSTADDRESS$ $_SERVICEOPTION_THRESHOLD$
}
But, you're passing -U nagios_dispatcher in $ARG1$ of your check_command -

Code: Select all

check_command check_pgactivity!-U nagios_dispatcher -s bgwriter -w 80% -c 95%
Additionally, your command_line doesn't have any way to pass $ARG1$, might want to modify it to something like below (also depends what $_SERVICEOPTION_THRESHOLD is set to, I don't see you setting that variable at all) -

Code: Select all

command_line $USER1$/check_pgactivity --service bgwriter -h $HOSTADDRESS$ $ARG1$ $_SERVICEOPTION_THRESHOLD$

Re: Unable to see PostgreSQL services on OPM UI

Posted: Sun Aug 21, 2016 5:14 am
by giles
Here are the input and output.
root@giles-S451LA:/usr/lib/nagios/plugins# ./check_pgactivity --service bgwriter -U nagios_dispatcher -h $HOSTADDRESS$ $_SERVICEOPTION_THRESHOLD$
CHECK_PGACTIVITY UNKNOWN: Query fail !
psql: could not translate host name "$" to address: Name or service not known
root@giles-S451LA:/usr/lib/nagios/plugins#
root@giles-S451LA:/usr/lib/nagios/plugins# ./check_pgactivity --service bgwriter -U nagios_dispatcher -h $HOSTADDRESS$ $ARG1$ $_SERVICEOPTION_THRESHOLD$
CHECK_PGACTIVITY UNKNOWN: Query fail !
psql: could not translate host name "$" to address: Name or service not known
root@giles-S451LA:/usr/lib/nagios/plugins#
root@giles-S451LA:/usr/lib/nagios/plugins#
root@giles-S451LA:/usr/lib/nagios/plugins# ./check_pgactivity!-U nagios_dispatcher -s bgwriter -w 80% -c 95%
bash: !-U: event not found
root@giles-S451LA:/usr/lib/nagios/plugins#

Re: Unable to see PostgreSQL services on OPM UI

Posted: Mon Aug 22, 2016 12:05 am
by Box293
Your tests at the command line will require the values like $HOSTADDRESS$ to be replaced with the actual values like xxx.xxx.xxx.xxx

Re: Unable to see PostgreSQL services on OPM UI

Posted: Mon Aug 22, 2016 2:21 am
by giles
root@giles-S451LA:/usr/lib/nagios/plugins# ./check_pgactivity --service bgwriter -U nagios_dispatcher -h localhost
Password:
Password:
POSTGRES_BGWRITER OK: No writes | buffers_backend=0Nps checkpoint_timed=0Nps checkpoint_req=0Nps buffers_checkpoint=0Bps buffers_clean=0Bps maxwritten_clean=0Nps buffers_backend_fsync=0Nps buffers_alloc=0Bpsroot@giles-S451LA:/usr/lib/nagios/plugins#
root@giles-S451LA:/usr/lib/nagios/plugins#
root@giles-S451LA:/usr/lib/nagios/plugins# ./check_pgactivity -U nagios_dispatcher -s bgwriter -w 80% -c 95%
Password:
Password:
POSTGRES_BGWRITER OK: No writes | buffers_backend=0Nps checkpoint_timed=0Nps checkpoint_req=0Nps buffers_checkpoint=0Bps buffers_clean=0Bps maxwritten_clean=0Nps buffers_backend_fsync=0Nps buffers_alloc=0Bpsroot@giles-S451LA:/usr/lib/nagios/plugins#
root@giles-S451LA:/usr/lib/nagios/plugins#
root@giles-S451LA:/usr/lib/nagios/plugins#

Re: Unable to see PostgreSQL services on OPM UI

Posted: Mon Aug 22, 2016 11:15 am
by rkennedy
It looks like the plugin is requiring a password, this isn't standard with Nagios plugins - do you know why it's asking?

In this other forum post you created for the issue, https://support.nagios.com/forum/viewto ... 56#p193556 - it looks to be resolved, but the data isn't appearing in OPM. We did not write OPM so it's hard to know how they're pulling information.

Re: Unable to see PostgreSQL services on OPM UI

Posted: Tue Aug 23, 2016 2:00 am
by giles
I have no idea why it is asking for password.

OK, you can close the following issue.
https://support.nagios.com/forum/viewto ... 56#p193556

Re: Unable to see PostgreSQL services on OPM UI

Posted: Tue Aug 23, 2016 11:34 am
by rkennedy
Can you post the entire check_pgactivity plugin for us to look at?

Re: Unable to see PostgreSQL services on OPM UI

Posted: Wed Aug 24, 2016 12:41 am
by giles
How can I post the entire check_pgactivity plugin here?

Re: Unable to see PostgreSQL services on OPM UI

Posted: Wed Aug 24, 2016 1:27 am
by Box293
You should be able to upload it as an attachment. You may need to add .txt to the extension for it to work.