Nagvis logout

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Nagvis logout

Post by BanditBBS »

Ok, so I am finally starting to use nagvis here and believe it or not, I only have one question(I've used it in a past life).

How on earth do you logout of NagVis? In IE if I close the window and go back in, it requests my nagvis ID/Pass again, but in Chrome it only did the first time and no matter what I try it never asks be who I am again and I can't get logged out as my nagvis admin ID.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagvis logout

Post by lmiltchev »

Does clearing the browser's cookies help?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Nagvis logout

Post by BanditBBS »

lmiltchev wrote:Does clearing the browser's cookies help?
Probably, but I don't want to have to do that every time I login to nagvis on a different PC. That would probably upset some users, lol.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
snapon_admin
Posts: 952
Joined: Mon Jun 10, 2013 10:39 am
Location: Kenosha, WI
Contact:

Re: Nagvis logout

Post by snapon_admin »

Agreed, we've used NagVis for awhile now and the lack of a logout option is....irritating. No one's really complained about it until recently so I've never bothered with a feature request or anything, but now that it's come up it is somewhat annoying to not have a way to logout.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Nagvis logout

Post by BanditBBS »

FYI - I deleted cookies and I am still being auto logged in as my admin user.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagvis logout

Post by abrist »

You need to clear the browser cache, as basic auth tokens are stored there.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Nagvis logout

Post by BanditBBS »

abrist wrote:You need to clear the browser cache, as basic auth tokens are stored there.
I guess I have to live with this and just don't login to nagvis as me on other people's computers. Go ahead and lock this up.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Nagvis logout

Post by rkennedy »

Posting this solution here for anyone that is searching around as I solved this in a ticket today.
First, open up /usr/local/nagvis/share/userfiles/templates/default.header.html

Look for -
<li><a href="#">{$langLoggedIn}: {$currentUser}</a></li>

Below it, add -
<li><a href="../../logout">Logout</a></li>

Now, open up /etc/httpd/conf.d/nagvis.conf and navigate tot the end of the file, you should see -

</IfModule>
</Directory>

You'll need to add two things here. First, above both of those lines add -

# Added for Nagvis logout button
RewriteCond %{HTTP_COOKIE} ^.*logout=1.*$
RewriteRule ^/nagvis/logout$ / [R,L,co=logout:0:%{HTTP_HOST}:0:/logout]
RewriteRule ^/nagvis/logout$ - [R,L,co=logout:1:%{HTTP_HOST}:0:/logout]

Then, below both of the lines add -

<Location /nagvis/logout>
Require user nonexistinguser
</Location>

The bottom of the file should now look like this -

# Added for Nagvis logout button
RewriteCond %{HTTP_COOKIE} ^.*logout=1.*$
RewriteRule ^/nagvis/logout$ / [R,L,co=logout:0:%{HTTP_HOST}:0:/logout]
RewriteRule ^/nagvis/logout$ - [R,L,co=logout:1:%{HTTP_HOST}:0:/logout]

</IfModule>
</Directory>

<Location /nagvis/logout>
Require user nonexistinguser
</Location>
Former Nagios Employee
Locked