Permalink
Browse files

fix process watcher

  • Loading branch information...
1 parent a2a13f5 commit a58f769acb08fea4d9d5e2fde72e6b7e0f5daa1a @Eyjafjallajokull committed Jan 19, 2013
Showing with 4 additions and 5 deletions.
  1. +2 −2 widgets/keeper/main.js
  2. +2 −3 widgets/keeper/main.py
View
@@ -21,10 +21,10 @@
statusText = 'not running';
break;
case 1:
- statusText = 'running 1 instance';
+ statusText = 'running 1 thread';
break;
default:
- statusText = 'running '+monitor.status+' instances';
+ statusText = 'running '+monitor.status+' threads';
break;
}
statusOk = monitor.status > 0;
View
@@ -8,9 +8,8 @@ def collectData(self):
result = self.config['monitor']
for monitor in result:
if monitor['type'] == 'process':
- cmd = self.runSystemCommand('ps -A -o "cmd" | grep "%s" | wc -l'
- % monitor['value'])
- monitor['status'] = int(cmd)-2
+ cmd = self.runSystemCommand('ps -o "cmd" -C "%s" -L' % monitor['value'])
+ monitor['status'] = int(cmd)-1
if monitor['type'] == 'file':
if os.path.isfile(monitor['value']):
monitor['status'] = os.path.getsize(monitor['value'])

0 comments on commit a58f769

Please sign in to comment.