Module: ZabbixRubyClient::Plugins::Who
Instance Method Summary
collapse
getline, getlines, httprequest, os, perform, time
Instance Method Details
#collect(*args) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/zabbix-ruby-client/plugins/who.rb', line 9
def collect(*args)
host = args[0]
who = get_who
if $?.to_i != 0
Log.warn "Are you running on ubuntu ?"
return []
end
back = []
back << "#{host} who[total] #{time} #{who}"
return back
end
|
#get_who ⇒ Object
21
22
23
24
|
# File 'lib/zabbix-ruby-client/plugins/who.rb', line 21
def get_who
who = `who`
who.each_line.count
end
|