RubyGems Navigation menu

nagios_analyzer 0.0.1

h1. nagios_analyzer h2. Description nagios_analyzer gem allows you to parse a status.dat file produced by nagios or shinken. It's similar to nagios_parser in some way, but has different goals: * the parser doesn't rely on 3rd party library nor standard parser like 'racc', I want to keep the code very simple to read and maintain ; * the parser supports defining scopes, which are processed on the raw file for performance concern, ruby objects being instanciated lately when necessary : on my conf (85hosts/700services), spawning a ruby object for each section makes the script at least 10 times slower (0.25s => >3s). Most of the time, you'll only want to access a subset of your services or hosts, so it's ok. Since nagios_parser looks very cool too, you should try both and keep the best one for you. h2. Installation <pre>gem install nagios_analyzer</pre> h2. Usage <pre>require 'nagios_analyzer' require 'pp' status = NagiosAnalyzer::Status.new("/path/to/status.dat") # get services items pp status.service_items # get host items pp status.host_items # all items ? pp status.items # in fact, each items is a hash pp status.items.first # get all sections, even those where status is OK status = NagiosAnalyzer::Status.new("/path/to/status.dat", :include_ok => true) # define a personal scope (applied to section string, so look at your status.dat!) not_acknowleged = lambda{|section| section.include?("problem_has_been_acknowledged=0") } status = NagiosAnalyzer::Status.new("/path/to/status.dat", :scope => not_acknowledged) # add more scopes status.scopes << lambda{|s| s.include?("notifications_enabled=1") } #no notifications status.scopes << lambda{|s| s.start_with?("hoststatus") } #only host statuses # reset cached results (if you changed scopes!) status.reset_cache! </pre>

Gemfile:
= Copy to clipboard Copied!

instalar:
=

Versões:

  1. 0.0.5 - July 14, 2013 (11 KB)
  2. 0.0.4 - July 14, 2013 (10,5 KB)
  3. 0.0.3 - February 22, 2012 (9 KB)
  4. 0.0.2 - May 07, 2011 (8,5 KB)
  5. 0.0.1 - January 28, 2011 (9 KB)

Development Dependencies (1):

rspec >= 0

Donos:

Autores:

  • Jean-Baptiste Barth

SHA 256 checksum:

4d83b2476944f22ce21ec9ddffc55cae633cbcde6a5a773e5f8aa7a8036a6993

Total de downloads 19.827

Desta versão 3.458

Licenças:

N/A

Versão Requerida do Ruby: Nenhum

Links: