Sha256: 3e30e6e9c3c1f4ca493e7480f73283892ce27b33d7ca9a04aa482174b12a3183
Contents?: true
Size: 616 Bytes
Versions: 14
Compression:
Stored size: 616 Bytes
Contents
require 'sys/proctable' default[:pidfile] = '/var/run/service.pid' collect do @pagesize ||= shell('/usr/bin/getconf PAGESIZE').to_i master_pid = File.read(plugin.pidfile).to_i mem_total = 0 ::Sys::ProcTable.ps do |p| next unless p.pid == master_pid || p.ppid == master_pid mem_total += (p.rss * @pagesize).to_f / 1024 end event( :diff => true, :description => "RSS usage delta #{plugin.pidfile}", :metric => mem_total, :service => "procmem #{plugin.pidfile}", :warning => 30*1024, #kibibytes :critical => 90*1024 ) if File.stat(plugin.pidfile).mtime > interval end
Version data entries
14 entries across 14 versions & 1 rubygems