Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Nagios CPU mpstat Plugin New!
Current Version
1.0
Last Release Date
2025-05-22
Compatible With
- Nagios 3.x
- Nagios 4.x
- Nagios XI
Owner
License
GPL
Hits
82
Files:
File | Description |
---|---|
check_cpu_mpstat.sh | Main Nagios plugin script to monitor CPU usage using mpstat with configurable thresholds. |
LICENSE | GNU GPL version 3 license governing the usage, modification, and distribution of the script. |
README.txt | Brief guide for installation, usage, and dependencies of the check_cpu_mpstat.sh plugin. |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
check_cpu_mpstat.sh is a Bash plugin for Nagios, Centreon, and other compatible monitoring platforms. It checks CPU usage statistics — specifically user, system, and iowait percentages — using the mpstat command from the sysstat package, which provides improved accuracy and multi-core compatibility over older tools like iostat and vmstat.
This script is based on the original check_cpu.sh plugin by Andreas Baess, but replaces vmstat with mpstat, adds robust argument parsing, per-category thresholds, and better compatibility with modern Linux systems.
???? Features
Uses mpstat for accurate CPU sampling, supporting multi-core systems
Configurable thresholds per category: user, system, iowait
Compatible with Nagios, Centreon, and other Nagios-style monitoring systems
Outputs performance data for graphing
Customizable sampling interval and number of samples
Returns standard Nagios exit codes (OK, WARNING, CRITICAL, UNKNOWN)
???? Requirements
mpstat (usually provided by the sysstat package)
Bash (tested with GNU Bash 4+)
?? Example Usage
./check_cpu_mpstat.sh -uw 70 -uc 90 -sw 60 -sc 85 -iw 40 -ic 60 -i 1 -n 1
???? Arguments
Flag Description
-uw Warning threshold for user CPU (%)
-uc Critical threshold for user CPU (%)
-sw Warning threshold for system CPU (%)
-sc Critical threshold for system CPU (%)
-iw Warning threshold for iowait CPU (%)
-ic Critical threshold for iowait CPU (%)
-i Interval between samples (seconds)
-n Number of samples to average
-h Help output
???? Example Output
CPU OK: user=12% system=5% iowait=1% idle=82% | cpu_user=12%;70;90; cpu_sy
???? Credits
Original idea and structure by Andreas Baess
Original plugin: check_cpu.sh
This script is based on the original check_cpu.sh plugin by Andreas Baess, but replaces vmstat with mpstat, adds robust argument parsing, per-category thresholds, and better compatibility with modern Linux systems.
???? Features
Uses mpstat for accurate CPU sampling, supporting multi-core systems
Configurable thresholds per category: user, system, iowait
Compatible with Nagios, Centreon, and other Nagios-style monitoring systems
Outputs performance data for graphing
Customizable sampling interval and number of samples
Returns standard Nagios exit codes (OK, WARNING, CRITICAL, UNKNOWN)
???? Requirements
mpstat (usually provided by the sysstat package)
Bash (tested with GNU Bash 4+)
?? Example Usage
./check_cpu_mpstat.sh -uw 70 -uc 90 -sw 60 -sc 85 -iw 40 -ic 60 -i 1 -n 1
???? Arguments
Flag Description
-uw Warning threshold for user CPU (%)
-uc Critical threshold for user CPU (%)
-sw Warning threshold for system CPU (%)
-sc Critical threshold for system CPU (%)
-iw Warning threshold for iowait CPU (%)
-ic Critical threshold for iowait CPU (%)
-i Interval between samples (seconds)
-n Number of samples to average
-h Help output
???? Example Output
CPU OK: user=12% system=5% iowait=1% idle=82% | cpu_user=12%;70;90; cpu_sy
???? Credits
Original idea and structure by Andreas Baess
Original plugin: check_cpu.sh
Reviews (0)
Be the first to review this listing!