Page 1 of 1

Question: Is it possible to use inline login for nagios?

Posted: Thu Oct 11, 2012 5:26 pm
by KiwiBloke
Hi,

We have two Nagios servers that monitor one Data Center site each.

I am building a monitoring system that will periodically rotate between various full screen windows on a kiosk PC in our Ops center. The windows will be various monitoring systems, nagios is one of these.

what i want to be able to do is have a permalink to the tactical ops screen in nagios on each server side by side in an hta using frames (by setting each frame src to "http://nagiosA/nagiosxi/includes/compon ... screen.php" or "http://nagiosB/nagiosxi/includes/compon ... screen.php"

Currently I get a bank ops screen for both because the hta has called an url without logging in.

I am aware that we can set a user to be nominated as a default user, so that who ever hits the Nagios page gets automagically logged in as this user, if they want their own rights to apply, they logout and log in as themselves.

However, I don't want to use this mechanism as our client also has access to Nagios via their own very restricted login, and I don't want to nominate this as the default as i would have to give it more privileges than I am willing to give them.

So the question is:
Can I use inline login for an url to nagios to pass the credentials though so I get my TacOps screens displaying correctly.

eg
http://nagiosA/nagiosxi/includes/compon ... &pass=pass or
http://user:pass@nagiosA/nagiosxi/inclu ... screen.php

neither of these options work btw.

The kiosk is on a secure private network, and the account used will be low rights anyway, so the issue of having credentials in clear text is not a huge risk.

Any ideas?

KB.

Re: Question: Is it possible to use inline login for nagios?

Posted: Fri Oct 12, 2012 9:40 am
by mguthrie
As long as the password in the URL isn't a problem, I think there's probably a way to do this, but let me experiment with this and see how to do it. I'll let you know what I find.

Re: Question: Is it possible to use inline login for nagios?

Posted: Fri Oct 12, 2012 9:46 am
by mguthrie
Looks like you can access the URL directly using the backend ticket from the Backend API URL component. That component generates a backend login hash for that user.

Example:
http://myserver/nagiosxi/includes/compo ... t=vjetslg0

Re: Question: Is it possible to use inline login for nagios?

Posted: Fri Oct 12, 2012 10:07 am
by scottwilkerson
Actually you were looking at a different component than mguthrie mentioned.

I had a look and if you don't need authentication and want system wide data, the easiest thing would be to edit
/usr/local/nagiosxi/html/includes/components/opscreen/merlin.php

and at the top change

Code: Select all

$opscreen_component_xi=true;  // should opscreen use Nagios XI code?
to

Code: Select all

$opscreen_component_xi=false;  // should opscreen use Nagios XI code?

Re: Question: Is it possible to use inline login for nagios?

Posted: Sun Oct 14, 2012 3:47 pm
by KiwiBloke
worked like a charm!

Thanks guys :)

Re: Question: Is it possible to use inline login for nagios?

Posted: Tue Oct 16, 2012 10:57 pm
by KiwiBloke
ahha, he typed too soon. although i don't think this is a nagios issue, I already have a work around

In order to display the TacOps screen i was using an HTA split into two frames with one DC in each. While the page appears to load and the count down to update works, it doesn't appear to ever update!

You can force it manually to update by hitting F5, and then both frames and therefore TacOps pages refresh correctly. Not much use for a NOC display though!

The work around is to reject the HTA idea and just use a standard browser with all the toolbars, tab options disabled/turned off.

This raises another issue though as the TacOps screen has a generic name, so the window names are the same (so my vbscript to cycle the active window borks itself).

if you edit /usr/local/nagiosxi/html/includes/components/opscreen/opscreen.php and change the pagetitle attribute at the top of the page to include site information eg "SiteA ..." and "SiteB ..." then the windows are unique and can be cycled. Always best to make a bkup copy of opscreen.php first of course, and to reboot the box after making the change.

C.

Re: Question: Is it possible to use inline login for nagios?

Posted: Wed Oct 17, 2012 10:34 am
by mguthrie
We'll have to take a look at the component and see what's going on with the refresh. The nocscreen component for sure refreshes every 30 seconds, and actually displays more data on the page:

http://exchange.nagios.org/directory/Ad ... nt/details

Re: Question: Is it possible to use inline login for nagios?

Posted: Wed Oct 17, 2012 2:07 pm
by KiwiBloke
Hi,

Cheers for that. This component looks promising. I see i an edit the window title like the TacOps screen which is good.

Is there a way to allow this page to be accessed without authentication like that TacOps screen?

C.

Re: Question: Is it possible to use inline login for nagios?

Posted: Wed Oct 17, 2012 4:21 pm
by mguthrie