LPS:Monitoring/pgsql

Z HelpDesk
< LPS:Monitoring
Verze z 13. 1. 2020, 10:04, kterou vytvořil Svamberg (diskuse | příspěvky) (→‎PostgreSQL: aktualizace)
(rozdíl) ← Starší verze | zobrazit aktuální verzi (rozdíl) | Novější verze → (rozdíl)

PostgreSQL

Zde převzato z wiki. Instalovat pouze po doinstalovani nrpe, ten vytvori uzivatele nagios.

echo "local template1 nagios trust" >> /etc/postgresql/9.1/main/pg_hba.conf
cd /tmp; su postgres
createuser -S -R -D nagios # pokud nefunguje, pust bez parametru a vypln nasledujici otazky
Enter name of role to add: nagios
Shall the new role be a superuser? (a/n) n
Shall the new role be allowed to create databases? (a/n) n
Shall the new role be allowed to create more new roles? (a/n) n
exit
/etc/init.d/postgresql restart


Pro testování je možné lokálně použit příkaz, ale je třeba změnit v /etc/passwd shell uživatele nagios a pak zase zpátky

chsh -s /bin/bash nagios
su -c /usr/lib/nagios/plugins/check_pgsql nagios
OK - database template1 (0 sec.)|time=0,000000s;2,000000;8,000000;0,000000
chsh -s /bin/false nagios