Sha256: 83b641bdb432d2aa77b2312d72cd50891212e7094dbe159a926c25401f894b6b
Contents?: true
Size: 699 Bytes
Versions: 36
Compression:
Stored size: 699 Bytes
Contents
module Perus::Pinger class Running < Command description 'Reports "yes" if "process_path" is running, "no" otherwise. Valid values for "process_path" are contained in the pinger config file.' option :process_path, restricted: true metric! def run begin ps_result = shell("ps aux | grep -v grep | grep #{options.process_path}") rescue ShellCommandError ps_result = '' end metric_name = "#{File.basename(options.process_path)}_running" {metric_name => ps_result.empty? ? 'no' : 'yes'} end end end
Version data entries
36 entries across 36 versions & 1 rubygems