CPU usage of a single process measured by ncpa
Posted: Wed Mar 10, 2021 8:17 am
Hi
I need to survey a single process's use of cpu, and to put up notifications for this.
Because sometimes we have a java process going wild, and using up almost all of the cpu capacity.
I am using ncpa to monitor it
This is my check command:
/usr/local/nagios/libexec/check_ncpa.py -H 10.117.55.6 -t 'DC-vest' -P 9991 -M 'processes' -q 'name=java_ase' -w 60 -c 100
OK: Process count for processes named java_ase was 1 | 'process_count'=1;60;100; 'cpu'=0.15%;;; 'memory'=12.85%;;; 'memory_vms'=5.98GB;;; 'memory_rss'=1.06GB;;;
Processes Matched
PID: Name: Username: Exe: Memory: CPU
-----------------------------------
23906: java_ase: aseuser: 12.85 % (VMS 5.98 GB, RSS 1.06 GB): 0.15 %
Total Memory: 12.85 % (VMS 5.98 GB, RSS 1.06 GB)
Total CPU: 0.15 %
I can see it should be possible to set this up because of this 'cpu'=0.15%;;;
That indicates that it should be possible to set some limits on CPU, but I can't find any documentation on how to do that?
I need to survey a single process's use of cpu, and to put up notifications for this.
Because sometimes we have a java process going wild, and using up almost all of the cpu capacity.
I am using ncpa to monitor it
This is my check command:
/usr/local/nagios/libexec/check_ncpa.py -H 10.117.55.6 -t 'DC-vest' -P 9991 -M 'processes' -q 'name=java_ase' -w 60 -c 100
OK: Process count for processes named java_ase was 1 | 'process_count'=1;60;100; 'cpu'=0.15%;;; 'memory'=12.85%;;; 'memory_vms'=5.98GB;;; 'memory_rss'=1.06GB;;;
Processes Matched
PID: Name: Username: Exe: Memory: CPU
-----------------------------------
23906: java_ase: aseuser: 12.85 % (VMS 5.98 GB, RSS 1.06 GB): 0.15 %
Total Memory: 12.85 % (VMS 5.98 GB, RSS 1.06 GB)
Total CPU: 0.15 %
I can see it should be possible to set this up because of this 'cpu'=0.15%;;;
That indicates that it should be possible to set some limits on CPU, but I can't find any documentation on how to do that?