Sha256: a9d39a58933a0c5d1f0d76453a58c769af0896a0eae5e3959e6bc73e3ccd3008
Contents?: true
Size: 1.36 KB
Versions: 1
Compression:
Stored size: 1.36 KB
Contents
require "zabbix-ruby-client/logger" module ZabbixRubyClient module Plugins module Sysinfo extend self extend ZabbixRubyClient::PluginBase def collect(*args) host = args.delete_at(0) uname = `uname -a` case os when :linux arch, hostname, kernel, kernel_version, machine, os_debian, _, platform_debian, _, _, _, _, _, platform, os = uname.split(/\s+/) when :unix os, hostname, _, platform, kernel, machine, kernel_version, _, _, _, _, _, _, _, arch = uname.split(/\s+/) else return [] end back = [] back << "#{host} sysinfo[name] #{time} #{host}" back << "#{host} sysinfo[arch] #{time} #{arch}" back << "#{host} sysinfo[hostname] #{time} #{hostname}" back << "#{host} sysinfo[kernel] #{time} #{kernel}" back << "#{host} sysinfo[kernel_version] #{time} #{kernel_version}" back << "#{host} sysinfo[machine] #{time} #{machine}" back << "#{host} sysinfo[platform] #{time} #{platform || platform_debian}" back << "#{host} sysinfo[os] #{time} #{os || os_debian}" Hash[*args].each do |k,v| back << "#{host} sysinfo[#{k}] #{time} #{v}" end return back end end end end ZabbixRubyClient::Plugins.register('sysinfo', ZabbixRubyClient::Plugins::Sysinfo)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
zabbix-ruby-client-0.1.3 | lib/zabbix-ruby-client/plugins/sysinfo.rb |