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