Page 1 of 1

Viewing graphs in external web application

Posted: Tue Nov 23, 2010 12:08 pm
by r.jaynes
Howdy!

We have a customer support portal for some of our services, and as part of that we would like to provide graphs that are monitored in our Nagios XI. Are there resources (that I have missed) to do this, or would someone have a suggestion on how to proceed? Basically we want Customer X to login to their own portal, and view their network or server charts.

Thank you,

Ryan

Re: Viewing graphs in external web application

Posted: Tue Nov 23, 2010 12:28 pm
by tonyyarusso
I can think of two ways to approach this:

1) Let them just log into XI and look at stuff directly. The way user permissions work they will only see the hosts & services they have been given access to. This is explained in more detail in the document Multi-Tenancy With Nagios XI.

2) Link to images directly from a separate portal application. They are generated on the fly based on URL parameters, so for instance the 24-hour view of the Ping service on localhost here in the office can be accessed at http://192.168.5.57/nagiosxi//includes/ ... vice_id=86

Re: Viewing graphs in external web application

Posted: Tue Nov 23, 2010 3:02 pm
by r.jaynes
Tony,

I didn't realize it would be so simple (in regards to #2). Are there any permissions problems with referencing the image directly?

Thank you!

Re: Viewing graphs in external web application

Posted: Tue Nov 23, 2010 3:30 pm
by r.jaynes
It looks like there may be. When I try to browse to an image directly with out having previously logged in I get "Your session has timed out." Is there someway around this?

Re: Viewing graphs in external web application

Posted: Tue Nov 23, 2010 5:09 pm
by mguthrie
....sort of...

It's a little bit of a hackjob since this feature isn't officially built into XI, but if you're ok with a workaround, you can access your pnp graphs by going to http://192.168.5.80/nagios/pnp/index.php?host=localhost. This directory is protected by Apache's basic authentication, but you could create a dummy user for apache and put the login credentials in the url. However, it should be noted that user would have web access to anything under the nagios core directory.

XI uses session based authentication, and I know there's a workaround that too, but you'd have to write a custom PHP script to do it, and I couldn't tell you off hand how to do it.

Re: Viewing graphs in external web application

Posted: Tue Nov 23, 2010 6:07 pm
by tonyyarusso
Ah, true, the authentication bit. You could also edit the Apache config to have a separate authentication realm that just grants access to the PNP directory I would think, and then you wouldn't have to worry about them having access to the rest of Nagios Core.