Newly installed xi login page redirecting back to itself

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
BenCowan
Posts: 85
Joined: Thu Jul 28, 2011 11:34 am

Newly installed xi login page redirecting back to itself

Post by BenCowan »

Nagios xi Version 5.8.3
RedHat V8 (Linux 4.18.0-240.22.1.el8_3.x86_64)

I'm being coerced into migrating off of CentOS7 to RedHat8. Anyway, my first attempt did not go too horribly bad, and everything appears to now be running without errors, however, the xi interface login page redirects back to itself after entering the credentials for nagiosadmin. I know the password is good, because I can login to core successfully. Most searches for this error point to a discrepancy with the time, but I don't think that is my issue.

Any suggestions for debugging appreciated. I looked at all the logs I could think of and found nothing obvious. As this is my first RedHat8 system for anything, I'll be kickstarting it and re-installing xi at least a couple more times, before I start to panic.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Newly installed xi login page redirecting back to itself

Post by ssax »

Please run these commands as root on the xi server and PM me the resulting /usr/local/nagiosxi/var/components/profile.zip file.

Code: Select all

rm -rf /usr/local/nagiosxi/var/components/profile*​​
/usr/local/nagiosxi/scripts/components/getprofile.sh SUPPORT
Then run this command as root:

Code: Select all

zip -r /tmp/HTTPDFILES.zip /etc/httpd/conf/httpd.conf /etc/httpd/conf.d
Then PM the the resulting /tmp/HTTPDFILES.zip file.
BenCowan
Posts: 85
Joined: Thu Jul 28, 2011 11:34 am

Re: Newly installed xi login page redirecting back to itself

Post by BenCowan »

Quick update to this... I started over again (fresh kickstart and re-install) and I ran into the same problem. I got it working finally, but I worked myself into such a rage I don't remember everything I had to do. Much of it was due to bad permissions, especially on /usr/local/nagiosxi/includes/html and a weird one /var/lib/php/session and also, the fact that I'm using an alternate user and groupname for apache. Some wise guy put the user 'apache' in Active Directory and I can't use it, so I'm using apachexi:apachexi. I'm planning to do this again multiple times and take notes next time. I can't help but feel like the 'fullinstall' scripts are buggy for RHEL8... at least when using an alternate apache id.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Newly installed xi login page redirecting back to itself

Post by ssax »

Is that profile from the new system or the old system that you're no longer using?

I see this in the profile:

Code: Select all

[1620062575] SERVICE NOTIFICATION: nagiosadmin;localhost;Service Status - httpd;WARNING;xi_service_notification_handler;(No output on stdout) stderr: sudo: Account expired or PAM config lacks an "account" section for sudo, contact your system administrator
If you are still seeing that in your /usr/local/nagios/var/nagios.log, send the output of this command:

Code: Select all

chage -l nagios
You should be installing on a fresh minimal install of the OS without any customizations done outside of re-IPing if you need (don't setup AD integration until after xi is installed).
BenCowan
Posts: 85
Joined: Thu Jul 28, 2011 11:34 am

Re: Newly installed xi login page redirecting back to itself

Post by BenCowan »

Hey ssax, the doc I sent you was from yesterday before I started over, but I'm glad you reminded me. I had to run the chage command on user nagios to reset the expiration. That was definitely one of the show-stoppers I ran into. Our RHEL8 Admin has our servers sharing a /home directory, and the uid=1000 is already taken by oracle, so I had to pre-define nagios:nagios with alternate uid:gid(s). I used Ansible, and I think I need to review how to setup a new user, so it doesn't immediately expire. :-(

Thank you!
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Newly installed xi login page redirecting back to itself

Post by vtrac »

Hi,
Glad to hear that you have this under control .... :-)

Please let us know if we can lock / close this thread.

Regards,
Vinh
BenCowan
Posts: 85
Joined: Thu Jul 28, 2011 11:34 am

Re: Newly installed xi login page redirecting back to itself

Post by BenCowan »

Yes, we can close, but before I do... Here are some things I ran into...

# fullinstall crashed on php install. dnf only knew about later release:
# - Fix:
dnf module reset php

# - User apache already exists and is an AD user, so use apachexi:apachexi
vi /tmp/nagiosxi/xi-sys.cfg
- apacheuser=apachexi
- apachegroup=apachexi
Also, C-cronjobs has a bug in it. Fixed line that had apache hardcoded, rather than Sapacheuser

# Error fixes required after first or second run of fullinstall
vi /etc/httpd/conf/httpd.conf
- User apachexi
- Group apachexi
vi /etc/php-fpm.d/www.conf
- user = apachexi
- group = apachexi

# php-fpm
vi /etc/php-fpm.d/www.conf
- listen.acl_users = apachexi,nginx
systemctl restart php-fpm.service

# permissions
find /usr/local/nagiosxi/html -user root -group root -exec chown apachexi:nagios {} \;
chown apachexi:apachexi /var/lib/php/session

# postgresql won't start
postgresql-setup --initdb
systemctl restart postgresql.service

# users expired ?
apachexi (ran chage)
nagios (ran chage)

# logrotate errors
vi /etc/logrotate.d/nagiosxi
- su apachexi nagios (add this directive to the auditlog requirements)

...still getting errors from the automysqlbackup too, and it's emailing my whole group.. :-(

...also after migrating my CentOS7 production system to this newly created RedHat8 system, nagios won't start due to ndo.so wanting libmysqlclient.so.18, but the system installed with libmysqlclient.so.21. Something brought over from my current Production system points to this shared object, but I can't find it, YET!
User avatar
vtrac
Posts: 903
Joined: Tue Oct 27, 2020 1:35 pm

Re: Newly installed xi login page redirecting back to itself

Post by vtrac »

Very helpful info ..... should be very helpful for someone doing new install.

Thank you!! .... locking thread ... :-)