Sha256: 8e34ea88ab99bb39951c980922130289e8d5e9f746bc523ccfb23426b8c9eeec
Contents?: true
Size: 771 Bytes
Versions: 51
Compression:
Stored size: 771 Bytes
Contents
interval 60 default[:http_code] = 200 default[:http_method] = 'GET' default[:connect_timeout] = 5 default[:retry] = 0 default[:retry_delay] = 0 default[:max_time] = 10 default[:insecure] = false default[:url] = 'http://127.0.0.1:80' default[:service] = 'http check' collect do @cmd ||= begin "curl -X#{plugin.http_method} -s --connect-timeout #{plugin.connect_timeout}" + " #{'--insecure' if plugin.insecure} " + " -w '%{http_code}\\n' --retry #{plugin.retry} --retry-delay #{plugin.retry_delay}" + " --max-time #{plugin.max_time} --fail #{plugin.url} -o /dev/null" end out = shell_out(@cmd).stdout.to_i event(:service => plugin.service, :metric => out, :description => "http code: #{out}", :state => out == plugin.http_code) end
Version data entries
51 entries across 51 versions & 1 rubygems