postgres db error
Posted: Thu Apr 24, 2014 5:39 am
Hi ,
We have received this error when trying to backup the nagios xi.
pg_dump: [archiver (db)] connection to database "nagiosxi" failed: FATAL: no pg_hba.conf entry for host "168.125.36.9", user "nagiosxi", database "nagiosxi", SSL off
Error backing up PostgresQL database 'nagiosxi' !
I have tried taking the backup of nagiosxi2.9with the script provided in the path /usr/local/nagiosxi/scripts but that gave the above error and when I tried manually connecting to the postgres database it is success using the command psql -U postgres
I thought of doing it with the 2.3 version's default provided script and it has successfully created the backup tar file, when I ran the back up script of 2.3, it gave the below output.
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/share/perfdata/CSW02-1-NewYork: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up PostgresQL databases...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
===============
BACKUP COMPLETE
===============
So does the backup successfully created? and I have observed the difference between these two files
version 2.3 script :
echo "Backing up PostgresQL databases..."
mkdir -p $mydir/pgsql
pg_dump -c -U nagiosxi nagiosxi > $mydir/pgsql/nagiosxi.sql
res=$?
if [ $res != 0 ]; then
echo "Error backing up PostgresQL database 'nagiosxi' !"
exit;
fi
version 2.9 script
echo "Backing up PostgresQL databases..."
mkdir -p $mydir/pgsql
if [ -z $cfg__db_info__nagiosxi__dbserver ]; then
cfg__db_info__nagiosxi__dbserver="localhost"
fi
pg_dump -h $cfg__db_info__nagiosxi__dbserver -c -U $cfg__db_info__nagiosxi__user $cfg__db_info__nagiosxi__db > $mydir/pgsql/nagiosxi.sql
res=$?
if [ $res != 0 ]; then
echo "Error backing up PostgresQL database 'nagiosxi' !"
exit $res;
fi
We have received this error when trying to backup the nagios xi.
pg_dump: [archiver (db)] connection to database "nagiosxi" failed: FATAL: no pg_hba.conf entry for host "168.125.36.9", user "nagiosxi", database "nagiosxi", SSL off
Error backing up PostgresQL database 'nagiosxi' !
I have tried taking the backup of nagiosxi2.9with the script provided in the path /usr/local/nagiosxi/scripts but that gave the above error and when I tried manually connecting to the postgres database it is success using the command psql -U postgres
I thought of doing it with the 2.3 version's default provided script and it has successfully created the backup tar file, when I ran the back up script of 2.3, it gave the below output.
Backing up Core Config Manager (NagiosQL)...
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Backing up Nagios Core...
tar: Removing leading `/' from member names
tar: /usr/local/nagios/var/ndo.sock: socket ignored
tar: /usr/local/nagios/share/perfdata/CSW02-1-NewYork: file changed as we read it
Backing up Nagios XI...
tar: Removing leading `/' from member names
Backing up MRTG...
tar: Removing leading `/' from member names
Backing up MySQL databases...
Backing up PostgresQL databases...
Backing up logrotate config files...
Backing up Apache config files...
Compressing backup...
===============
BACKUP COMPLETE
===============
So does the backup successfully created? and I have observed the difference between these two files
version 2.3 script :
echo "Backing up PostgresQL databases..."
mkdir -p $mydir/pgsql
pg_dump -c -U nagiosxi nagiosxi > $mydir/pgsql/nagiosxi.sql
res=$?
if [ $res != 0 ]; then
echo "Error backing up PostgresQL database 'nagiosxi' !"
exit;
fi
version 2.9 script
echo "Backing up PostgresQL databases..."
mkdir -p $mydir/pgsql
if [ -z $cfg__db_info__nagiosxi__dbserver ]; then
cfg__db_info__nagiosxi__dbserver="localhost"
fi
pg_dump -h $cfg__db_info__nagiosxi__dbserver -c -U $cfg__db_info__nagiosxi__user $cfg__db_info__nagiosxi__db > $mydir/pgsql/nagiosxi.sql
res=$?
if [ $res != 0 ]; then
echo "Error backing up PostgresQL database 'nagiosxi' !"
exit $res;
fi