Nagios is not able to be logged in from GUI

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
amit.ahuja
Posts: 113
Joined: Fri May 15, 2015 8:20 am

Nagios is not able to be logged in from GUI

Post by amit.ahuja »

Hi,

We are currently having trouble login to Nagios from GUI. We used the username and password, which were correct for sure, and clicked the login button. Then, the page was refreshed but sent us back to the login page again. It seems clicking on the login button just refresh the page without actually login.

Thanks in advace
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Nagios is not able to be logged in from GUI

Post by hsmith »

Can you log in to core?

http://x.x.x.x./nagios instead of http://x.x.x.x/nagiosxi
Former Nagios Employee.
me.
amit.ahuja
Posts: 113
Joined: Fri May 15, 2015 8:20 am

Re: Nagios is not able to be logged in from GUI

Post by amit.ahuja »

Yes, I can log into core.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Nagios is not able to be logged in from GUI

Post by hsmith »

What are the contents of /etc/httpd/conf.d/nagiosxi.conf?
Former Nagios Employee.
me.
amit.ahuja
Posts: 113
Joined: Fri May 15, 2015 8:20 am

Re: Nagios is not able to be logged in from GUI

Post by amit.ahuja »

<Directory "/usr/local/nagiosxi/html">
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
# AuthName "Nagios XI"
# AuthType Basic
# AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users
# Require valid-user
</Directory>

Alias /nagiosxi "/usr/local/nagiosxi/html"

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule nagiosxi/api/v1/(.*)$ /usr/local/nagiosxi/html/api/v1/index.php?request=$1 [QSA,NC,L]
</IfModule>
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios is not able to be logged in from GUI

Post by scottwilkerson »

You can reset the nagiosadmin password with the following script

Code: Select all

/usr/local/nagiosxi/scripts/reset_nagiosadmin_password.php --password=<newpassword>
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
amit.ahuja
Posts: 113
Joined: Fri May 15, 2015 8:20 am

Re: Nagios is not able to be logged in from GUI

Post by amit.ahuja »

Hi, I reset the password, but the same issue still exists. It does not seem like the password authorization problem, because it does not prompt the username or password is wrong, just refreshes the login page.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios is not able to be logged in from GUI

Post by scottwilkerson »

Did you modify any of the httpd configuration files?

Any mysql errors?

Code: Select all

tail -f /var/log/mysqld.log
Finally, you do have cookies and sessions enabled in your browser correct?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
amit.ahuja
Posts: 113
Joined: Fri May 15, 2015 8:20 am

Re: Nagios is not able to be logged in from GUI

Post by amit.ahuja »

I did not modify any of the httpd configuration files. In mysqld.log, i saw some errors as below,

Code: Select all

160322 11:23:00 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
160322 11:23:00 [ERROR] Can't start server: can't create PID file: Permission denied
Also, I found I was not able to run /usr/local/nagiosxi/scripts/reconfigure_nagios.sh. I gave me this error.

Code: Select all

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mcrypt.so' - /usr/lib64/php/modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2016-03-22 15:37:13--  http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”

    [ <=>                                                                            ] 9,860       --.-K/s   in 0.02s

2016-03-22 15:37:14 (538 KB/s) - “nagiosql.export.monitoring” saved [9860]

NAGIOSQL WRITE CONFIGS FAILED!\n
Thanks
amit.ahuja
Posts: 113
Joined: Fri May 15, 2015 8:20 am

Re: Nagios is not able to be logged in from GUI

Post by amit.ahuja »

The only thing I did before this happens was that I changed the user of the directories in /var to nagios, then accessing web interface showed we needed to repair db. Then I changed the user back to root, then we were still not able to login.
Locked