Sha256: 6a36712ae0f10e22518f2124985526245be30591a31833627a0449d371c3d4ea
Contents?: true
Size: 540 Bytes
Versions: 16
Compression:
Stored size: 540 Bytes
Contents
require 'json' class Riemann::Babbler::Cloudclients < Riemann::Babbler def init plugin.set_default(:service, 'cloud clients') plugin.set_default(:interval, 60) plugin.set_default(:url, 'http://localhost/client/all') end def collect clients = 0 json = JSON.parse rest_get(plugin.url) json.each { |client| clients += 1 if client[1]["state"] == "ESTABLISHED" } {:service => plugin.service + " established", :description => "online clients in #{plugin.url}", :metric => clients, :state => 'ok' } end end
Version data entries
16 entries across 16 versions & 1 rubygems