nagios_check

Dsl to create nagios checks, inside application.

NagiosCheck

Dsl to create nagios checks, inside application.

Installation

Add this to your application's shard.yml:

dependencies:
  nagios_check:
    github: kostya/nagios_check

Usage

require "nagios_check"

class Nagios::Blah < Nagios::Check
  def execute
    x = SomeClass.some_method
    if x < 10
      crit "some_method < 10"
    elsif x < 20
      warn "some_method < 20"
    else
      ok "ok"
    end
  end
end

status, message = Nagios::Check.run("blah")

FastCheck

class Nagios::Blah < Nagios::Check
  def some_measure(arg)
    rand + arg
  end

  def execute
    # method check(name, value, limits)
    check "some_measure(0)", some_measure(0), ok: {0, 0.5}, warn: {0.5, 0.7}, crit: {0.7, 1.0}

    # macro chk(expression, limits)
    chk some_measure(1), ok: {0, 0.5}, warn: {0.5, 0.7}, crit: {0.7, 1.0}
  end
end
Repository

nagios_check

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 0
  • about 3 years ago
  • November 2, 2015
License

MIT License

Links
Synced at

Fri, 03 May 2024 13:45:47 GMT

Languages