Sha256: ad02826e78670eb29f865bafd06d99e0c2405b9b3ac01d0163136d447e93b8fe

Contents?: true

Size: 517 Bytes

Versions: 6

Compression:

Stored size: 517 Bytes

Contents

# This example shows how to write custom checks:
#   We check process procline every 1.second, and if it matches `haha`
#   send TERM signal

class MyCheck < Eye::Checker::Custom

  def get_value
    Eye::SystemResources.args(@pid)
  end

  def good?(value)
    value !~ /haha/
  end

end

Eye.app :bla do
  process :a do
    start_command "ruby -e 'sleep 10; $0 = %{HAHA}.downcase; sleep'"
    daemonize true
    pid_file '/tmp/1.pid'
    check :my_check, every: 1.second, fires: -> { send_signal(:TERM) }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
eye-0.10.0 examples/custom_check.eye
eye-0.10.0.alpha2 examples/custom_check.eye
eye-0.10.0.alpha examples/custom_check.eye
eye-0.9.4.nosigar examples/custom_check.eye
eye-0.9.4 examples/custom_check.eye
eye-0.9.3 examples/custom_check.eye