Unable to see PostgreSQL services on OPM UI

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.
giles
Posts: 24
Joined: Thu Aug 18, 2016 3:56 am

Unable to see PostgreSQL services on OPM UI

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Unable to see PostgreSQL services on OPM UI

Post 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$
Former Nagios Employee
giles
Posts: 24
Joined: Thu Aug 18, 2016 3:56 am

Re: Unable to see PostgreSQL services on OPM UI

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

Re: Unable to see PostgreSQL services on OPM UI

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
giles
Posts: 24
Joined: Thu Aug 18, 2016 3:56 am

Re: Unable to see PostgreSQL services on OPM UI

Post 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#
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Unable to see PostgreSQL services on OPM UI

Post 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.
Former Nagios Employee
giles
Posts: 24
Joined: Thu Aug 18, 2016 3:56 am

Re: Unable to see PostgreSQL services on OPM UI

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Unable to see PostgreSQL services on OPM UI

Post by rkennedy »

Can you post the entire check_pgactivity plugin for us to look at?
Former Nagios Employee
giles
Posts: 24
Joined: Thu Aug 18, 2016 3:56 am

Re: Unable to see PostgreSQL services on OPM UI

Post by giles »

How can I post the entire check_pgactivity plugin here?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Unable to see PostgreSQL services on OPM UI

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked