Auto-Login only for a single host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Auto-Login only for a single host

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Auto-Login only for a single host

Post 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]
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: Auto-Login only for a single host

Post 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?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Auto-Login only for a single host

Post 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.
Former Nagios employee
b2m
Posts: 71
Joined: Tue Jun 11, 2013 9:18 am

Re: Auto-Login only for a single host

Post by b2m »

Yes thanks. A
    nd is it still rotating then or should this be done by the presenter script?
    tmcdonald
    Posts: 9117
    Joined: Mon Sep 23, 2013 8:40 am

    Re: Auto-Login only for a single host

    Post 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).
    Former Nagios employee
    b2m
    Posts: 71
    Joined: Tue Jun 11, 2013 9:18 am

    Re: Auto-Login only for a single host

    Post 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
    abrist
    Red Shirt
    Posts: 8334
    Joined: Thu Nov 15, 2012 1:20 pm

    Re: Auto-Login only for a single host

    Post 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?
    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.
    b2m
    Posts: 71
    Joined: Tue Jun 11, 2013 9:18 am

    Re: Auto-Login only for a single host

    Post 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.
    User avatar
    lmiltchev
    Bugs find me
    Posts: 13589
    Joined: Mon May 23, 2011 12:15 pm

    Re: Auto-Login only for a single host

    Post 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.
    Be sure to check out our Knowledgebase for helpful articles and solutions!
    Locked