Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
Enhanced CPU Utilization Check using mpstat, with support for user/system/iowait thresholds. Based on the original check_cpu.sh script by Andreas Baess.
Current Version
1.0
Last Release Date
2025-05-22
Owner
Salvo
License
GPL
Compatible With
Brief guide for installation, usage, and dependencies of the check_cpu_mpstat.sh plugin.
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
You must be logged in to submit a review.
To:
From: