NagVis / nagvis

Visualization addon for your open source monitoring core
http://nagvis.org/
GNU General Public License v2.0
115 stars 73 forks source link

Unable to single sign-on with Nagios / Thruk #367

Open stwongst opened 8 months ago

stwongst commented 8 months ago

Hi all,

We're new to Nagios + Nagvis. Installed a basic configuration:

Rocky Linux 8.7 Nagios 4.5.0 Nagvis 1.9.40

Added link to Nagvis in Nagios side bar. We didn't change Nagvis' httpd conf, leave basic authentication setting commented out.

In /etc/httpd/conf.d/nagvis.conf:

AuthName "NagVis Access"

AuthType Basic

AuthUserFile /usr/local/nagios/etc/htpasswd.users

Require valid-user

In nagvis.ini.php:

[global] logonmodule="LogonMixed" logonenvvar="REMOTE_USER"

User nagiosadmin is created in Nagvis user database with read only right.

We always see the Nagvis login page when clicking the link added to Nagios. Checked the $_SERVER[REMOTE_USER] is defined under path /nagios, while it is undefined if I check that again in paths outside /nagios.

Did I miss anything?

Tried the integration with Thruk and also failed.

Sorry for the newbie question. Please help. Thanks and Regards

yuing32 commented 1 month ago

I have the same problem and also failed after researching 10 hours. Let me say my finding:

  1. Some people say uncomment the following In /etc/httpd/conf.d/nagvis.conf.

    AuthName "NagVis Access"

    AuthType Basic

    AuthUserFile /usr/local/nagios/etc/htpasswd.users

    Require valid-user

I think it is useless currently seems nagvis has its login control and won't use httpd setting. ( I am not sure because I am not professional in httpd, but all results point to it)

  1. About the config in nagvis.ini.php. [global] logonmodule="LogonMixed" logonenvvar="REMOTE_USER"

You declaimed 'If we use the method that set the REMOTE_USER in apache configuration file, seems there is no way to see the login page any more.' (Yes, I have also read your support case also!) I think this is the main problem. Most of the solutions told us to set the REMOTE_USER in apache configuration file, but it means that the user is hardcored in nagvis. As my test, I don't need to log in nagios but still can directly access nagvis without password.

As I checked in website, seems no way to pass the REMOTE_USER only when nagios connects to nagvis.