Inline login for nagios xi issue

This support forum board is for support questions relating to Nagios xi, our flagship commercial network monitoring solution.
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Inline login for nagios xi issue

Post by westernuniv »

Hi,

I’ve tried access the URL directly using the backend ticket from the Backend API URL component. It seems that I can see all the hosts/ services regardless of what had been authorized for the specific user.

For eg: I have used the backend login hash for a user called “test” that has been authorized to view certain services. But when I browse to the following URL, I could see all the host/serivces
https://<nagios-host>/nagiosxi/includes/components/xicore/status.php?show=services?username=test&ticket=gdddlq

Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Inline login for nagios xi issue

Post by slansing »

Had you logged out of the administrator account prior to using this URL to access the test user? I was not able to recreate this here unless I was still logged into the administrator's account.
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Re: Inline login for nagios xi issue

Post by westernuniv »

Yes I've logged in before as an admin acct. Once I logged out, and browse again to the URL, I've got " Your session has timed out" error

Thanks
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Inline login for nagios xi issue

Post by mguthrie »

The problem is in the URL, you have two question marks, so the credentials are being ignored.

https://<nagios-host>/nagiosxi/includes/components/xicore/status.php?show=services?username=test&ticket=gdddlq
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Re: Inline login for nagios xi issue

Post by westernuniv »

I've tried again after replacing 2nd "?" with "&", still getting the same error.
https://<nagios-host>/nagiosxi/includes/components/xicore/status.php?show=services&username=test&ticket=gdddlq
Do users need to have certain privileges to execute those phps?

Thanks
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Inline login for nagios xi issue

Post by mguthrie »

Same results on my machine. I don't think that page is setup to currently accept a backend ticket. It the auto-login feature a possibility for your scenario?

[EDIT]: From looking into this further, this is actually a result of some code we recently added. I'll post a patch shortly that you can add that will be in the 1.2 release that will allow this login method to work. (1.1 is posting this morning, so it won't be until the next release).
Last edited by mguthrie on Fri Oct 26, 2012 9:37 am, edited 2 times in total.
Reason: Addd more info
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Inline login for nagios xi issue

Post by mguthrie »

Patch to make the inline login work (this will be in the 1.2 release):

Edit: /usr/local/nagiosxi/html/includes/utils.inc.php

Change line 108 from:

Code: Select all

  if($lock)
To:

Code: Select all

if($lock && !isset($_REQUEST['ticket']))
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Re: Inline login for nagios xi issue

Post by westernuniv »

after code change, it worked. Thanks so much