Fork me on GitHub

Лупайте сю скалу...

Іван Франко

 RSS | Atom

19 June 2015


Selected projects See all »

Banalize: Bash static code analyzerDBIx::Report::ExcelShell settings, AKA dotfilesNagios Monitoring for Couchbase serverNagira: RESTful API for NagiosStartpack for Github pages developmentWeb iPhoto

Travel Blog Витрішки »

Україномовний блог Витрішки - блог про все, крім роботи. Цикл статей "Літо на півночі Японії" з цього блогу тепер опублікований у Витрішках

Computer Blog All posts »

iPhoto and files permission Is MacOSX 10.9 == MacOS 9.x? Running Chef roles from Capistrano und Capiche Github & Jekyll: Speeding up Jekyll siteGithub & Jekyll: More experience with Jekyll and setup changesBuild new hosts with Capistrano and Chef Request Tracker: More about custom CSS for RT4Ruby 2 test drive Nagira v0.2.5 release It's UNIX my dear Watson

Slides See all »

Nagira @TLUG, 2012Rspec and Guard


Ярило Yarylo, Jarilo me @ github me @ CPAN Dmytro (CV)

Nagira v0.2.5 release

New release of Nagira RESTful API includes number of important features. Nagira version 0.2.5 is pretty big release, including number of significant changes.

So I decided to jump version a little from 0.2.1 to 0.2.5

And here is all the new wonderful features included in the release:

Background parser

Which speeds up all HTTP requests by parsing of the Nagios status file in separate thread.

If you have a very big Nagios environment, parsing of status.dat file can take up to few seconds. Even though Nagira had a timed-parse feature before -- Nagira kept parsed data in a cache, and was not attempting to parse status more often than once in N seconds, once in a while unlicky user would have to wait for status update for several seconds.

This is eliminated now by parser running in the background and doing its job in separate thread. Meaning that answer to all user queries are fast. This, of course, can put some extra load on the server, since it will need to do the parsing regardless of whether ther are any requests coming, so you need to tune your configuration depending on Nagios environment.

Partial ActiveSupport

Meaning that you can use Nagira now directly from Ruby on Rails application.

ActiveSupport is indeed partial, more to come. Only pluralized nouns of the resources are supported now. What that means is that you can have your model defined like the following and get all your services information by Service.all:

class Service < ActiveResource::Base = "http://localhost:4567/_status/"
  self.element_name = "service"

Only #all is supported at the moment (or #find(:all), which is the same).

Flexible configuration

More run time configuration options and environment varaibles available.

It easier now to control how Nagira is run using shell environment variables instead of going to source code. This makes it easier to use for non Ruby users, as well as simplifies some of the start-up scripts and configurations, since now they are plain files and not ERB templates as it was in the previos releases.

Additionally more configuration options are available in Nagira with thid release.

For the full description of configuration see Nagira documentation and comments in Nagira defaults file. But here's list of configuration options available: port, bind address, UNIX user to run Nagira, RVM setting, TTL for data, enable or disable background parser, log file and Nagios main configuration file locations.

Nagira is gem now

Finally the most important feature of this release is that Nagira is now a Ruby gem. It is available for the standard RubyGems location. It can be downloaded from the site or installed using standard gem way or included into Gemfile of the Ruby or Ruby on Rails project:

gem install nagira

Nagira relies on ruby-nagios library for parsing Nagios files. There was a big chunk of custom development, that I did for the ruby-nagios. Finally all custom development submitted to upstream project, merged in and I can use ruby-nagios gem instead of relying on my custom git branch. This made easier to refactor Nagira and convert it into gem.


Dmytro Kovalov (

Source code

дмитро ковальов
dmytro @ github