NagStatus (Windows Sidebar Gadget) with Icinga/Nagios

I’m sure the most people already know Nagstamon which is a small handy tool to display the overall Nagios/Icinga on different platforms.

But because I mainly use Windows 7 at the office and at home (have a Debian-Dualboot at home, but mainly use Win7) I wanted a Windows Sidebar Gadget to display the Icinga Status.

After a short web search I’ve found Nagstatus, which is a very nice look Windows Sidebar Gadget which grabs the status from a XML-Stream which is provided by an own CGI.

There are just a few steps to get it up and running.

First download the most current version from http://nagstatus.com/pages/category/release . Currently it is 1.5.3. Just open the ZIP-File. Inside the folder “XMLProviderScript” you’ll find the nagxmlstatus.cgi, which must be copied inside the CGI-BIN-Directory from your Icinga/Nagios Installation. CGI-BIN it just the alias, in the file systems it’s the sbin folder. On a default installation you’ll find it at:

/usr/local/icinga/sbin/
or
/usr/local/nagios/sbin/

Furthermore you have to change the permissions so it’s executable for your webserver. (Yes, I know that I permit more than is really necessary, but I’m not so paranoid as some people are 😉 )

As mentioned on the website from Nagstatus it’s Perl and use the LibXML-Libraries. If you don’t have installed those libraries already, do it by run:

aptitude install libxml-perl libxml-libxml-perl

After the installation is completed you must provide the path to your status.dat file.

So just open the nagxmlstatus.cgi with your favorite editor and edit the $STATUSFILE-Variable on Line 15.

To try that it works correctly just run the following inside Bash

./nagxmlstatus.cgi -n host -e current_state

An XML-Stream should be displayed with the current state of your hosts.

So, the last step is just to configure the Nagstatus-Gadget to point to your server.

Just rename the before downloaded ZIP-File to *.gadget and double-click it.

You should choose ‘Install’ 😉

The newly installed gadget will appear somewhere on your desktop. Just look around 😉 In the default-state it will give you a hint what we have to do next =”XML Provider URL is unset. Please enter a valid URL in settings.”

So we’ll do that.

Move your mouse onto the gadget and a small screw wrench will appear. Click on it so the options will pop up.

Just enter the missing information and confirm the settings with OK.

And voila

When clicking on the gadget a more detailed windows hovers up.

In my opinion it’s a real cool looking gadget and at least for Windows a good replacement (or addition) to Nagstamon.

4 responses to “NagStatus (Windows Sidebar Gadget) with Icinga/Nagios”

  1. do you know if you can run multiple instances of this gadget? I have two Server farms I want monitor. … Thanks

  2. Hy

    That is no problem. You can add as much gadgets (also the same) as you have space on your screens 🙂 I do it the same with my private Icinga Instance and the Nagios installation we have running in my company 🙂

  3. Thanks for this tutorial. I tried on my system and it works very well.

  4. I can’t run the script on the server without sudo in front of it. Is this permissions related?

Leave a Reply

Your email address will not be published. Required fields are marked *