Page 1 of 2

Hostgroup Summary - requires authentication

Posted: Mon Jan 21, 2019 12:49 pm
by SteveBeauchemin
Why is this?
Hostgroup-Authentication-Needed-Why.PNG
Please advise.

Steve B

Re: Hostgroup Summary - requires authentication

Posted: Mon Jan 21, 2019 5:44 pm
by ssax
I believe this occurs when you downgrade Core to 4.2.4. Are you running core 4.2.4 because of gearman or another bug?

Code: Select all

/usr/local/nagios/bin/nagios -V
What version of XI are you running as well?

Re: Hostgroup Summary - requires authentication

Posted: Mon Jan 21, 2019 6:04 pm
by SteveBeauchemin
I am running Gearman.

I notice that /usr/local/nagiosxi/etc/htpasswd.users is no longer getting updated.

Last time stamp is Jan 9 which matches the date I upgraded.

Got a work around?

Please advise.

Steve B

Re: Hostgroup Summary - requires authentication

Posted: Tue Jan 22, 2019 11:55 am
by lmiltchev
I haven't been able to recreate the issue on a test XI system, running Nagios Core 4.2.4 and ModGearman. So, let's get some more information.

Can you show us the permissions fo the htpasswd.users?

Code: Select all

ls -la /usr/local/nagiosxi/etc/htpasswd.users
Start a running tail on the cmdsubsys.log:

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log
then from the Nagios XI web UI, go to Admin > Manage Users > <your user> > Edit, enter a new password for the user, and click on "Update User". Go back to the terminal, stop the tail (Ctrl + c), copy and paste the output on the forum.

Also, upload the sudoers file on the forum.

Re: Hostgroup Summary - requires authentication

Posted: Tue Jan 22, 2019 2:03 pm
by SteveBeauchemin

Code: Select all

ls -la /usr/local/nagiosxi/etc/htpasswd.users
-rw-rw---- 1 nagios apache 10443 Jan  9 14:39 /usr/local/nagiosxi/etc/htpasswd.users
Pertinent portion of sudoers file

Code: Select all

User_Alias      NAGIOSXI=nagios
User_Alias      NAGIOSXIWEB=apache

NAGIOSXI        NAGIOSSXIHOST=NOPASSWD: /etc/init.d/nagios * ,\
                /etc/init.d/ndo2db * ,\
                /etc/init.d/npcd * ,\
                /etc/init.d/httpd * ,\
                /etc/init.d/mysqld * ,\
                /etc/init.d/mariadb *,\
                /etc/init.d/postgresql * ,\
                /etc/init.d/gearmand * ,\
                /etc/init.d/mod-gearman2-worker * ,\
                /etc/init.d/supervisord *,\
                /etc/init.d/nagiosxi * ,\
                /etc/init.d/rrdcached *,\
                /etc/init.d/snmptrapd * ,\
                /etc/init.d/snmptt * ,\
                /etc/init.d/tomcat * ,\
                /etc/init.d/tomcat6 * ,\
                /etc/init.d/crond*,\
                /etc/init.d/iptables*,\
                /usr/local/nagiosxi/scripts/upgrade_to_latest.sh ,\
                /usr/local/nagiosxi/scripts/change_timezone.sh ,\
                /usr/local/nagiosxi/scripts/manage_services.sh * ,\
                /usr/local/nagiosxi/scripts/manage_ssl_config.sh * ,\
                /usr/local/nagiosxi/scripts/reset_config_perms.sh ,\
                /usr/local/nagiosxi/scripts/repair_databases.sh * ,\
                /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh ,\
                /usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php * ,\
                /usr/local/nagiosxi/scripts/backup_xi.sh *
NAGIOSXIWEB     NAGIOSSXIHOST=NOPASSWD: /usr/bin/tail -100 /var/log/messages,\
                /usr/bin/tail -100 /var/log/httpd/error_log ,\
                /usr/bin/tail -100 /var/log/mysqld.log ,\
                /usr/bin/tail -100 /var/log/mariadb/mariadb.log ,\
                /etc/init.d/snmptt restart ,\
                /etc/init.d/gearmand *,\
                /etc/init.d/supervisord *,\
                /usr/local/nagiosxi/scripts/repair_databases.sh ,\
                /usr/local/nagiosxi/scripts/manage_services.sh * ,\
                /usr/local/nagiosxi/html/includes/components/profile/getprofile.sh ,\
                /usr/bin/php /usr/local/nagiosxi/html/includes/components/autodiscovery/scripts/autodiscover_new.php *
from the Nagios XI web UI,
go to Admin > Manage Users > <your user> > Edit,
enter a new password for the user, (nevergonnarememberthis)
and click on "Update User".

Code: Select all

tail -f /usr/local/nagiosxi/var/cmdsubsys.log

PROCESSING COMMAND ID 61158...
Setting new htaccess credentials
Updating password for user 1_dashboard_dev
OUTPUT=
RETURNCODE=0
.........
PROCESSED 1 COMMANDS
Then for kicks... I see that the passwd file updated.

Code: Select all

ls -la /usr/local/nagiosxi/etc/htpasswd.users
-rw-rw---- 1 nagios apache 10443 Jan 22 12:55 /usr/local/nagiosxi/etc/htpasswd.users
Just in case this matters - I am using DUO for 2FA.

Please let me know next steps.

Thanks

Steve B

Re: Hostgroup Summary - requires authentication

Posted: Tue Jan 22, 2019 2:16 pm
by SteveBeauchemin
I just did a DUO test...

Turned off DUO for my user.

ran this:

Code: Select all

watch -n 4 "ls -la /usr/local/nagiosxi/etc/htpasswd.users"
And when I logged in the time stamp changed.

Steve B

Re: Hostgroup Summary - requires authentication

Posted: Tue Jan 22, 2019 5:04 pm
by scottwilkerson
I think that for some reason that page is trying to load something directly in the /nagios/ directory.

Can you run the following and then try to load the page and see what shows up

Code: Select all

tail -f /var/log/httpd/ssl_access_log|grep 401

Re: Hostgroup Summary - requires authentication

Posted: Tue Jan 22, 2019 5:45 pm
by SteveBeauchemin
Scott,

Code: Select all

tail -f /var/log/httpd/ssl_access_log | grep 401
131.199.14.41 - - [22/Jan/2019:16:43:34 -0600] "GET /nagios/js/jquery-1.7.1.min.js HTTP/1.1" 401 381
Is this what you expected?

Steve B

Re: Hostgroup Summary - requires authentication

Posted: Tue Jan 22, 2019 6:10 pm
by scottwilkerson
Yep. This looks like collateral damage from having to downgrade Core for mod_gearman.

Attached is a file that can be unzipped and replace /usr/local/nagiosxi/html/includes/components/nagioscore/coreuiproxy.inc.php that should resolve the issue.

Re: Hostgroup Summary - requires authentication

Posted: Wed Jan 23, 2019 11:33 am
by SteveBeauchemin
Scott,

Thanks !

The file works for me. Am I able to get that file from a Nagios XI 5.4.13 install if I need it again? In case I have to do a new install and add mod_gearman. Or is this a custom fix just for me. Just curious.

Also, I noticed that the file - /usr/local/nagiosxi/etc/htpasswd.users - is still not getting a new time stamp when I login. I even updated an account password in AD, logged in using the LDAP / DUO authentications. Got in okay. The file did not update.

Is that file needed any more? Or is that now unused. Do I need to be concerned.

Thanks

Steve B