Sha256: b84ed91e069392ee9282f0a61a49085b41453776dbb22a52c29255e7a29ca8fe
Contents?: true
Size: 761 Bytes
Versions: 14
Compression:
Stored size: 761 Bytes
Contents
always_start true interval 60 default[:file] = '/etc/nginx/sites-enabled/status' default[:url] = 'http://127.0.0.1:11311/status' default[:nginx_status_1] = %W(accepts handled requests) default[:nginx_status_2] = %W(reading writing waiting) run_if do File.exists? plugin.file end collect :os => "linux" do lines = http_get(plugin.url).split("\n") lines[2].scan(/\d+/).each_with_index do |value, index| event(:service => "nginx #{plugin.nginx_status_1[index]}", :metric => value.to_f/interval, :diff => true) end event(:service => 'nginx active', :metric => lines[0].split(':')[1].strip.to_i) lines[3].scan(/\d+/).each_with_index do |value, index| event(:service => "nginx #{plugin.nginx_status_2[index]}", :metric => value.to_i) end end
Version data entries
14 entries across 14 versions & 1 rubygems