Sha256: 33d44b58266e5981e86d6ba81e4f5667d0c8fee12e7582b0adc69cea575ff03b

Contents?: true

Size: 988 Bytes

Versions: 1

Compression:

Stored size: 988 Bytes

Contents

puts Process.pid
require 'pp'

host "test-#{Socket.gethostname}"

workers 1
process_event do |event|
  printf "%-10s %-10s %-10s %-8s %-10s\n", Time.now, event[:host], event[:state], event[:service], event[:metric]
end

mysys = check(:system).new( opts: {cpu_warning: 45})
google_check = check(:http).new("http://google.com")

filename = "test_config.rb"

file_check = proc_check "test" do
  sleep 3
  metric = File.exist?(filename) ? 0 : 1
  description = metric == 0 ? "file exists" : "file doesn't exist"
  state = state(metric, warning: 1, critical: 2)
  event({
    service: name,
    description: description,
    metric: metric,
    state: state
  })
end

oom_check = check(:oom).new(log_file: "spec/test_data/messages")

every 1.seconds, offset: 0.seconds, randomize: true do
  run_check mysys
  run_check :disk
  run_check oom_check
end

every 5.seconds, offset: 2.seconds do
  run_check google_check
end

every 60.seconds do
#  run_check oom_check
#  run_check google_check
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
remon-0.1.0 test_config.rb