Page 1 of 2
Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 11:45 am
by cdrussell
Not able to logon to Nagios Web page after fixing SQL crash with repairmysql.sh
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 11:50 am
by abrist
Um, login has nothing to do with that database. What is the exact nature of the error? Do you get the login screen? Does it seem like a bad password?
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 11:54 am
by cdrussell
no bad password. screen just refreshes. then i purposefully put a bad password and i do get password error
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 11:57 am
by abrist
Try to log in again and then get a tail of your apache log and post it here in code wraps:
Also, try to restart postgres just in case:
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 1:23 pm
by cdrussell
Attached output
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 1:24 pm
by cdrussell
service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [FAILED]
[root@p26lxpnetm0001 cdrussell]# service postgresql start
Starting postgresql service: [FAILED]
[root@p26lxpnetm0001 cdrussell]#
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 3:16 pm
by abrist
Looks like postgres cannot start. Anything interesting in the startup logs:
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 3:27 pm
by cdrussell
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale en_US.UTF-8.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to "english".
fixing permissions on existing directory /var/lib/pgsql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 32MB
creating configuration files ... ok
creating template1 database in /var/lib/pgsql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
Success. You can now start the database server using:
/usr/bin/postgres -D /var/lib/pgsql/data
or
/usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start
LOG: could not bind IPv6 socket: Cannot assign requested address
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
LOG: could not bind IPv4 socket: Cannot assign requested address
HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
WARNING: could not create listen socket for "localhost"
FATAL: could not create any TCP/IP sockets
could not write to log file: No space left on device
could not write to log file: No space left on device
FATAL: could not write lock file "postmaster.pid": No space left on device
FATAL: could not write lock file "postmaster.pid": No space left on device
could not write to log file: No space left on device
FATAL: could not write lock file "postmaster.pid": No space left on device
FATAL: could not write lock file "postmaster.pid": No space left on device
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 3:28 pm
by cdrussell
I then try to start the databse server and get this:
postgres cannot access the server configuration file "/var/lib/pgsql/data/postgresql.conf": Permission denied
[cdrussell@p26lxpnetm0001 ~]$ The files belonging to this database system will be owned by user "postgres".
-bash: The: command not found
[cdrussell@p26lxpnetm0001 ~]$ This user must also own the server process.
-bash: This: command not found
The database cluster will be initialized with locale en_US.UTF-8.
[cdrussell@p26lxpnetm0001 ~]$
[cdrussell@p26lxpnetm0001 ~]$ The database cluster will be initialized with locale en_US.UTF-8.
-bash: The: command not found
[cdrussell@p26lxpnetm0001 ~]$ The default database encoding has accordingly been set to UTF8.
-bash: The: command not found
[cdrussell@p26lxpnetm0001 ~]$ The default text search configuration will be set to "english".
-bash: The: command not found
[cdrussell@p26lxpnetm0001 ~]$
[cdrussell@p26lxpnetm0001 ~]$ fixing permissions on existing directory /var/lib/pgsql/data ... ok
-bash: fixing: command not found
[cdrussell@p26lxpnetm0001 ~]$ creating subdirectories ... ok
-bash: creating: command not found
[cdrussell@p26lxpnetm0001 ~]$ selecting default max_connections ... 100
-bash: selecting: command not found
[cdrussell@p26lxpnetm0001 ~]$ selecting default shared_buffers ... 32MB
-bash: selecting: command not found
[cdrussell@p26lxpnetm0001 ~]$ creating configuration files ... ok
-bash: creating: command not found
[cdrussell@p26lxpnetm0001 ~]$ creating template1 database in /var/lib/pgsql/data/base/1 ... ok
-bash: creating: command not found
[cdrussell@p26lxpnetm0001 ~]$ initializing pg_authid ... ok
-bash: initializing: command not found
[cdrussell@p26lxpnetm0001 ~]$ initializing dependencies ... ok
-bash: initializing: command not found
could not write to log file: No space left on device
FATAL: could not write lock file "postmaster.pid": No space left on device
FATAL: could not write lock file "postmaster.pid": No space left on device
[cdrussell@p26lxpnetm0001 ~]$ creating system views ... ok
-bash: creating: command not found
[cdrussell@p26lxpnetm0001 ~]$ loading system objects' descriptions ... ok
> creating conversions ... ok
> creating dictionaries ... ok
> setting privileges on built-in objects ... ok
> creating information schema ... ok
> vacuuming database template1 ... ok
> copying template1 to template0 ... ok
> copying template1 to postgres ... ok
>
> Success. You can now start the database server using:
>
> /usr/bin/postgres -D /var/lib/pgsql/data
> or
> /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start
>
> LOG: could not bind IPv6 socket: Cannot assign requested address
> HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
> LOG: could not bind IPv4 socket: Cannot assign requested address
> HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
> WARNING: could not create listen socket for "localhost"
> FATAL: could not create any TCP/IP sockets
> could not write to log file: No space left on device
> could not write to log file: No space left on device
> FATAL: could not write lock file "postmaster.pid": No space left on device
> FATAL: could not write lock file "postmaster.pid": No space left on device
> could not write to log file: No space left on device
> FATAL: could not write lock file "postmaster.pid": No space left on device
> FATAL: could not write lock file "postmaster.pid": No space left on device
>
> ^C
[cdrussell@p26lxpnetm0001 ~]$ /usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start
pg_ctl: could not open PID file "/var/lib/pgsql/data/postmaster.pid": Permission denied
Can you tell i am no Linux guru?
Re: Cannot Login to Nagios After DB repair
Posted: Fri Nov 14, 2014 3:38 pm
by lmiltchev
You may need to run the vacuum on postgres in standalone mode. Try running the following commands one by one:
Code: Select all
service postgresql stop
su postgres
echo "VACUUM FULL;" > /tmp/fix.sql
postgres -D /var/lib/pgsql/data nagiosxi < /tmp/fix.sql
echo "VACUUM FULL;" > /tmp/fix.sql
postgres -D /var/lib/pgsql/data postgres < /tmp/fix.sql
echo "VACUUM FULL;" > /tmp/fix.sql
postgres -D /var/lib/pgsql/data template1 < /tmp/fix.sql
exit
service postgresql start
Let us know if this fixed your problem.