Cannot Login to Nagios After DB repair
Cannot Login to Nagios After DB repair
Not able to logon to Nagios Web page after fixing SQL crash with repairmysql.sh
Re: Cannot Login to Nagios After DB repair
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?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Cannot Login to Nagios After DB repair
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
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:
Code: Select all
tail -50 /var/log/httpd/error_logCode: Select all
service postgresql restartFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Cannot Login to Nagios After DB repair
Attached output
You do not have the required permissions to view the files attached to this post.
Re: Cannot Login to Nagios After DB repair
service postgresql restart
Stopping postgresql service: [ OK ]
Starting postgresql service: [FAILED]
[root@p26lxpnetm0001 cdrussell]# service postgresql start
Starting postgresql service: [FAILED]
[root@p26lxpnetm0001 cdrussell]#
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
Looks like postgres cannot start. Anything interesting in the startup logs:
Code: Select all
cat /var/lib/pgsql/pgstartup.logFormer Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Cannot Login to Nagios After DB repair
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
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
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?
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
You may need to run the vacuum on postgres in standalone mode. Try running the following commands one by one:
Let us know if this fixed your problem.
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 startBe sure to check out our Knowledgebase for helpful articles and solutions!