Skip to content

Commit

Permalink
[checks.d][process] correctly handle disappearing pids
Browse files Browse the repository at this point in the history
fixes #1721
  • Loading branch information
talwai authored and Remi Hakim committed Sep 4, 2015
1 parent dc7d541 commit da75221
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions checks.d/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ def get_process_state(self, name, pids, cpu_check_interval):
# Skip processes dead in the meantime
except psutil.NoSuchProcess:
self.warning('Process %s disappeared while scanning' % pid)
# reset the PID cache now, something chaned
# reset the PID cache now, something changed
self.last_pid_cache_ts[name] = 0
continue

meminfo = self.psutil_wrapper(p, 'memory_info', ['rss', 'vms'])
st['rss'].append(meminfo.get('rss'))
Expand Down Expand Up @@ -259,10 +260,10 @@ def check(self, instance):

def _process_service_check(self, name, nb_procs, bounds):
'''
Repport a service check, for each processes in search_string.
Repport as OK if the process is in the warning thresolds
CRITICAL out of the critical thresolds
WARNING out of the warning thresolds
Report a service check, for each process in search_string.
Report as OK if the process is in the warning thresholds
CRITICAL out of the critical thresholds
WARNING out of the warning thresholds
'''
tag = ["process:%s" % name]
status = AgentCheck.OK
Expand Down

0 comments on commit da75221

Please sign in to comment.