Sha256: a8db6308d3d19026e4b0dccf3c343118e0bc2609aeec2ac6ce23e648fc61af22

Contents?: true

Size: 520 Bytes

Versions: 8

Compression:

Stored size: 520 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

8 entries across 8 versions & 1 rubygems

Version Path
eye-0.9.2.nosigar examples/custom_check.eye
eye-0.9.2 examples/custom_check.eye
eye-0.9.1 examples/custom_check.eye
eye-0.9.pre examples/custom_check.eye
eye-0.8.1 examples/custom_check.eye
eye-0.8.celluloid15 examples/custom_check.eye
eye-0.8 examples/custom_check.eye
eye-0.8.rc examples/custom_check.eye