Skip to content

Commit

Permalink
Merge pull request #1 from angelabad/master
Browse files Browse the repository at this point in the history
Check if process exists.
  • Loading branch information
poysama authored Dec 14, 2016
2 parents 074e0ef + 45179d1 commit d55e669
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions check_pm2
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class CLI < Thor
pm2_json = JSON.parse(http.body_str)
processes = pm2_json['processes'].select {|p| p['name'] == name }

if processes.nil? || processes.empty?
puts "Unknown process"
exit NAGIOS_CRITICAL
end

processes.each do |process|
case process['pm2_env']['status']
when 'online'
Expand Down

0 comments on commit d55e669

Please sign in to comment.