Monday, September 27, 2010

This blog has moved

Hi again everybody!

This blog has a new home: blogs.op5.com and there's a new blog post that you shouldn't miss: http://blogs.op5.com/blog/2010/09/ninja-1-1-about-to-enter-beta/

This blog will probably be around for a while to make it easier to find the old posts but eventually all the posts will be available at the the new home so please update your bookmark to make sure you don't miss anything.

Don't miss the coming Ninja 1.1 - you'll love it!

See you at http://blogs.op5.com/blog/op5/op5-tech-blog/ninja-for-nagios/

Wednesday, May 12, 2010

Improved Search

As I promised in an earlier post, I will try to explain the search capabilities in Ninja.

The easiest way to perform a search is to simply start typing in the search field. An ajax search will be performed in the background and the result will be presented as you type.
The default is to search for hosts and clicking on a row will lead you to the Service Status Details for the host you clicked on. To search for another type of object, you can add service: (or s:) before your search term.

The same thing is valid for host- and servicegroups.


Depending on what object type is searched for, the search will look for wildcard matches in different fields as outined below. The reason for using these fields are simply that they are the only available text fields that we can use in our search.


All searches are case insensitive and will be using wildcards in both ends of the search term.

If you press enter in the search field without specifying the object type, a search will be made on all object types and the result will be presented in a new page with one part for each object type as the one below.











Since day one, these search capabilities has been much appreciated but as with everything else there are always room for improvements.
As of today there will be some new features available to further improve the search in Ninja.

Adding AND and OR search
Some people have requested a possibility to search for both hosts and services.
Lets say you would like to find all PING services on all hosts called Linux. By entering h:linux AND s:ping in the search field and press enter, the search will do just that.

To make things even better you can now do a search like:
h:linux OR windows AND s:ping OR http which will search for services called something like ping or http on hosts called something like linux or windows.

Pretty neat, huh?

Limiting the search result
One thing that might confuse or even annoy people using the search in Ninja is the fact that there is a limit on the search result, resulting in a maximum of 10 rows to be returned from the search (for each object type). The search limit is defined (in 'search_limit') in config/config.php, so it is of course possible to change this default behavior but now there are other ways of changing the limit on demand.

Just enter limit=100 (or any other number) to limit the number of returned rows or set limit=0 to disable it entirely (i.e return all rows) for the current search.

So, by putting these things together you can now perform a search like h:linux OR windows AND s:ping OR http limit=0

Since this search syntax might be somewhat confusing at first, there is now a small help icon available on the search result page briefly describing the above.

The OR search is possible for all object types but the AND search only works between hosts and services.

Happy searching!

Wednesday, April 14, 2010

Ninja 1.0 released

We are proud to announce that Ninja now has reached 1.0.

First of all I would like to thank all of you that has been participating by testing, submitting bugs and patches, etc.

During the last 12-14 months, Ninja has grown to something like 28.000 lines of code apart from the (Kohana) framework itself and the included libraries (in application/vendor) and there has been 2654 commits between february 2009 and today.

We have put alot of work into trying to optimize Ninja to be a useful and fast alternative to the standard cgi's.

As you can see in the image here, the difference in load time for the service details view between Nagios 3.x and Ninja 1.0 will increase the more services you are monitoring.
This behaviour is, ofcourse, the same for all of the larger views in Nagios or Ninja.

If we instead take a look at the footprint (amount of loaded data) for the same page we can see that these differences are even further augmented.

The reasons for this is ofcourse highly optimized code but mainly it's because we are splitting the result over several pages (pagination).

The tests above has been conducted on a fast LAN connection making the differences even bigger being on a slow connection.

Using Ninja, you will no longer have the problem with pages reloading
before they are fully loaded.

What's next?
So, where do we go from here? Now that we have re-created the functionality of the old Nagios CGI's we can start to think about and implement all the nifty features that people want. We have some ideas, quite a lot in fact, but we would like to hear what you think.

I believe that the best way to go along here is that you go to bugs.op5.com, signup for an account and start adding your feature requests. Or, leave a comment here and I will make sure it gets added to bugs.op5.com.

Now, go download Ninja, Merlin and the other stuff - and enjoy!

Friday, October 2, 2009

More on Widgets

Even though there hasn't been any posts here lately the work is very much in progress.

There has been quite a lot of people testing Ninja/Merlin all during the last couple of months and we really appreciate all feedback that we get and try to respond as quickly as we possibly can. Keep it up!

There has been changes in some areas of Ninja during this time but the previous posts still holds.

When it comes to widgets, they now have some additional functionality which makes them even more useful.

Edit
All included widgets now supports editing if enabled (by setting class 'editable') in the wrapping div. By using JavaScript it is now possible to get background (Ajax) refresh with just a few lines of code.

Example:
In the network healt widget (netw_health) a javascript resource is added in the php file
$this->js = array('/js/netw_health');

This file only contains the following code:

$(document).ready(function() {
var netw_health = new widget('netw_health', 'widget-content');
});

As you can see, it's only one line of code wrapped in the document ready event listner. It creates a new instance of the widget JavaScript class with 2 arguments:
  • the widget identifier (widget name) and
  • what CSS class in the widget that should be updated by the Ajax call.
By adding this code, a JQuery UI slider will be created to be used when editing update frequency. The element with the CSS class 'widget-content' in the example above will be updated with the interval set by the slider (default 60 sec).

It's just that simple. ;-)

More features
There are also other nifty features that has been added lately:
  • Possibility to pause page refresh.
    Sometimes you don't want the page to keep refreshing. By checking the "Pause refresh" checkbox under settings you may now pause the page refresh.
  • Hide Page Header.
    By checking this checkbox under settings, the page header (with the status totals widget and links) will be hidden. This is a feature that the old CGI:s had and Ninja should of course have it too.
  • Paging.
    Host- and service status listings might get rather long and to make the pages load faster we now use paging. The default number of items shown is set to 100 by default but an arbitrary number of items can be used on each page. The dafault value has to be changed in config/pagination.php (the 'items_per_page' key) today but the plan is to move this to the GUI in the future.
  • Improved search functionality.
    This was demonstrated at Nordic Meet On Nagios 2009 but I haven't made any posts on this yet and a more in-depth post will cover this later. The functionality of the the search result will also be enhanced even further.
  • Floating table headers.
    Sometimes when viewing large data sets in tables, you loose sight of the table haders and to make it easier to see what the values in the table stand for. To amend this, we added floating table headers to make the column labels to float with the page as you scroll down.
There has been suggestions that we should set up a wiki to handle documentation for Ninja/Merlin and this will be launched shortly. Keep an eye on www.op5.org for updates!

Once again, thanks to everybody for contributions, suggestions, patches etc - we need your input!

Wednesday, June 10, 2009

Report from Nordic Meet On Nagios 2009

Last week I made a presentation of Ninja at the Nordic Meet On Nagios 2009 hosted by op5 in Stockholm, Sweden. The presentation received quite some attention and regarding from the number of questions afterwards, people were very interested and eager to hear about future plans and features.

The agenda for my presentation was:
  • Background
  • Dependencies
  • Short on MVC
  • The Ninja API
  • Possible modifications
  • Add-on integration
  • Differences to todays CGI's
  • Live DEMO
  • Thoughts on the future (Low Hanging Fruit and such)
The presentation lasted approximately 1 hr including questions etc and was broadcasted through Bambuser. It is still available from http://nordicmeetonnagios.op5.org/ and will soon be available from youtube as well.

If you don't have the time to watch the entire presentation my slides are also available as a PDF: The Ninja project - an alternative open source Nagios GUI goes live

After the presentation, Ethan Galstad, the Founder of Nagios who was was invited as a key speaker, raised the question if we (op5) would be interested in making Ninja the default Nagios GUI. Since one of our main goals was to create the leading Open Source web frontend for Nagios, the answer was rather given.

Ethan and the community has created a fantastic and impressive piece of software that deserves a modern web GUI. It deserves attention and ideas from the large group of skilled web developers and designers out there and we strongly believe that Ninja could be the way to achieve this. Both me personally and everybody at op5 will be happy to make this contribution to the Nagios project.

Thursday, May 21, 2009

Screenshots and progress update

Thought I'd just share a few words on how things a moving forward with the Ninja project.

The plan is to release an alpha during the Nordic Meet On Nagios 2009 conference in Stockholm, Sweden June 3-4. We are working quite hectic these days to make the plan hold and we are confident that we will succeed albeit we're on a very tight schedule.

Currently we are working with converting some of the last big CGI's and at the same time, our interface designer is polishing the default theme. If you are interested to see some screenshots, I suggest you take a look at http://www.op5.org/community/projects/ninja where we keep some screenshots of our prototypes.

As always, we would greatly appreciate all comments and feedback.

What would You like to see in the Ninja GUI?
Give me a hint - or download the code and do it yourself :)

Monday, April 20, 2009

Authentication

As default, the Nagios CGI's relies on basic authentication. Even though this is usually sufficient from a security perspective, it has some drawbacks. One is that it isn't possible to logout unless you use some third party (Firefox) plugins/addons or simply close all browser instances. Maintaining users in htpasswd files isn't that posh either - keeping user authentication data (login, password etc) in a database, on the other hand, is. Switching to LDAP or the like isn't a walk in the park either. Other means of authentication is what we need.

Currently we use the Kohana Auth Module which is a driver based authentication module using sessions. This will provide a reasonably good authentication with salted hash passwords stored in the database. As it is driver based, we plan to extend it with LDAP support in the future. If we are lucky enough the friendly guys over at Kohana will already have done this for us when we get this far on our journey ;-)

The auth Module has support for authorization (roles) but since Nagios has it's own way of configuring who will see and do what, we will probably stick with that to make things transparent to users that are already familiar with the Nagios concept.

The current authentication implementation is possibe to configure in the config/auth.php file. It is today possible to change the default session lifetime, hash_method (defaults to sha1), salt pattern, driver, minimum username characters and maximum failed login attempts (default is false). Even though the latter directive doesn't lock down an IP or whatever at the moment, it seemed like a good idea to include support for it from start :)

As mentioned before, this is work in progress and any input is highly appreciated.