Page 1 of 1
Pass Creds to NagVis
Posted: Wed Oct 28, 2015 2:33 pm
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?
Re: Pass Creds to NagVis
Posted: Wed Oct 28, 2015 10:13 pm
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
Re: Pass Creds to NagVis
Posted: Wed Oct 28, 2015 11:11 pm
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.
Re: Pass Creds to NagVis
Posted: Thu Oct 29, 2015 12:18 pm
by tmcdonald
What XI and NagVis versions are you using?
Re: Pass Creds to NagVis
Posted: Fri Oct 30, 2015 12:09 am
by doneil326
Nagiosxi 5.2.0
Nagvis 1.8.5
Re: Pass Creds to NagVis
Posted: Fri Oct 30, 2015 11:09 am
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?
Re: Pass Creds to NagVis
Posted: Fri Oct 30, 2015 2:07 pm
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
Re: Pass Creds to NagVis
Posted: Wed Nov 04, 2015 1:17 am
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
Re: Pass Creds to NagVis
Posted: Wed Nov 04, 2015 10:02 am
by rkennedy
Thanks for sharing your work around. Can I make this thread as solved, and close it out now?
Re: Pass Creds to NagVis
Posted: Wed Nov 04, 2015 12:52 pm
by doneil326
yes, please resolve it