<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9144504490896973295</id><updated>2011-08-17T05:08:46.721+02:00</updated><category term='search'/><category term='NMN09'/><category term='Ninja'/><category term='Nagios'/><category term='authentication'/><category term='widget'/><title type='text'>Ninja for Nagios</title><subtitle type='html'>The road to an alternative Nagios GUI</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-1878277435481112998</id><published>2010-09-27T07:19:00.000+02:00</published><updated>2010-09-27T07:19:24.140+02:00</updated><title type='text'>This blog has moved</title><content type='html'>Hi again everybody!&lt;br /&gt;&lt;br /&gt;This blog has a new home: &lt;a href="http://blogs.op5.com/blog/op5/op5-tech-blog/ninja-for-nagios"&gt;blogs.op5.com&lt;/a&gt;&amp;nbsp;and there's a new blog post that you shouldn't miss:&amp;nbsp;&lt;a href="http://blogs.op5.com/blog/2010/09/ninja-1-1-about-to-enter-beta-2/"&gt;http://blogs.op5.com/blog/2010/09/ninja-1-1-about-to-enter-beta/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Don't miss the coming Ninja 1.1 - you'll love it!&lt;br /&gt;&lt;br /&gt;See you at&amp;nbsp;&lt;a href="http://blogs.op5.com/blog/op5/op5-tech-blog/ninja-for-nagios/"&gt;http://blogs.op5.com/blog/op5/op5-tech-blog/ninja-for-nagios/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-1878277435481112998?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/1878277435481112998/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2010/09/this-blog-has-moved.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/1878277435481112998'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/1878277435481112998'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2010/09/this-blog-has-moved.html' title='This blog has moved'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-6096539153000278807</id><published>2010-05-12T16:00:00.007+02:00</published><updated>2010-05-17T07:31:25.595+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='search'/><title type='text'>Improved Search</title><content type='html'>As I promised in an &lt;a href="http://ninja4nagios.blogspot.com/2009/10/more-on-widgets.html"&gt;earlier post&lt;/a&gt;, I will try to explain the search capabilities in Ninja.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_cu2YE9iTvlY/S-qb57ChOZI/AAAAAAAABdM/I9iSFxlmF7A/s1600/default_search.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 190px; height: 85px;" src="http://1.bp.blogspot.com/_cu2YE9iTvlY/S-qb57ChOZI/AAAAAAAABdM/I9iSFxlmF7A/s400/default_search.png" alt="" id="BLOGGER_PHOTO_ID_5470356116797995410" border="0" /&gt;&lt;/a&gt; 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.&lt;br /&gt;&lt;br /&gt;The same thing is valid for host- and servicegroups.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_cu2YE9iTvlY/S-qjOp_n60I/AAAAAAAABdc/UjMUFrgQ_jk/s1600/aliases.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 122px;" src="http://2.bp.blogspot.com/_cu2YE9iTvlY/S-qjOp_n60I/AAAAAAAABdc/UjMUFrgQ_jk/s400/aliases.png" alt="" id="BLOGGER_PHOTO_ID_5470364169581095746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_cu2YE9iTvlY/S-qhGQm1jJI/AAAAAAAABdU/NGP4o6uqpEQ/s1600/search_fields.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 241px;" src="http://3.bp.blogspot.com/_cu2YE9iTvlY/S-qhGQm1jJI/AAAAAAAABdU/NGP4o6uqpEQ/s400/search_fields.png" alt="" id="BLOGGER_PHOTO_ID_5470361826304035986" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;All searches are case insensitive and will be using wildcards in both ends of the search term.&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_cu2YE9iTvlY/S-qlivSt0pI/AAAAAAAABdk/-Pon4PD7JeQ/s1600/result.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; float: left; text-align: center; cursor: pointer; width: 399px; height: 210px;" src="http://4.bp.blogspot.com/_cu2YE9iTvlY/S-qlivSt0pI/AAAAAAAABdk/-Pon4PD7JeQ/s320/result.png" alt="" id="BLOGGER_PHOTO_ID_5470366713623990930" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Since day one, these search capabilities has been much appreciated but as with everything else there are always room for improvements.&lt;br /&gt;As of today there will be some new features available to further improve the search in Ninja.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Adding AND and OR search&lt;/span&gt;&lt;br /&gt;Some people have requested a possibility to search for both hosts &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; services.&lt;br /&gt;Lets say you would like to find all PING services on all hosts called Linux. By entering&lt;code&gt;&lt;span style="font-family:Georgia,serif;"&gt; &lt;/span&gt;h:linux AND s:ping&lt;/code&gt; in the search field and press enter, the search will do just that.&lt;br /&gt;&lt;br /&gt;To make things even better you can now do a search like:&lt;br /&gt;&lt;code&gt;h:linux OR windows AND s:ping OR http &lt;/code&gt;which will search for services called something like ping or http on hosts called something like linux or windows.&lt;br /&gt;&lt;br /&gt;Pretty neat, huh?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Limiting the search result&lt;/span&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Just enter &lt;code&gt;limit=100&lt;/code&gt; (or any other number) to limit the number of returned rows or set &lt;code&gt;limit=0&lt;/code&gt; to disable it entirely (i.e return all rows) for the current search.&lt;br /&gt;&lt;br /&gt;So, by putting these things together you can now perform a search like &lt;code&gt;h:linux OR windows AND s:ping OR http limit=0&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;The OR search is possible for all object types but the AND search only works between hosts and services.&lt;br /&gt;&lt;br /&gt;Happy searching!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-6096539153000278807?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/6096539153000278807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2010/05/improved-search.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/6096539153000278807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/6096539153000278807'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2010/05/improved-search.html' title='Improved Search'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_cu2YE9iTvlY/S-qb57ChOZI/AAAAAAAABdM/I9iSFxlmF7A/s72-c/default_search.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-6015992355384970677</id><published>2010-04-14T10:22:00.017+02:00</published><updated>2010-04-14T14:12:53.819+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><title type='text'>Ninja 1.0 released</title><content type='html'>&lt;div&gt;We are proud to announce that Ninja now has reached 1.0.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First of all I would like to thank all of you that has been participating by testing, submitting bugs and patches, etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;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.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We have put alot of work into trying to optimize Ninja to be a useful and fast alternative to the standard cgi's.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://2.bp.blogspot.com/_cu2YE9iTvlY/S8WMwvloM_I/AAAAAAAABco/gH6yDpvTuEc/s400/load_time.png" style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 240px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5459924892292494322" /&gt;&lt;/div&gt;&lt;div&gt;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.&lt;/div&gt;&lt;div&gt;This behaviour is, ofcourse, the same for all of the larger views in Nagios or Ninja.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://3.bp.blogspot.com/_cu2YE9iTvlY/S8WwfBrjrjI/AAAAAAAABc4/jkjRZMmbfQs/s400/footprint.png" style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 236px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5459964170330156594" /&gt;&lt;div&gt;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.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The reasons for this is ofcourse highly optimized code but mainly it's because we are splitting the result over several pages (pagination).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://3.bp.blogspot.com/_cu2YE9iTvlY/S8WxC4s4_qI/AAAAAAAABdA/qx90MUS2duo/s400/pagination.png" style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 53px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5459964786395119266" /&gt;&lt;/div&gt;&lt;div&gt;The tests above has been conducted on a fast LAN connection making the differences even bigger being on a slow connection.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using Ninja, you will no longer have the problem with pages reloading&lt;/div&gt;&lt;div&gt;before they are fully loaded. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;What's next?&lt;/b&gt;&lt;/div&gt;&lt;div&gt;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.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I believe that the best way to go along here is that you go to &lt;a href="http://bugs.op5.com/"&gt;bugs.op5.com&lt;/a&gt;, 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.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, &lt;a href="http://git.op5.org/git/"&gt;go download&lt;/a&gt; Ninja, Merlin and the other stuff - and enjoy!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-6015992355384970677?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/6015992355384970677/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2010/04/ninja-10-released.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/6015992355384970677'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/6015992355384970677'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2010/04/ninja-10-released.html' title='Ninja 1.0 released'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_cu2YE9iTvlY/S8WMwvloM_I/AAAAAAAABco/gH6yDpvTuEc/s72-c/load_time.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-589399016474419134</id><published>2009-10-02T10:20:00.002+02:00</published><updated>2009-10-02T10:21:36.228+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><category scheme='http://www.blogger.com/atom/ns#' term='NMN09'/><category scheme='http://www.blogger.com/atom/ns#' term='widget'/><title type='text'>More on Widgets</title><content type='html'>Even though there hasn't been any posts here lately the work is very much in progress.&lt;br /&gt;&lt;br /&gt;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!&lt;br /&gt;&lt;br /&gt;There has been changes in some areas of Ninja during this time but the previous posts still holds.&lt;br /&gt;&lt;br /&gt;When it comes to widgets, they now have some additional functionality which makes them even more useful.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Edit&lt;/span&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;In the network healt widget (netw_health) a javascript resource is added in the php file&lt;br /&gt;&lt;code&gt;$this-&gt;js = array('/js/netw_health');&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;This file only contains the following code:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;$(document).ready(function() {&lt;br /&gt;     var netw_health = new widget('netw_health', 'widget-content');&lt;br /&gt;});&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;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:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;the widget identifier (widget name) and&lt;br /&gt;&lt;/li&gt;&lt;li&gt;what CSS class in the widget that should be updated by the Ajax call.&lt;/li&gt;&lt;/ul&gt;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).&lt;br /&gt;&lt;br /&gt;It's just that simple. ;-)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;More features&lt;/span&gt;&lt;br /&gt;There are also other nifty features that has been added lately:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Possibility to pause page refresh.&lt;br /&gt;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.&lt;/li&gt;&lt;li&gt;Hide Page Header.&lt;br /&gt;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.&lt;/li&gt;&lt;li&gt;Paging.&lt;br /&gt;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.&lt;/li&gt;&lt;li&gt;Improved search functionality.&lt;br /&gt;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.&lt;/li&gt;&lt;li&gt;Floating table headers.&lt;br /&gt;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.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;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 &lt;a href="http://www.op5.org/"&gt;www.op5.org&lt;/a&gt; for updates!&lt;br /&gt;&lt;br /&gt;Once again, thanks to everybody for contributions, suggestions, patches etc - we need your input!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-589399016474419134?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/589399016474419134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/10/more-on-widgets.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/589399016474419134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/589399016474419134'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/10/more-on-widgets.html' title='More on Widgets'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-3649441568428282865</id><published>2009-06-10T22:57:00.000+02:00</published><updated>2009-06-10T22:58:18.744+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><category scheme='http://www.blogger.com/atom/ns#' term='NMN09'/><title type='text'>Report from Nordic Meet On Nagios 2009</title><content type='html'>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.&lt;br /&gt;&lt;br /&gt;The agenda for my presentation was:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Background &lt;/li&gt;&lt;li&gt;Dependencies&lt;/li&gt;&lt;li&gt;Short on MVC&lt;/li&gt;&lt;li&gt;The Ninja API&lt;/li&gt;&lt;li&gt;Possible modifications&lt;/li&gt;&lt;li&gt;Add-on integration&lt;/li&gt;&lt;li&gt;Differences to todays CGI's&lt;/li&gt;&lt;li&gt;Live DEMO&lt;/li&gt;&lt;li&gt;Thoughts on the future (Low Hanging Fruit and such)&lt;/li&gt;&lt;/ul&gt;The presentation lasted approximately 1 hr including questions etc and was broadcasted through Bambuser. It is still available from &lt;a href="http://nordicmeetonnagios.op5.org/"&gt;http://nordicmeetonnagios.op5.org/&lt;/a&gt; and will soon be available from youtube as well.&lt;br /&gt;&lt;br /&gt;If you don't have the time to watch the entire presentation my slides are also available as a PDF: &lt;a href="http://nordicmeetonnagios.op5.org/op5media/nmn2009/presentations/Per%20Asberg%20-%20The%20Ninja%20project%20-%20an%20alternative%20open%20source%20Nagios%20GUI.pdf"&gt;The Ninja project - an alternative open source Nagios GUI goes live&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-3649441568428282865?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/3649441568428282865/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/06/report-from-nordic-meet-on-nagios-2009.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/3649441568428282865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/3649441568428282865'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/06/report-from-nordic-meet-on-nagios-2009.html' title='Report from Nordic Meet On Nagios 2009'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-5415537134702615393</id><published>2009-05-21T11:30:00.002+02:00</published><updated>2009-06-10T23:00:11.194+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><title type='text'>Screenshots and progress update</title><content type='html'>Thought I'd just share a few words on how things a moving forward with the Ninja project.&lt;br /&gt;&lt;br /&gt;The plan is to release an alpha during the &lt;a href="http://nordicmeetonnagios.op5.org/"&gt;Nordic Meet On Nagios 2009&lt;/a&gt; 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.&lt;br /&gt;&lt;br /&gt;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 &lt;a href="http://www.op5.org/community/projects/ninja"&gt;http://www.op5.org/community/projects/ninja&lt;/a&gt; where we keep some screenshots of our prototypes. &lt;br /&gt;&lt;br /&gt;As always, we would greatly appreciate all comments and feedback.&lt;br /&gt;&lt;br /&gt;What would You like to see in the Ninja GUI? &lt;br /&gt;Give me a hint - or &lt;a href="http://git.op5.org/git/?p=nagios/ninja.git;a=summary"&gt;download the code&lt;/a&gt; and do it yourself :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-5415537134702615393?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/5415537134702615393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/05/screenshots-and-progress-update.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/5415537134702615393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/5415537134702615393'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/05/screenshots-and-progress-update.html' title='Screenshots and progress update'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-2655825827998522825</id><published>2009-04-20T14:30:00.001+02:00</published><updated>2009-04-20T16:42:40.698+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><category scheme='http://www.blogger.com/atom/ns#' term='authentication'/><title type='text'>Authentication</title><content type='html'>As default, the Nagios CGI's relies on &lt;a href="http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html" target="_blank"&gt;basic authentication&lt;/a&gt;. 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 &lt;a href="http://en.wikipedia.org/wiki/POSH" target="_blank"&gt;posh&lt;/a&gt; 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.&lt;br /&gt;&lt;br /&gt;Currently we use the &lt;a href="http://docs.kohanaphp.com/addons/auth" target="_blank"&gt;Kohana Auth Module&lt;/a&gt; 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 ;-)&lt;br /&gt;&lt;br /&gt;The auth Module has support for authorization (roles) but since Nagios has it's &lt;a href="http://nagios.sourceforge.net/docs/3_0/cgiauth.html" target="_blank"&gt;own way&lt;/a&gt; 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.&lt;br /&gt;&lt;br /&gt;The current authentication implementation is possibe to configure in the &lt;code&gt;config/auth.php&lt;/code&gt; 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 :)&lt;br /&gt;&lt;br /&gt;As mentioned before, this is work in progress and any input is highly appreciated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-2655825827998522825?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/2655825827998522825/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/authentication.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/2655825827998522825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/2655825827998522825'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/authentication.html' title='Authentication'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-497061875133126514</id><published>2009-04-14T11:35:00.000+02:00</published><updated>2009-04-14T11:39:43.136+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><category scheme='http://www.blogger.com/atom/ns#' term='widget'/><title type='text'>Widgets</title><content type='html'>As stated in previous posts it is possible to extend the default Ninja functionality by creating widgets. In fact, we have included some widgets as default. They are primarily used in the Tactical Overview but the plan is to make it possible to add widgets to almost any page. By using a functionality similar to &lt;a href="http://www.google.com/ig" target="_blank"&gt;iGoogle&lt;/a&gt; it will be possible to move the widgets around, edit settings etc. All this is currently pretty much at design stage but it looks really promising. Today we are using the widgets as hard-coded, self-contained components on a page but this should change in a not so far future.&lt;br /&gt;&lt;br /&gt;So how do you build a widget?&lt;br /&gt;First of all - consider this a draft. We are still finding our way and input is always appreciated.&lt;br /&gt;&lt;br /&gt;A widget is instantiated using the widget helper:&lt;br /&gt;&lt;code&gt;&lt;br /&gt;widget::add('netw_health', array('index', $this-&gt;model), $this);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;The helper takes care of a lot of the backend stuff like handling paths and assigning master controller variables. More on this later.&lt;br /&gt;&lt;br /&gt;Why do we use a helper and not a controller?&lt;br /&gt;Since kohana fires off some system events (like system.post_controller) every time a controller is finished, we didn't want this overhead. Also, we didn't want the widget output to be returned to browser immediately but wanted the master (calling) template to decide where to render the output. Our solution was instead to use a helper class and buffer the output using &lt;code&gt;ob_start()&lt;/code&gt; and &lt;code&gt;ob_get_contents()&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;The widgets has to follow &lt;span style="font-weight:bold;"&gt;some simple rules&lt;/span&gt; to work:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_cu2YE9iTvlY/SdXYz1RJOhI/AAAAAAAABPY/1QzGao9TkSs/s1600-h/widget.png"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 154px; height: 125px;" src="http://4.bp.blogspot.com/_cu2YE9iTvlY/SdXYz1RJOhI/AAAAAAAABPY/1QzGao9TkSs/s320/widget.png" alt="" id="BLOGGER_PHOTO_ID_5320396919792024082" border="0" /&gt;&lt;/a&gt;It has to be placed in a folder with the exact name as the widget.&lt;br /&gt;The folder should be in &lt;code&gt;widgets&lt;/code&gt; or - if you are developing your own - in &lt;code&gt;custom_widgets&lt;/code&gt;&lt;br /&gt;The widget class should be named like the widget name + _Widget and should extend widget_Core. If we look at the netw_health widget as an example:&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;class Netw_health_Widget extends widget_Core&lt;br /&gt;{&lt;br /&gt;    //&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;Everything is case sensitive here.&lt;br /&gt;&lt;br /&gt;Our widget also needs a &lt;span style="font-weight:bold;"&gt;constructor&lt;/span&gt;:&lt;br /&gt;&lt;pre name="code" class="php"&gt;public function __construct()&lt;br /&gt;{&lt;br /&gt;    parent::__construct();&lt;br /&gt;&lt;br /&gt;    # needed to figure out path to widget&lt;br /&gt;    $this-&gt;set_widget_name(__CLASS__, basename(__FILE__));&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The constructor sets the name and path needed for the master controller to be able to render the widget correctly.&lt;br /&gt;&lt;br /&gt;To look at our example again:&lt;br /&gt;&lt;code&gt;widget::add('netw_health', array('index', $this-&gt;model), $this);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The second argument to widget::add() is an array and the first element should always be the method to call. Some widgets will need access to some data to be useful and in this case we are passing a reference to the model used in the master controller.&lt;br /&gt;The last argument here is the reference to the master controller so that we are able to pass the generated widget content. The master controller takes care of putting these at the appropriate place in the rendered HTML head.&lt;br /&gt;&lt;br /&gt;Our &lt;span style="font-weight:bold;"&gt;index method&lt;/span&gt;:&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;public function index($arguments=false, $master=false)&lt;br /&gt;{&lt;br /&gt;    $this-&gt;master_obj = $master;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;This first assignment is important since it is how we refer back to the master controller - without it, the widget won't be visible anywhere.&lt;br /&gt;&lt;br /&gt;The widgets view file could be called anything (as long as it has a php extension) and to use it you call &lt;code&gt;$view_path = $this-&gt;view_path('view');&lt;/code&gt; with the name of the view template as an argument.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;The view&lt;/span&gt; (template) file:&lt;br /&gt;The entire widget output should be contained in a div&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;&amp;lt;div class="widget movable collapsable removable closeconfirm" id="widget-network_health"&amp;gt;&lt;br /&gt;  // widget content goes here&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/pre&gt;You should give the div an ID following the format: 'widget_'&amp;lt;widget_name&amp;gt; to make it possible to access it in a generic way using JavaScript.&lt;br /&gt;&lt;br /&gt;To add extra css resources you assign &lt;code&gt;$this-&gt;css&lt;/code&gt; with an array like this:&lt;br /&gt;&lt;code&gt;$this-&gt;css = array('/css/netw_health');&lt;/code&gt;. The same thing is done with needed JavaScript files using &lt;code&gt;$this-&gt;js&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;After writing the code that actually does something (left out here as I feel that it is somewhat out of scope for this post) there is only 2 more things to do:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;require_once($view_path);&lt;/code&gt;&lt;br /&gt;OK, so I stated &lt;a href="http://ninja4nagios.blogspot.com/2009/04/ninja-system-description.html"&gt;earlier&lt;/a&gt; that you didn't have to write requires. Well even though I feel that it could be optimized, I don't feel that it's such a big deal. We could probably let the widget helper class do this but hey, we aren't finished with Ninja yet ;-)&lt;br /&gt;&lt;br /&gt;Last thing needed is &lt;code&gt;return $this-&gt;fetch();&lt;/code&gt; which will do the &lt;code&gt;ob_get_contents()&lt;/code&gt; thing and pass everything back to the calling controller.&lt;br /&gt;&lt;br /&gt;The actual location of the widget on the rendered page, is then all up to the master controller and template - the widget should only return a view.&lt;br /&gt;&lt;br /&gt;The netw_health &lt;a href="http://ninja.pastebin.com/ff311cf1" target="_blank"&gt;widget code&lt;/a&gt;.&lt;br /&gt;The &lt;a href="http://ninja.pastebin.com/f45487111" target="_blank"&gt;view (template) code&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Pretty awesome, huh? :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-497061875133126514?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/497061875133126514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/widgets.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/497061875133126514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/497061875133126514'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/widgets.html' title='Widgets'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_cu2YE9iTvlY/SdXYz1RJOhI/AAAAAAAABPY/1QzGao9TkSs/s72-c/widget.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-1309994171035037201</id><published>2009-04-03T13:43:00.023+02:00</published><updated>2009-04-04T11:41:17.937+02:00</updated><title type='text'>Ninja Application structure, part 2</title><content type='html'>To give a somewhat better understanding on how the classes (controllers and models respectively) are related to each other I will here show some (really simple) architecture sketches.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Controllers&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_cu2YE9iTvlY/SdYA4MVywjI/AAAAAAAABPo/BkuFyrbLrj4/s1600-h/mvc_controller.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 292px;" src="http://3.bp.blogspot.com/_cu2YE9iTvlY/SdYA4MVywjI/AAAAAAAABPo/BkuFyrbLrj4/s400/mvc_controller.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5320440975170126386" /&gt;&lt;/a&gt;This shows how the base controllers are connected: Our Ninja controller extends the kohana base controller and is in charge of creating translation (gettext) object instances, database connection, session etc. Extending this we have default which doesn't require any login or anything - a typical start page and login controller.&lt;br /&gt;&lt;br /&gt;As you might have guessed, the Authenticated_Controller takes care of authenticating users (more on this in some later post). All controllers that should require an authenticated user, should extend this class as does the tac controller in the sketch above.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Models&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_cu2YE9iTvlY/SdYBedLAr0I/AAAAAAAABPw/88kqgdiOb98/s1600-h/mvc_model.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 305px; height: 231px;" src="http://2.bp.blogspot.com/_cu2YE9iTvlY/SdYBedLAr0I/AAAAAAAABPw/88kqgdiOb98/s400/mvc_model.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5320441632523333442" /&gt;&lt;/a&gt;Here we also have a base Ninja class - the Ninja Model which also makes sure that application specific variables and objects are present.&lt;br /&gt;All Ninja models should consequently extend this model.&lt;br /&gt;&lt;br /&gt;This is brief overview of how the Ninja classes should be extended in order to save us from writing things several times and to be sure that we preserve the basic functionality. Hopefully it has given anyone interested a slightly better understanding.&lt;br /&gt;&lt;br /&gt;Once again - this is to be considered a draft and is subject to change.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-1309994171035037201?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/1309994171035037201/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/ninja-application-structure-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/1309994171035037201'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/1309994171035037201'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/ninja-application-structure-part-2.html' title='Ninja Application structure, part 2'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_cu2YE9iTvlY/SdYA4MVywjI/AAAAAAAABPo/BkuFyrbLrj4/s72-c/mvc_controller.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-5409545720208832265</id><published>2009-04-03T09:10:00.014+02:00</published><updated>2009-04-04T11:24:31.544+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><title type='text'>Ninja Application structure</title><content type='html'>This time I intend to clarify the Ninja directory structure. It is pretty simple but nevertheless it is important to place files at the correct location. For more info, please visit &lt;a href="http://kohanaphp.com/" target="_blank"&gt;kohana's excellent website&lt;/a&gt;.&lt;br /&gt;The files in the &lt;a href="http://git.op5.org/git/" target="_blank"&gt;git&lt;/a&gt; repository consists of the following 3 folders:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;application&lt;/span&gt;&lt;br /&gt;This is where all the Ninja files will go&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;modules&lt;/span&gt;&lt;br /&gt;ex: authentication, unit_test&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;system&lt;/span&gt;&lt;br /&gt;Kohana system files that should be updated when the kohana project is updated&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;So, the directory where we keep our Ninja files is in application.&lt;br /&gt;To get a better understanding of the different parts and how everything is connected we will have a look at this folders subdirectories.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/libraries/cache" target="_blank"&gt;&lt;span style="font-weight: bold;"&gt;cache&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;We currently don't use this but Kohana lets you cache any data in order to achieve maximum performance&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/general/configuration" target="_blank"&gt;&lt;span style="font-weight: bold;"&gt;config&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Configuration files for the application, routes, database, authentication, session. widget etc&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/general/controllers" target="_blank"&gt;&lt;span style="font-weight: bold;"&gt;controllers&lt;/span&gt;&lt;/a&gt;&lt;a style="font-weight: bold;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_cu2YE9iTvlY/SdXEtJJwFlI/AAAAAAAABPQ/-LMIPzw74s4/s1600-h/ninja_app.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 140px; height: 313px;" src="http://4.bp.blogspot.com/_cu2YE9iTvlY/SdXEtJJwFlI/AAAAAAAABPQ/-LMIPzw74s4/s320/ninja_app.png" alt="" id="BLOGGER_PHOTO_ID_5320374814638085714" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;consist of the equivalent to todays cgi's, i.e tac, extinfo, status, cmd, etc&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;custom_widgets&lt;/span&gt;&lt;br /&gt;Widgets created by users and possibly uploaded. Will not be overwritten on update.&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/general/helpers" target="_blank"&gt;&lt;span style="font-weight: bold;"&gt;helpers&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;nifty classes that extends the functionality and makes our life easier&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/general/hooks" target="_blank"&gt;&lt;span style="font-weight: bold;"&gt;hooks&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;We don't use any hooks yet but it is yet another way of tweaking the kohana functionality&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;languages&lt;/span&gt;&lt;br /&gt;Translation files in mo/po (&lt;a href="http://www.gnu.org/software/gettext/" target="_blank"&gt;gettext&lt;/a&gt;) format&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/general/libraries"&gt;&lt;span style="font-weight: bold;"&gt;libraries&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Another way of adding functionality to kohana/ninja. We added unit_test&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/general/logging" target="_blank"&gt;&lt;span style="font-weight: bold;"&gt;logs&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;If you enable logging (in config/config.php) this is where the logs end up&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;media&lt;/span&gt;&lt;br /&gt;media resources (images, css, js etc) that should be globally accessible (not depending on the current theme)&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/general/models" target="_blank"&gt;&lt;span style="font-weight: bold;"&gt;models&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;The data part of the application. Even if this is not entirely true since it may also contain some business logic etc, it is easiest to look at models this way.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;vendor&lt;/span&gt;&lt;br /&gt;This is where we keep Zend components like &lt;a href="http://framework.zend.com/manual/en/zend.translate.html" target="_blank"&gt;Zend_Translate&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;widgets&lt;/span&gt;&lt;br /&gt;Default Ninja components that could be updated on upgrade&lt;/li&gt;&lt;li&gt;&lt;a href="http://docs.kohanaphp.com/general/views" target="_blank"&gt;&lt;span style="font-weight: bold;"&gt;views&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;Contains the presentation templates. Will contain the different themes (skins) available&lt;/li&gt;&lt;/ul&gt;As mentioned in &lt;a href="http://ninja4nagios.blogspot.com/2009/04/ninja-system-description.html"&gt;previous post&lt;/a&gt;, it is essential to place the files in the correct folder and also to name the files and classes accordingly. This way you will hardly ever need to write any require_once or anything.&lt;br /&gt;&lt;br /&gt;To be continued...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-5409545720208832265?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/5409545720208832265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/application-structure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/5409545720208832265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/5409545720208832265'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/application-structure.html' title='Ninja Application structure'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_cu2YE9iTvlY/SdXEtJJwFlI/AAAAAAAABPQ/-LMIPzw74s4/s72-c/ninja_app.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-5568274533961093489</id><published>2009-04-02T13:39:00.030+02:00</published><updated>2009-04-06T13:59:42.526+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><title type='text'>Ninja system description</title><content type='html'>To better understand the Ninja GUI, we should first try to lay the foundation - how things are connected and how it's supposed to work.&lt;br /&gt;&lt;br /&gt;When we first started our research on how to create a new GUI, we had to figure out a way to keep the status data in a database. Our first choice was - of course - NDOutils. &lt;br /&gt;Unfortunately, we soon found out that it didn't seem to scale very well and decided to go with our own NEB module (Merlin), which basically is a modification of the module we use for &lt;a href="http://git.op5.org/git/" target="_blank"&gt;our reports&lt;/a&gt;. Take a look at the blog of &lt;a href="http://blogs.op5.org/blog4.php/2009/03/20/making-nagios-even-more-awesome" target="_blank"&gt;Andreas Ericsson&lt;/a&gt; for further details on this subject.&lt;br /&gt;&lt;br /&gt;So, data is being shuffled from Nagios to the database using the Merlin module. To build the GUI we are using &lt;a href="http://kohanaphp.com/"&gt;Kohana&lt;/a&gt;, an excellent &lt;a href="http://www.phpmvc.net/" target="_blank"&gt;PHP MVC Framework&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Building on an MVC framework means that you keep everything separated by using models, views and controllers (doh). A "page", as we are used to think about it, is merely a method in our controller, It uses the model(s) to fetch data and a view (template) to display the result.&lt;br /&gt;&lt;br /&gt;If we take tac (tactical overview) as an example, I created a tac controller (class), named it tac.php and placed it in the controllers directory in the application folder. By naming the class Tac_Controller (case sensitive), the system is able to find it without the need to write any include or requires. File name and location is the key. We have also created some base classes that all controllers should extend. All controllers (or pages) that should require authentication, should extend the Authenticated_Controller (authentication will be covered in separate posts). That way we can always be sure that users are authenticated before they get to see anything. Other pages (like the login and start page) will extend the Default controller.&lt;br /&gt;&lt;br /&gt;Let's return to the tac example. To create the index "page" we add a method called...index(). No surprises here.&lt;br /&gt;&lt;pre name="code" class="php"&gt;&lt;br /&gt;class Tac_Controller extends Authenticated_Controller&lt;br /&gt;{&lt;br /&gt; public $model = false;&lt;br /&gt;&lt;br /&gt; public function index()&lt;br /&gt; {&lt;br /&gt;  // Add the template (view)&lt;br /&gt;  $this-&gt;template-&gt;content = $this-&gt;add_view('tac/index');&lt;br /&gt;  // the add_view() method makes the location of the current&lt;br /&gt;  // theme transparent and makes it possible to globally switch theme&lt;br /&gt;&lt;br /&gt;  // create an instance of our current status model&lt;br /&gt;  // could also be done by creating a constructor if we always use it&lt;br /&gt;  $this-&gt;model = new Current_status_Model();&lt;br /&gt;&lt;br /&gt;  // fetch current status&lt;br /&gt;  $this-&gt;model-&gt;analyze_status_data();&lt;br /&gt;  // do something with the data and assign to template variables&lt;br /&gt;&lt;br /&gt;  $this-&gt;template-&gt;title = $this-&gt;translate-&gt;_('TAC::index');&lt;br /&gt;  // we use ZEND::gettext to enable multi language support&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;That is basically how to create the basis for the tactical overview.&lt;br /&gt;Our version of tac uses widgets for displaying Network health, Outages summary, Host and service summary and Monitoring Features. Pretty much everything actually :)&lt;br /&gt;&lt;br /&gt;How to create these widgets will be covered in a later post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-5568274533961093489?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/5568274533961093489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/ninja-system-description.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/5568274533961093489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/5568274533961093489'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/ninja-system-description.html' title='Ninja system description'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9144504490896973295.post-1448855738674161088</id><published>2009-04-02T12:06:00.011+02:00</published><updated>2009-04-22T08:41:32.361+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ninja'/><category scheme='http://www.blogger.com/atom/ns#' term='Nagios'/><title type='text'>Developing an alternative Nagios GUI</title><content type='html'>This is the first post in what is supposed to be a series of postings of how the work is progressing when developing the new alternative GUI for &lt;a href="http://www.nagios.org" target="_blank"&gt;Nagios&lt;/a&gt;, "&lt;span style="font-style:italic;"&gt;The Leader and Industry Standard in Enterprise System, Network, and Application Monitoring&lt;/span&gt;", developed by Ethan Galstad.&lt;br /&gt;&lt;br /&gt;We call it Ninja - Nagios Is Now Just Awesome. The "we" primarily stands for &lt;a href="http://op5.com/" target="_blank"&gt;op5&lt;/a&gt; but as we release it under GPL from start, it will hopefully be brought forward by others as well.&lt;br /&gt;&lt;br /&gt;The project homepage is found at &lt;a href="http://www.op5.org/community/projects/ninja" target="_blank"&gt;http://www.op5.org/community/projects/ninja&lt;/a&gt; where you may download the code from our public &lt;a href="http://git-scm.com/"&gt;git&lt;/a&gt; repo.&lt;br /&gt;&lt;br /&gt;It will be based upon the fantastic &lt;a href="http://kohanaphp.com/"&gt;Kohana&lt;/a&gt; PHP MVC framework and will include &lt;a href="http://en.wikipedia.org/wiki/Web_widget" target="_blank"&gt;widget&lt;/a&gt; functionality much like what you find at &lt;a href="http://www.google.com/ig" target="_blank"&gt;iGoogle&lt;/a&gt; as well as an API for writing custom widgets.&lt;br /&gt;&lt;br /&gt;There are of course lots of things to figure out and even more code to write but the work has begun - stay tuned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9144504490896973295-1448855738674161088?l=ninja4nagios.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ninja4nagios.blogspot.com/feeds/1448855738674161088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/developing-new-alternative-nagios-gui.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/1448855738674161088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9144504490896973295/posts/default/1448855738674161088'/><link rel='alternate' type='text/html' href='http://ninja4nagios.blogspot.com/2009/04/developing-new-alternative-nagios-gui.html' title='Developing an alternative Nagios GUI'/><author><name>Per Åsberg</name><uri>http://www.blogger.com/profile/01595397025830055612</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
