Page 1 of 1

Creating a dashboard that does not require user log in

Posted: Wed Feb 21, 2018 2:32 pm
by netagurion
Hi,

I am having issues creating a dashboard to display on a large screen. I would like to set this up so the user will not have to log in to get the dashboard. Currently I have tried a few solutions.

I am running Nagios XI 5.4.12

I created a user that has read only privileges and created a dashboard under that user account.

When I try the following URL:

Code: Select all

http://llkwnagiosxi/nagiosxi/api/v1/dashboards/dashboard.php?id=g0YjDhBD&apikey=<api key from user account settings>
I get the error "No Endpoint: dashboards" and nothing shows up

When I try and use the following URL:

Code: Select all

http://server_name/nagiosxi/dashboards/dashboard.php?id=g0YjDhBD&username=kioskuser&ticket=<ticket number from API settings>
I get the dashboard to show but the dashlets say "Your session has timed out"

If I SSH into the server and run:

Code: Select all

curl -XGET "http://localhost/nagiosxi/api/v1/objects/hoststatus?apikey=<api key from user account settings>&pretty=1"
I get the expected output and appears to be working correctly.

I am at a loss as I believe I have correctly followed the instructions for 2 different ways to complete this task. Any help would be appreciated.

Re: Creating a dashboard that does not require user log in

Posted: Wed Feb 21, 2018 3:06 pm
by npolovenko
Hello, @netagurion. This is the right syntax:

Code: Select all

http://server_name/nagiosxi/dashboards/dashboard.php?id=g0YjDhBD&username=kioskuser&ticket=<ticket number from API settings>
But before using the link please go to the Admin settings, then System Config->System Settings in the left column, open the Security Tab and check the box that says:

Code: Select all

Disable - Do not restrict pages from being opened in iframes from anywhere. (Will not apply X-Frame-Options or Content-Security-Policy: frame-ancestors headers)
Click on Update Settings.
That should do it.

Re: Creating a dashboard that does not require user log in

Posted: Wed Feb 21, 2018 4:08 pm
by netagurion
I still got " your session has timed out" after updating the security setting and saving.

I am trying to use the Latest Alerts widget and it loads but where the content of the alert is supposed to be it says that it timed out.

Re: Creating a dashboard that does not require user log in

Posted: Wed Feb 21, 2018 4:24 pm
by npolovenko
@netagurion, This thread has a solution to the session timing out issue:
https://support.nagios.com/forum/viewto ... t=+session
Let me know if it works for you.

Re: Creating a dashboard that does not require user log in

Posted: Fri Feb 23, 2018 2:27 pm
by netagurion
I am attaching a photo of the problem... for kicks I tried:

Code: Select all

session.gc_maxlifetime = 31536000
Per the post you referenced and it made no difference.

Re: Creating a dashboard that does not require user log in

Posted: Fri Feb 23, 2018 5:12 pm
by lmiltchev
Are you trying to open the link, made for the "kioskuser" user, while you are still logged in as another user, e.g. "nagiosadmin" (in the same browser)? What are the security settings of the "kioskuser" user? Are there any other check-boxes selected in addition to the "read-only" box?

You should be able to log in (or masquerade in) as "kioskuser", create a dashboard, and get a permalink for it. After this, you could use the "Backend API URL" component, grab the "ticket" for this user, and append the username and the ticket at the end of the permalink. Test the link in a new browser.

Did this work for you?

Re: Creating a dashboard that does not require user log in

Posted: Tue Feb 27, 2018 3:20 pm
by netagurion
Hello,

I finally got the dashboard to load, but it appears that my bandwidth graphs are in GMT and not EST as defined in the admin > system settings section.

Re: Creating a dashboard that does not require user log in

Posted: Tue Feb 27, 2018 4:22 pm
by npolovenko
@netagurion, Is your workstation located in the same timezone as the Nagios server? Or are they both located in the EST timezone? If the Nagios server is located in a different time zone then that is a known issue.

Re: Creating a dashboard that does not require user log in

Posted: Fri Mar 02, 2018 10:05 am
by netagurion
Indeed. Changed the timezone on local device and the issue is rectified. Thanks for your help.. this can be closed out.

Re: Creating a dashboard that does not require user log in

Posted: Fri Mar 02, 2018 11:25 am
by scottwilkerson
Glad it is working