Page 1 of 2
Auto-Login only for a single host
Posted: Mon Jun 02, 2014 6:51 am
by b2m
Hi,
we are planning to establish a litte NOC-screen (TV + RaspberryPi). For that we want a script to open the Nagios XI rotating views of the "raspberry"-Account in a browser on boot and display it on the TV without user interaction.
Can we pass the credentials for the login-script with the URL? The alternative would be to enable auto-login for this single host (fixed IP-adress) as we don't want auto-login for all clients.
What is the best solution?
Thanks a lot.
Re: Auto-Login only for a single host
Posted: Mon Jun 02, 2014 1:38 pm
by sreinhardt
You would be best suited to send it via the web page and not enable auto-login. You absolutely can either append the user credentials to a post request(I believe) then connect yourself to the page you would like, or directly go to the page you want, and append the user you wish to authenticate as backend api ticket to the url. Such as
Code: Select all
http://localhost/nagiosxi/username=test-admin&ticket=[backend ticket ID]
Re: Auto-Login only for a single host
Posted: Mon Jun 02, 2014 2:43 pm
by b2m
Thank you, it works like that (with Firefox, not with IE(?)):
Code: Select all
https://192.168.1.1/nagiosxi/views/?username=test&ticket=xxxxxxxx
Last question how can I start the page in full-screen like when I click on the small blue arrow in XI unter interface?
Re: Auto-Login only for a single host
Posted: Mon Jun 02, 2014 2:48 pm
by tmcdonald
You can get the URL for a particular dashboard/view by right-clicking the page and (at least in Firefox) click "This Frame -> Open Frame in New Tab". Then the URL in the address bar will point directly to the dashboard/view you were on without the sidebar.
Re: Auto-Login only for a single host
Posted: Mon Jun 02, 2014 2:52 pm
by b2m
Yes thanks. A
nd is it still rotating then or should this be done by the presenter script?
Re: Auto-Login only for a single host
Posted: Mon Jun 02, 2014 3:20 pm
by tmcdonald
Viewing a specific page in "fullscreen" will only show that page. The rotation is handled by the outer frame (the header, footer, and sidebar) dynamically loading each page every 7 seconds (or however fast you have it set to rotate).
Re: Auto-Login only for a single host
Posted: Mon Mar 09, 2015 7:23 am
by b2m
Hi everyone,
I need to push this thread up, sorry for that.
We want to use a raspi to display different opscreens for different hostgroups on a TV. So I created a user which can see hosts in hostgroup1 and another for hostgroup2.
The raspi first polls
Code: Select all
https://w.x.y.z/nagiosxi/includes/components/opscreen/opscreen.php?username=user1&ticket=ticket1
after some seconds it polls
Code: Select all
https://w.x.y.z/nagiosxi/includes/components/opscreen/opscreen.php?username=user2&ticket=ticket2
The problem is that only hosts / alarms from hostgroup1 are shown although hostgroup2 is polled. This is no local caching issue on the raspi.
Can you give me a hint please?
Thanks alot and best wishes
b2m
Re: Auto-Login only for a single host
Posted: Mon Mar 09, 2015 11:42 am
by abrist
b2m wrote:The problem is that only hosts / alarms from hostgroup1 are shown although hostgroup2 is polled. This is no local caching issue on the raspi.
So, just to clarify, the views rotate but the data displayed is only for the first hostgroup and never the second?
Re: Auto-Login only for a single host
Posted: Mon Mar 09, 2015 1:03 pm
by b2m
abrist wrote:b2m wrote:The problem is that only hosts / alarms from hostgroup1 are shown although hostgroup2 is polled. This is no local caching issue on the raspi.
So, just to clarify, the views rotate but the data displayed is only for the first hostgroup and never the second?
Exactly, you got it. I've got 22 hosts in hostgroup1 which are also shown when hostgroup2 should be shown. I also tried this with Firefox.
Re: Auto-Login only for a single host
Posted: Mon Mar 09, 2015 2:33 pm
by lmiltchev
I am not sure how you set up the rotation in the browser but you will need to find a way for clearing cookies BEFORE loading each URL.