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

Re: Unable to see PostgreSQL services on OPM UI

Post by giles »

Please check the attachment.
Attachments
check_pgactivity.txt
(198.62 KiB) Downloaded 379 times
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Unable to see PostgreSQL services on OPM UI

Post by tgriep »

I found an update to the plugin, try that and see if that helps.
https://github.com/OPMDG/check_pgactivi ... pgactivity

If the user account you are using to connect to the database requires a password, it may ask for one.
Bad thing is, it looks like you cannot specify a password for an option, but is may not need one.
Try running the command without specifying the user name like below and see if it works.

Code: Select all

./check_pgactivity --service bgwriter -h localhost
Be sure to check out our Knowledgebase for helpful articles and solutions!
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 tried with the new code. But the result is same.

Code: Select all

root@giles-S451LA:/usr/lib/nagios/plugins# ./check_pgactivity --service bgwriter -h localhost
Password: 
Password: 
POSTGRES_BGWRITER OK: No writes | buffers_backend=0Bps checkpoint_timed=0Nps checkpoint_req=0Nps buffers_checkpoint=0Bps buffers_clean=0Bps maxwritten_clean=0Nps buffers_backend_fsync=0Nps buffers_alloc=71.6258641724278Bpsroot@giles-S451LA:/usr/lib/nagios/plugins# 
If I don't give the user parameter it wants the password of 'postgres' user. So, I have run the command after modifying nagios_dispatcher.conf. I have used 'postgres' user instead of 'nagios_dispatcher'.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Unable to see PostgreSQL services on OPM UI

Post by tgriep »

You can either remove the password for the postgres account so it will not prompt you for one or search for an alternative plugin that you can specify the password in the command.
Be sure to check out our Knowledgebase for helpful articles and solutions!
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 removed password for the postgres. Now the output is showing as following:

Code: Select all

root@giles-S451LA:/usr/lib/nagios/plugins# ./check_pgactivity --service bgwriter -h localhost 
POSTGRES_BGWRITER OK: No writes | buffers_backend=0Bps checkpoint_timed=0Nps checkpoint_req=0Nps buffers_checkpoint=0Bps buffers_clean=0Bps maxwritten_clean=0Nps buffers_backend_fsync=0Nps buffers_alloc=1293.47368421053Bpsroot@giles-S451LA:/usr/lib/nagios/plugins# 
But still nothing is showing on OPM UI.
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 installed Nagios and OPM in differnt VM. There I was able to show the Service on OPM UI. But when I added the service bgwriter following error are showing in the nagios log.

Code: Select all

[09-04-2016 00:06:39] SERVICE ALERT: localhost;BackGround;CRITICAL;SOFT;2;(Return code of 13 is out of bounds)
Informational Message[09-04-2016 00:06:39] Warning: Return code of 13 for check of service 'BackGround' on host 'localhost' was out of bounds.
Service Critical[09-04-2016 00:03:39] SERVICE ALERT: localhost;BackGround;CRITICAL;SOFT;1;(Return code of 13 is out of bounds)
Informational Message[09-04-2016 00:03:39] Warning: Return code of 13 for check of service 'BackGround' on host 'localhost' was out of bounds.
giles
Posts: 24
Joined: Thu Aug 18, 2016 3:56 am

Re: Unable to see PostgreSQL services on OPM UI

Post by giles »

I was able to solve the problem by changing ownership of check_pgactivity.data to nagios.

Thanks for your support.

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 »

Awesome! Good ol' permissions strike again.

Are we good to mark this thread as resolved?
Former Nagios Employee
jbyrnes
Posts: 1
Joined: Thu Sep 15, 2016 9:46 am

Re: Unable to see PostgreSQL services on OPM UI

Post by jbyrnes »

Been trying to use this plugin and I'm also getting the password prompt 3 times and then I get a response, I've placed the .pgpass in /root and also in the same dir as the check_pgactivity folder. I'm just trying to run from command line before even trying to get nagios to see this. I'm using postgres 9.5.2 and I've tried this on sles11sp4 and sles12sp1, same thing, I get prompted for password.

./check_pgactivity -h dbserver -p 5432 -s last_vacuum -w 30m -c 1h30m -P /opt/PostgreSQL/9.5/bin/psql -U postgres -d iacops
Password:
Password:
Password:
POSTGRES_LAST_VACUUM CRITICAL: iacdcs: 1w 1d 19h56m44s, iacwf: 1w 1d 21h35m16s | iacdcs=763004.771645s;1800;5400 'iacdcs vacuum'=0 'iacdcs autovacuum'=0 iacops=107.1573s;1800;5400 'iacops vacuum'=0 'iacops autovacuum'=8 iacwf=768916.746545s;1800;5400 'iacwf vacuum'=0 'iacwf autovacuum'=0 iacwh=NaNs;1800;5400 'iacwh vacuum'=0 'iacwh autovacuum'=0

I've also added -dbpass=password and still I get the password prompt!

I've also tried changing ownership of check_pgactivity.data to postgres and then tried running, I get the password prompt.
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 permissions on the different files for us to review?
Former Nagios Employee
Locked