Skip to content
Execute nagios remote plugins from ruby
Ruby
Find file
Latest commit 5331023 Nov 20, 2013 @avalanche123 Merge pull request #2 from cpuguy83/patch-1
Add option to supply custom socket
Failed to load latest commit information.
bin initial commit Feb 20, 2012
examples initial commit Feb 20, 2012
lib Add option to supply custom socket Nov 20, 2013
Gemfile initial commit Feb 20, 2012
Gemfile.lock initial commit Feb 20, 2012
LICENSE Empty LICENSE file because its required Nov 8, 2013
README.md Update README.md Nov 8, 2013
nrpe.gemspec initial commit Feb 20, 2012

README.md

NRPErb

Ruby interface to Nagios Remote Plugin Executor daemon. Let's you run remote nagios checks from ruby

Install

Either

  • clone repository
  • run bundle install
  • run bundle exec check_nrpe -h

Or

  • gem install nrperb
  • check_nrpe -h

Usage

require 'nrpe'

NRPE.session :host => '10.190.157.127', :port => 5666 do |session|
  result = session.execute('check_load')
  puts result.ok?
  puts result.warning?
  puts result.critical?
  puts result.text
end

You can pass arguments to the check, but your NRPE server must accept them

require 'nrpe'

NRPE.session :host => '10.190.157.127', :port => 5666 do |session|
  result = session.execute('check_load', 90, 95)
  puts result.ok?
  puts result.warning?
  puts result.critical?
  puts result.text
end

Options

{
  :host => nil,    # ip address or hostname of target host, required, cannot be nil
  :port => 5666,   # port, remote nagios plugin executor daemon is listening on, defaults to 5666
  :timeout => 10,  # connection attempt timeout, defaults to 10
  :use_ssl => true # wether to use secure ssl connection (nagios defaults to true) or not, defaults to true
}

Maintainer(s)

Cheers!

Something went wrong with that request. Please try again.