Viewing blog post - Greg's Tech blog

Return to blog

A better nagios interface

Posted by gmartin on Tue 03 of March, 2009 13:30 EST
I'm always hacking at something. Today I turned my 3.0.3 Nagios interface into something more exciting. I converted it to the Nuvola style (cache) which I think looks great. Especially compared to the plain and aged Nagios interface.

While playing with the interface, I had the idea of adding a countdown timer until page refresh so I went looking for a way to do it.

First I found a javascript timer at hashemian.com (cache) (thanks Robert). I copied the countdown.js file to the root of my web server to save him bandwidth.

Nagios will include customer header or footer files if you create them in the right place and name them correctly. I created a file called status-footer.ssi in the nagios/ssi directory. The contents of the file are as follows:

ript language="JavaScript">
TargetDate = new Date();
TargetDate.setSeconds(TargetDate.getSeconds() + 90);

BackColor = "ltgray";
ForeColor = "dkgray";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "Status refresh in: %%M%% minute %%S%% seconds.";
FinishMessage = " Refresh!";

ript language="JavaScript" src="/countdown.js">

This code is a modified version of what Robert posted to his blog. The first two lines set the countdown time to now plus 90 seconds which is the default refresh time for the pages.

I then



Permalink Print Email This Post

Welcome [toggle]