Pass Creds to NagVis

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
doneil326
Posts: 82
Joined: Fri Aug 14, 2015 3:26 pm

Pass Creds to NagVis

Post by doneil326 »

We are trying to use nagvis with xi to pass creds from the logged in user in nagiosxi to the nagvis server. Nagvis documentation says to use the "remote_user" env variable to do this. it does not seem that nagiosxi sets this as an available variable for us to call in the session to redirect the username. we also see that for the login identification you are using $_SESSION['username'] in your php. we tried setting this as the variable to pass to nagvis and it also fails. It is quite cumbersome to not have trusted auth with nagvis and to force our users to login twice. Is there any nagios documentation on setting this up or plugins to do so?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Pass Creds to NagVis

Post by Box293 »

Can you read this post to see if this is the answer to your problem:

https://support.nagios.com/forum/viewto ... f=6&t=9550
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
doneil326
Posts: 82
Joined: Fri Aug 14, 2015 3:26 pm

Re: Pass Creds to NagVis

Post by doneil326 »

this does not answer my question. i do not want to hardcode a user nagiosadmin. i want to pass the current user like $_SESSION['username'] or $_SESSION['REMOTE_USER'] but it does not seem like you are populating them.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Pass Creds to NagVis

Post by tmcdonald »

What XI and NagVis versions are you using?
Former Nagios employee
doneil326
Posts: 82
Joined: Fri Aug 14, 2015 3:26 pm

Re: Pass Creds to NagVis

Post by doneil326 »

Nagiosxi 5.2.0
Nagvis 1.8.5
User avatar
WillemDH
Posts: 2320
Joined: Wed Mar 20, 2013 5:49 am
Location: Ghent
Contact:

Re: Pass Creds to NagVis

Post by WillemDH »

That would truly be a nice feature. I need to log in twice several times a day... And also getting complaints from users who dont understand why.

Oh did you upgrade your NagVis successfully? You are on 1.8! How did you do it?
Nagios XI 5.8.1
https://outsideit.net
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Pass Creds to NagVis

Post by jdalrymple »

Not possible to do securely.

Do you care about security? If not then it may be possible by means of adjusting the NagVis link to include your username and password. The problem is we'd have to make your cleartext XI (and possibly AD if that's the case) available in the UI. I'm being a bit facetious just saying that "it may be possible" - we'd never actually do that.

The problem is it's basic http auth for multiple sites. The data can't be passed from one to the other:

http://stackoverflow.com/questions/3392 ... le-sign-on
doneil326
Posts: 82
Joined: Fri Aug 14, 2015 3:26 pm

Re: Pass Creds to NagVis

Post by doneil326 »

i found a workaround by altering the nagvis.conf. This allows you to use two host headers and allow readonly access via one to all users and then prompt for auth for the other.

SetEnvIf Host "domain1\.com" require_auth=true
SetEnvIf Host "domain2\com" REMOTE_USER=readonly-account

AuthName "NagVis Access"
AuthType Basic
AuthUserFile /usr/local/nagiosxi/etc/htpasswd.users

Order Deny,Allow
Deny from all
Satisfy any
Require valid-user
Allow from env=!require_auth
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Pass Creds to NagVis

Post by rkennedy »

Thanks for sharing your work around. Can I make this thread as solved, and close it out now?
Former Nagios Employee
doneil326
Posts: 82
Joined: Fri Aug 14, 2015 3:26 pm

Re: Pass Creds to NagVis

Post by doneil326 »

yes, please resolve it
Locked