postgres check: works from cmd line but not from nagios
Jerome Alet
alet at librelogiciel.com
Mon Jan 3 18:23:45 CET 2005
Hi,
On Mon, Jan 03, 2005 at 06:18:32PM +0100, Fred Blaise wrote:
>
> result via nagios:
> PGSQL: CRITICAL - no connection to 'template1' (FATAL: no pg_hba.conf
> entry for host "81.201.101.5", user "nagios", database "template1", SSL
> off
>
> Via commandline:
> -----
> host:/etc/nagios-plugins/config# /usr/lib/nagios/plugins/check_pgsql -H
> <serverip> -d dddd -l uuuu
> PGSQL: ok - database excilan (0 sec.)
> -----
>
> Can anyone explain to me why that is? Let me know if you need additional
> info.
sure :
when run from the command line, you probably launch the command as user
root or postgres, but when running from nagios, you run it as user
nagios
this means that you have to modify PostgreSQL's pg_hba.conf to allow
user nagios to connect, then restart postgresql
hth
Jerome Alet
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.monitoring-lists.org/archive/users/attachments/20050103/545c5f77/attachment.sig>
More information about the Users
mailing list