Sha256: 5cf7355a80deb23decf3ad3a6f020e0f708e146a6cff0dbeb71572eefab1b600
Contents?: true
Size: 734 Bytes
Versions: 7
Compression:
Stored size: 734 Bytes
Contents
class ZabbixRubyClient module Plugins module Apt extend self def collect(*args) host = args[0] aptcheck = `/usr/lib/update-notifier/apt-check 2>&1` if $?.to_i == 0 security, pending = aptcheck.split(/;/).map(&:to_i) else logger.warn "Are you running on ubuntu ?" return [] end time = Time.now.to_i back = [] back << "#{host} apt[security] #{time} #{security}" back << "#{host} apt[pending] #{time} #{pending}" back << "#{host} apt[status] #{time} TODO apt #{security}/#{pending}" return back end end end end ZabbixRubyClient::Plugins.register('apt', ZabbixRubyClient::Plugins::Apt)
Version data entries
7 entries across 7 versions & 1 rubygems