Live Service Status Widgit/webpage

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Live Service Status Widgit/webpage

Post by FTL »

Hi all,

We host a fair few websites and have Nagios doing various checks to check if sites are up and then login and trawl various areas of the pages (using a custom written script)

I have been thinking recently something that would be nice to have is a live Service status page.

So rather than have people call up asking if there are problems with the website etc etc and batting a no it isnt, yes it is, no it isnt email convo back and forth, they could first and foremost just visit a web page that will have the live status of the site in question, pulled from Nagios.

So customer A could go to http://mycompanylivestatus.co.uk/customerA - obviously we would have to design some sort of page for this data to be displayed in but thats no biggy.

The websites in question are hosted in IIS on Windows Server 2012 boxes.

There is a main parent site and then all of these sites id like a live status for a virtual directories of that.

My Nagios is running on Ubuntu 12.04 and is a single instance only box - checking only about 200 hosts and services combined


Is there anything out there that will accomplish this do you guys know of?

Thanks
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Live Service Status Widgit/webpage

Post by tmcdonald »

A few ideas right off the bat:

Maybe a little dated but could be a good starting point: Nagios Looking-Glass

Within core you can do this, but it's sorta tricky and would expose the Nagios server's address directly.
FTL wrote:obviously we would have to design some sort of page for this data to be displayed in but thats no biggy.
I think you answered part of your own question there. Are you looking for an API to pull this data so you can display it in your own custom page? If so:

You could take a look at the JSON branch of the Nagios Core project: http://sourceforge.net/p/nagios/nagiosc ... json/tree/

HTML scraping might be somewhat easy in perl, using something like http://192.168.1.100/nagios/cgi-bin/sta ... =localhost - or just php include() the page itself if you can get the authentication working.

If you're really looking for a custom solution you can just pull everything from /usr/local/nagios/var/status.dat and cut out the middleman.
Former Nagios employee
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Live Service Status Widgit/webpage

Post by FTL »

Hi Tmcdonald,

Thanks for your input.

Looking Glass is very close to what id like - however i dont want to have to give away the Nagios address directly.

I have had a slight change of opinion now on what i want to do after sitting down and having another think.

Instead of creating a page for each client to be able to go to (big overheads for such a small feature) - instead im going to use the customer area of my companies website that they can log into and then only be greeted with a service status for their own website taken from Nagios. - hopefully using some sort of iframe or something - doing a curl or something to get the data from Nagios from http://server/nagios/cgi-bin/extinfo.cg ... t=hostname

If it sees green UP then it displays a green Traffic light - amber WARNING - amber light - red CRITICAL a red light.

Just going to work how to do it now :)
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Live Service Status Widgit/webpage

Post by abrist »

That would be the suggested method. Curl and parse the cgi. Others use the json api from mklivestatus. Others parse the status.dat file directly. There are other more exotic ways as well. That actual process of skinning the cat is much shorter than enumerating the different ways.
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.
Locked