Page 1 of 1

Unable to see dashboard with valid id in URL

Posted: Thu Aug 17, 2017 12:13 pm
by jrouilla
Hi Everybody:

I have a weird situation. Given the URL

Code: Select all

  https://server/nagiosxi/dashboards/dashboard.php?id=rok38mnb&username=myuser&ticket=a_valid_ticket_from_the_backend_url_component
sometime in the past couple of days this stopped working. The ticket is valid for the user. The error that is reported is:

Bad Dashboard 
Unfortunately for you, that dashboard is not valid... Too bad. Dashboard ID: rok38mnb 

but logging in as the user "myuser" I see the dashboard and the id matches what is in the url above.

I realize publishing this url with credentials is a bad idea .... but I am looking for pointers on figuring out why this is failing suddenly.

What log files should I look at? Do I need to poke something in the db?

Thanks.

-- rouilj

Re: Unable to see dashboard with valid id in URL

Posted: Thu Aug 17, 2017 2:19 pm
by dwhitfield
jrouilla wrote: sometime in the past couple of days this stopped working.
This is the part that is strange to me. Normally the backend URLs would look something like the following: https://assets.nagios.com/downloads/nag ... nd_API.pdf

The thing to do if you want other users to see Dashboards is to use the "Deploy Dashboards" option.

Re: Unable to see dashboard with valid id in URL

Posted: Fri Aug 18, 2017 3:05 pm
by jrouilla
Hi dwhitfield:

It looks like my response to this was discarded by the moderator so I'll try again hopefully with better luck.
dwhitfield wrote: This is the part that is strange to me. Normally the backend URLs would look something like the following: https://assets.nagios.com/downloads/nag ... nd_API.pdf

The thing to do if you want other users to see Dashboards is to use the "Deploy Dashboards" option.
As I understand it the

Code: Select all

username=myuser&ticket=a_valid_ticket_from_the_backend_url_component
part of the url is just a generic mechanism to authenticate to any part of the XI web interface using a single use code
rather than a (in our case LDAP) password.

There is a web page accessible to all employees of the company that allows them to keep track of the systems that they use.
Most of the users of this web page(i.e. the thousands not in the operations side of the company) are not users of nagios. The dashboard
url's are embedded in iframes on a web page. There are some 15-20 or so dashboards from 5 or so different nagios installations all displayed
on a the single web page.

All of the dashboards generated from other nagios installations are working properly. However the set of dashboards coming
from my nagios installation are sometime failing as reported. It appears that the choice of browser may have something to do with this.
The user who originally reported the issue had no problem with Chrome but got the error in IE. I was able to get the error in Firefox and
another co-worker could see the error in Chrome. I am not sure why the browser would cause the error or why the same browser for different
users could show the error.

The authentication portion of the URL is working. If I modify the user or ticket to an invalid value I get:

Code: Select all

Your session has timed out. Click on following link to continue.
rather than an error about the dashboard id.

In the version of nagios we are running: Nagios XI 2014R2.0 it appears that you must be an administrator to be able to Deploy Dashboards.
The user in question isn't an admin for obvious reasons (given the publishing of embedded credentials). Even if the user was able to
deploy the dashboard the users of these dashboards are not users in nagios.

I hope this provides some additional insight as to how this is used and gives you an idea of what could cause the issue.

-- rouilj

Re: Unable to see dashboard with valid id in URL

Posted: Mon Aug 21, 2017 12:25 pm
by dwhitfield
One thing you could do is set up the dashboards for a dashboard-only account and set that account to auto-login.

There are a few open feature requests revolving around dashboards, so it's possible there will be improvements in the future. Unfortunately, I cannot give a version # at this time.

Re: Unable to see dashboard with valid id in URL

Posted: Tue Aug 29, 2017 8:36 am
by jrouilla
Hello dwhitfield:
dwhitfield wrote:One thing you could do is set up the dashboards for a dashboard-only account and set that account to auto-login.
Well this same setup is working with other nagios servers and has worked flawlessly for months. We have no updates to the nagios software or database
that occurred before this problem. So I would prefer to troubleshoot the problem rather than going off on a tangent reconfiguring everything in multiple
places.
dwhitfield wrote: There are a few open feature requests revolving around dashboards, so it's possible there will be improvements in the future. Unfortunately, I cannot give a version # at this time.
Well the question is why is the software telling me I have an invalid dashboard ID when the id is valid? Is this a known bug? What settings do I need to get the logs that would tell me why this
is failing all of a sudden?

-- rouilj

Re: Unable to see dashboard with valid id in URL

Posted: Tue Aug 29, 2017 9:57 am
by scottwilkerson
@jrouilla

This should work however it needs to be noted that the dashboard ID rok38mnb is a specific ID for a specific user.

In certain situations the ID is shared, if the dashboard was shared, but usually the ID will only work for the logged in user.

It would be best to login as the user you want, and investigate which dashboards the are available for them to see.

Re: Unable to see dashboard with valid id in URL

Posted: Thu Aug 31, 2017 2:58 pm
by jrouilla
scottwilkerson wrote:@jrouilla

This should work however it needs to be noted that the dashboard ID rok38mnb is a specific ID for a specific user.

In certain situations the ID is shared, if the dashboard was shared, but usually the ID will only work for the logged in user.

It would be best to login as the user you want, and investigate which dashboards the are available for them to see.
Well that's the point. If I use the user and key I am logged in as the user with that dashboard.

If I change the username or ticket in the url, I don't get an error that the dashboard value/key is invalid. Instead I get an error that my session has timed out.

That tells me that I am logging in as the correct user to use that dashboard id. That dashboard id is valid for that user from my (admittedly brief) perusal of the
database.

So what sort of debugging can I turn on to see why the dashboard id sometimes fails for this user?

-- rouilj

Re: Unable to see dashboard with valid id in URL

Posted: Fri Sep 01, 2017 9:35 am
by scottwilkerson
I re-read through the thread, and had our Senior Developer take a look at the code with this in mind, and the only thing we can come up with is that when it is giving you the error

Code: Select all

Bad Dashboard 
Unfortunately for you, that dashboard is not valid... Too bad. Dashboard ID: rok38mnb
you must already be logged in as a user that does not have access to the dashboard.

Looking at the code, if the session is already established, it will use that session before trying to login using the backend ticket.