Our new dashboard
The old dashboard we used earlier had a couple of issues. It showed all SOFT nagios states and it also listed every service pr host that was down. Since it’s pretty obvious that a service is down on a host that is down, we wanted to change that. Instead of continuing the rather hard work of changing the dirty status.dat parsing, we just dropped that project and checked out Merlin. Once installed and configured correctly, merlin will enable an eventbrokermodule in the nagiosconfig and update merlins mysql database via the eventbroker. The database contains all hosts and statuses state changes and so on, so this is what we ended up with : (Pic of our current dashboard in our office)
This dashboard lists only hosts that are down and not acknowledged in nagios in its upper left corner. Then there’s a little tactical overview in the upper right corner (this will have more info shortly) and finally all unhandled serviceproblem listed below. Exactly what we want.
The bottom “toolbar” is transparent and has a countdown timer for page refresh and shows the current time.
Thanks again to Jonas, for the design!
You can download the files from git : https://github.com/mortis1337/nagios-dashboard
Just change the login info in merlin.php to match your merlin database and it should run smoothly.
Note: The dashboard needs firefox 3.6.
Enjoy.
http://dingleberry.me/2010/04/our-new-dashboard/
Tags: dashboard, merlin, nagios

May 3rd, 2010 at 13:45
If you dont want to show services that are scheduled for downtime on this dashboard, just change the sql on line 125ish to to the following
select service.host_name,service.service_description,service.last_hard_state,service.last_hard_state_change,service.last_check from service,host,scheduled_downtime where host.host_name = service.host_name and service.last_hard_state in (1,2) and service.problem_has_been_acknowledged = 0 and host.problem_has_been_acknowledged = 0 and host.last_hard_state not like 1 and host.host_name not in (select distinct host_name from scheduled_downtime where start_time unix_timestamp()) group by service.service_description order by service.last_hard_state desc
May 6th, 2010 at 09:43
I made an error in the group by clause, it should be : select service.host_name,service.service_description,service.last_hard_state,service.output, service.last_hard_state_change,service.last_check from service,host,scheduled_downtime where host.host_name = service.host_name and service.last_hard_state in (1,2,3) and service.problem_has_been_acknowledged = 0 and host.problem_has_been_acknowledged = 0 and host.last_hard_state not like 1 and host.host_name not in (select distinct host_name from scheduled_downtime where start_time unix_timestamp()) group by service.host_name, service.service_description order by service.last_hard_state desc;
update it or you might be missing a few hosts
May 27th, 2010 at 08:52
A guy changed the query to only show info from a certain contactgroup.
Here’s what he says (Thanks, Per!):
I got it to work, but I had to add an index to the host_contactgroup table.
W/O the index my query took 1,5 minutes adn we have some 800 hosts.
Our query looks like this
$query = “select service.host_name, service.service_description,”;
$query = $query.” service.last_hard_state, service.output, service.last_hard_state_change,”;
$query = $query.” service.last_check”;
$query = $query.” from service, host, scheduled_downtime”;
$query = $query.” where service.host_name in”;
$query = $query.” (select host.host_name from host”;
$query = $query.” join host_contactgroup on host.id = host_contactgroup.host”;
$query = $query.” join contactgroup on host_contactgroup.contactgroup = contactgroup.id”;
$query = $query.” where contactgroup.contactgroup_name = ‘CONTACTGROUP’)”;
$query = $query.” and host.host_name = service.host_name”;
$query = $query.” and service.last_hard_state in (1, 2)”;
$query = $query.” and service.problem_has_been_acknowledged = 0″;
$query = $query.” and host.problem_has_been_acknowledged = 0″;
$query = $query.” and host.last_hard_state not like 1″;
$query = $query.” and host.host_name not in”;
$query = $query.” (select distinct host_name from scheduled_downtime”;
$query = $query.” where start_time unix_timestamp())”;
$query = $query.” group by service.host_name, service.service_description”;
$query = $query.” order by service.last_hard_state desc”;
The new index where created like this
create index ix_contactgroup_host USING BTREE ON host_contactgroup (contactgroup,host);
/Per
July 6th, 2010 at 20:22
Thanks so much for this really awesome dashboard monitor! It’s just what we needed.
I have one question though…
Why on line 13 of merlin.php do you query to see if last_hard_state?
last_hard_state doesn’t get set until a HARD state is triggered PLUS the time of the retry_interval! :-s
If the retry interval is configured as 1 minute then the dashboard will only display the host down an extra 1 minute after you can see it down in the Nagios web interface.
July 15th, 2010 at 16:36
Would it be possible to integrate an alert sound to the dashboard? So when an issue comes up it plays a alert sound.
thks a lot
July 16th, 2010 at 09:45
This looks great, but it’s not working for me.
I’ve installed Merlin, edited merlin.php, however, nagios.php does not display any data.
All that’s displayed is the countdown timer.
Any ideas? Using nagios 3.2.1
I can confirm that data is being written to the merlin database.
July 19th, 2010 at 17:27
I’m trying to paste some code to let you have sounds with your alerts, but this comments thing won’t let me and just presents me with a blank screen :-/
July 19th, 2010 at 18:29
hmmm justin, maybe its too many chars for the comment or something. Try using pastebin.org or something (and select “retained forever”)
July 20th, 2010 at 06:35
Any ideas why my dashboard is not displaying any alerts?
July 20th, 2010 at 07:45
carlo, did you get your databaselogin info in merlin.php correct?
Are you sure merlin is working? Try go into mysql and see whats in the database. Are the tables empty? Did you run the import script in merlin? Also, nagios.php uses some fancy css stuff that might not work / will look bad ..in older browsers.
July 20th, 2010 at 09:33
mortis, merlin.php database information is correct. merlind is running.
You are correct – it seems there is no data within the merlin database.
Which import script are you referring to?
I followed the merlin quickstart guide below:
https://wiki.op5.org/merlin:docs:quickstart-debian5
Thanks in advance,
Carlo
July 20th, 2010 at 09:37
in our setup its in /usr/local/nagios/addons/merlin/import.php
(you prolly gotta edit it and change user/password)
but be sure that you still get host/service events updated in merlin after you run this initially.
July 20th, 2010 at 10:06
Ok, I’ve put this on github now, if someone wants to make changes to it, or contribute with some new stuff.
http://github.com/mortis1337/nagios-dashboard
July 20th, 2010 at 11:26
morten, I have run import.php and can confirm that the database has been populated with data.
I have already changed merlin.php to reflect the correct database credentials.
Still no luck? Any ideas?
July 20th, 2010 at 11:41
Scratch that, restarted after running import.php and everything is working.
Fantastic dashboard!
July 20th, 2010 at 11:45
Last question – how do I ensure hosts/service updates are reflected in merlin?
July 20th, 2010 at 12:12
Carlo, I suggest you send an email to the merlin mailinglist as I’m not that familiar with merlin
August 16th, 2010 at 15:22
does a database populated by ndoutils theoretically store similar information? would be great to use that as an alternative backend for this nice dashboard. maybe I will have a look into it. thanks for your work!
August 19th, 2010 at 11:39
http://github.com/foobar0815/nagios-dashboard
August 22nd, 2010 at 12:49
sweet, nice work
September 9th, 2010 at 15:53
I am getting no output on nagios.php besides countdown timer and time.
Database has data, I ran select statements from merlin.php by hand and get results, but if I run merlin.php from the command line I get an error:
php -l ./merlin.php
PHP Parse error: syntax error, unexpected T_ELSE in ./merlin.php on line 28
Errors parsing ./merlin.php
I don’t have any unhandled host errors so it should print “All problem hosts has been acknowledged.” any suggestions?
September 10th, 2010 at 09:51
tenpin what version of php are you running?
September 10th, 2010 at 16:15
php -version
PHP 5.3.3 (cli) (built: Jul 22 2010 17:12:45)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
September 10th, 2010 at 19:11
oki, thats odd. Are you using the code from git? http://github.com/mortis1337/nagios-dashboard
ran the php syntax check here and get no errors.
September 13th, 2010 at 16:58
Ok, got it figured out. Was running php53 on RHEL from the remi repository, removed remi repo, installed IUS repo, downgraded php53 to php52 and now it works.
October 1st, 2010 at 10:53
This is a great update to the original version. The only change I’ve made internally is changing the SQL query for Unhandled service problems to sort DESC so that critical problems show up first
October 5th, 2010 at 18:03
Thank you for greate Dash!
October 27th, 2010 at 15:39
And if i am not using merling (not using any database), how could we integrate that frontend ?
October 28th, 2010 at 19:01
The dashboard in this article does not support reading .dat files. However …theres a similar (older) dashboard here http://dingleberry.me/2009/11/nagios-operations-dashboard/
and also if you are considering using ndoutils and not merlin ..you can check the fork of this dashboard here : http://github.com/foobar0815/nagios-dashboard/
November 1st, 2010 at 15:17
Help please… the unhandled services section on the dash is not populating and I am getting the folowing error in the deamon log:-
Failed to connect to ‘merlin’ at ‘localhost’:’0′ as root:(null): 1045: Access denied for user ‘root’@'localhost’ (using password: YES)
Any advice would be appreciated
November 1st, 2010 at 15:30
John R : that is your mysql permissions.
log in to mysql and do something like : grant all privileges on *.* to ‘root’@'localhost’ identified by ‘yourpasswordhere’;
and change the php file to have the same user/pass
November 1st, 2010 at 15:31
yeah, and i wouldnt advise you to use ‘root’ tho, as you could rather make a merlin user
November 1st, 2010 at 16:10
Thanks for the info Mortis, got a question though. The php file is it the import.php?
February 9th, 2011 at 23:36
Great dashboard. I’ve written a mklivestatus backend for it but can’t seem to figure out how to upload files to the github. Do I first create a fork of the nagios-dashboard project and upload to that? My files are ready to upload as soon as I can figure out how to do it.
-greg
February 9th, 2011 at 23:47
I’m having trouble with the dashboard displaying colors or text in IE 7 and 8. The headings and table structure is visible but all the table fields display white. Any ideas or suggestions as to cause?
Thanks,
-greg
February 10th, 2011 at 00:42
hey Greg, yep, suggestion as to cause is : IE is not meant to be used for internet. Download firefox and live happily ever after
February 10th, 2011 at 01:27
Okay, I reread the blog and see where it says it requires FF 3.6, I take that to mean that IE does not work.
February 10th, 2011 at 22:07
Mortis,
Is there a way to upload a livestatus.php file to allow your dashboard to work with mklivestatus without using a git client. I’m not familiar with git at all and am hoping to avoid traveling down that road. But I’d like to contribute this code to your project. Please advise.
Thanks,
Greg F
February 10th, 2011 at 22:56
A guy wrote support for ndoutils for this dashboard. He forked the dashboard on git and added his stuff. That is the adviced way to do it. If you dont feel like doing that, you could upload the file somewhere and give me the link, and i could upload it to git and give you credits for your work
February 17th, 2011 at 15:57
Hi,
This is a great dashboard and does exactly what we need however could anyone shed some light on the reason why it is only supported on Firefox as I am interested in seeing if we can get it operational on IE/Opera/Safari.
March 5th, 2011 at 00:11
Greg and Mortis,
I would like to try the livestatus.php based on the mklivestatus method. Is there any new info about the livestatus.php? If there is a place to download the php it would be great.
Thanks.
March 9th, 2011 at 12:24
The dashboard featured on OP5 website, with added features by Ipnett AS:
http://www.op5.org/community/plugin-inventory/dasboards/dashboard
cool
June 18th, 2011 at 11:48
Typically I do not submit on posts, but I may enjoy to say that this site seriously pressured me to get it done! Thanks, really great submit.
September 2nd, 2011 at 10:41
Hey guys
I am very very interested in the livestatus setup. Is there any way i can get hold of the livestatus.php file?
October 8th, 2011 at 19:49
[...] herramienta, pero esta nueva versión es para Nagios con Mysql, ya que la ultima usa el status.dat. Nueva Versión Linux, Nagios, OtrosSysadmin! ← Nagios 3.2.3 + Nagios Theme + Cacti en Debian 6 Squeeze [...]
October 21st, 2011 at 11:23
FYI – I created a “fork” for Icinga on Github
https://github.com/hbokh/icinga-dashboard
based on foobar’s ndoutils-code. This one uses ido2db instead.
October 21st, 2011 at 11:55
nice BOK
October 28th, 2011 at 10:34
Would be nice if it would talk with mklivestatus, as I’m using that now.
Any ideas about that?
October 28th, 2011 at 10:49
Erik, it currently asks a merlin-populated mysql-database, but if you use mklivestatus to populate mysql in the same way, that would work. If you wanna use mklivestatus directly, you’ll need to do a lot of coding i think
November 2nd, 2011 at 22:38
is this in active development? and can you provide some documentation for customising this.
November 2nd, 2011 at 23:00
M N: check http://www.op5.org/community/plugin-inventory/dashboards/dashboard
December 8th, 2011 at 22:16
[...] The original project place is http://dingleberry.me/2010/04/our-new-dashboard/ [...]
August 24th, 2012 at 12:58
@tenpin I was having the same problem on Cent OS 6.3 using PHP 5.3. If you change the php.ini file and turn on short tags then the script works fine.
August 29th, 2012 at 17:14
Great!!!
Thank fro sharing this with the Nagios community!!
Any idea to add sound on new event?
September 4th, 2012 at 16:27
Great!! works fine, any idea about playing sounds when warning/critical ?
September 18th, 2012 at 15:09
I’ve done some coding on this and collected a few patches from other people, so the dashboard now, among other things, works in most browsers and handles acknowledgement and downtime; my fork is at https://github.com/fnordpojk/merlin-dashboard if you want to have a look.
January 10th, 2013 at 19:08
Hi,
This great dashboard !!!
I would like to have this one hostgroup and not all hosts on the dashboard?
is it possible?
What should I change?
Thanks
gaudijon
January 10th, 2013 at 19:18
gaudijon, i guess you could modify the sql-sentances?