Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Linux Process CPU Utilisation
1
2014-01-18
- Nagios 3.x
- Nagios XI
GPL
36578
A check plugin for Nagios to monitor processes and their utilization of system resources.
This plugin takes in a process name and then uses the command ps to work out how much memory and cpu all the processes of that name are taking up in percentage. It will output performance data for CPU Usage Percentage, Memory Usage Percentage, VSZ, RSS and the number of processes of that name.
Options
Only the -p option is required all other options are optional.
-p allows you to specify the name of the process you want to monitor (REQUIRED)
-w specify a warning for CPU percentage utilization
-c specify a critical for CPU percentage utilization
-m specify a warning for Memory percentage utilization
-n specify a critical fro Memory percentage utilization
Examples
To monitor the apache processes and warn when the CPU uses over 20% and critical when over 30%
./check_cpu_proc.sh -p apache -w 20 -c 30
OK /usr/sbin/apache2 CPU: 0% MEM: 1.5% over 6 processes | proc=6 mem=1.5% cpu=0% rss=42116.0KB vsz=1274760.0KB
To monitor apache processes and warn when the CPU uses over 20% and critical when over 30% . Warn when memory is over 0.2% and Critical when memory is over 0.4%
./check_cpu_proc.sh -p apache -w 20 -c 30 -m 0.2 -n 0.4
CRITICAL /usr/sbin/apache2 CPU: 0% MEM: 1.5% over 6 processes | proc=6 mem=1.5% cpu=0% rss=42116.0KB vsz=1274760.0KB
To monitor nagios processes purely for performance data. i.e. no warning or criticals
./check_cpu_proc.sh -p nagios
OK /usr/lib/nagios/plugins/check_ping CPU: 0% MEM: 0% over 1 processes | proc=1 mem=0% cpu=0% rss=864.0KB vsz=12408.0KB
NOTE: this plugin doesn’t check whether the process is running and is purely for monitoring process utilization.
This plugin takes in a process name and then uses the command ps to work out how much memory and cpu all the processes of that name are taking up in percentage. It will output performance data for CPU Usage Percentage, Memory Usage Percentage, VSZ, RSS and the number of processes of that name.
Options
Only the -p option is required all other options are optional.
-p allows you to specify the name of the process you want to monitor (REQUIRED)
-w specify a warning for CPU percentage utilization
-c specify a critical for CPU percentage utilization
-m specify a warning for Memory percentage utilization
-n specify a critical fro Memory percentage utilization
Examples
To monitor the apache processes and warn when the CPU uses over 20% and critical when over 30%
./check_cpu_proc.sh -p apache -w 20 -c 30
OK /usr/sbin/apache2 CPU: 0% MEM: 1.5% over 6 processes | proc=6 mem=1.5% cpu=0% rss=42116.0KB vsz=1274760.0KB
To monitor apache processes and warn when the CPU uses over 20% and critical when over 30% . Warn when memory is over 0.2% and Critical when memory is over 0.4%
./check_cpu_proc.sh -p apache -w 20 -c 30 -m 0.2 -n 0.4
CRITICAL /usr/sbin/apache2 CPU: 0% MEM: 1.5% over 6 processes | proc=6 mem=1.5% cpu=0% rss=42116.0KB vsz=1274760.0KB
To monitor nagios processes purely for performance data. i.e. no warning or criticals
./check_cpu_proc.sh -p nagios
OK /usr/lib/nagios/plugins/check_ping CPU: 0% MEM: 0% over 1 processes | proc=1 mem=0% cpu=0% rss=864.0KB vsz=12408.0KB
NOTE: this plugin doesn’t check whether the process is running and is purely for monitoring process utilization.