Module: Sensu::Plugin::Util::Procs

Defined in:
lib/sensu-plugin/util/procs.rb

Class Method Summary collapse

Class Method Details

.find_proc(name) ⇒ Object



13
14
15
# File 'lib/sensu-plugin/util/procs.rb', line 13

def find_proc(name)
  get_procs.split("\n").find {|ln| ln.include?(name) }
end

.find_proc_regex(pat) ⇒ Object



17
18
19
# File 'lib/sensu-plugin/util/procs.rb', line 17

def find_proc_regex(pat)
  get_procs.split("\n").find {|ln| ln =~ pat }
end

.get_procsObject



9
10
11
# File 'lib/sensu-plugin/util/procs.rb', line 9

def get_procs
  `which tasklist`; $? == 0 ? `tasklist` : `ps aux`
end