Sha256: 651544bd0644374bd0c09c1518b809bf22ce89e1db14942f91fdd7262a0ce27d
Contents?: true
Size: 588 Bytes
Versions: 11
Compression:
Stored size: 588 Bytes
Contents
require "zabbix-ruby-client/logger" module ZabbixRubyClient module Plugins module Who extend self def collect(*args) host = args[0] who = get_who if $?.to_i != 0 Log.warn "Are you running on ubuntu ?" return [] end time = Time.now.to_i back = [] back << "#{host} who[total] #{time} #{who}" return back end def get_who who = `who` who.each_line.count end end end end ZabbixRubyClient::Plugins.register('who', ZabbixRubyClient::Plugins::Who)
Version data entries
11 entries across 11 versions & 1 rubygems