Sha256: 8dfcee69212c3e8ae17cd8ec5eab9826d11e036a0b7389b5970715224ff2d3eb
Contents?: true
Size: 796 Bytes
Versions: 13
Compression:
Stored size: 796 Bytes
Contents
module BigBrother class Nagios module Code Ok = 0 Warning = 1 Critical = 2 Unknown = 3 end def initialize(executor = ShellExecutor.new) @executor = executor end def send_critical(host, check, message, server) _send_passive(host, check, Code::Critical, "CRITICAL #{message}", server) end def send_ok(host, check, message, server) _send_passive(host, check, Code::Ok, "OK #{message}", server) end def send_warning(host, check, message, server) _send_passive(host, check, Code::Warning, "WARNING #{message}", server) end def _send_passive(host, check, code, message, server) @executor.invoke("echo '#{host},#{check},#{code},#{message}' | send_nsca -H #{server} -d ,") end end end
Version data entries
13 entries across 13 versions & 1 rubygems