您好,登錄后才能下訂單哦!
查看腳本幫助:
- [root@wqk1 mnt]# ./check_cpu.sh -h
- check_cpu.sh Revision 1.0 - CPU Utilization check script for Nagios
- Usage: check_cpu.sh [flags]
- Flags:
- -w <number> : Global Warning level in % for user/system/io-wait cpu
- -uw <number> : Warning level in % for user cpu
- -iw <number> : Warning level in % for IO_wait cpu
- -sw <number> : Warning level in % for system cpu
- -c <number> : Global Critical level in % for user/system/io-wait cpu
- -uc <number> : Critical level in % for user cpu
- -ic <number> : Critical level in % for IO_wait cpu
- -sc <number> : Critical level in % for system cpu
- -i <number> : Interval in seconds for iostat (default : 1)
- -n <number> : Number report for iostat (default : 3)
- -h Show this page
- Usage: check_cpu.sh
- Usage: check_cpu.sh --help
- This plugin will check cpu utilization (user,system,iowait,idle in %)
正常測試:
- [root@wqk1 mnt]# ./check_cpu.sh
- CPU OK : user=0% system=0% iowait=0% idle=100% | cpu_user=0%;70;90; cpu_sys=0%;70;90; cpu_iowait=0%;70;90; cpu_idle=100%;
CPU WARNING測試:
- [root@wqk1 mnt]# ./check_cpu.sh -w 0
- CPU WARNING : user=0% system=0% iowait=0% idle=100% | cpu_user=0%;0;90; cpu_sys=0%;0;90; cpu_iowait=0%;0;90; cpu_idle=100%;
- [root@wqk1 mnt]# ./check_cpu.sh -uw 0
- CPU WARNING : user=0% system=0% iowait=0% idle=100% | cpu_user=0%;0;90; cpu_sys=0%;70;90; cpu_iowait=0%;70;90; cpu_idle=100%;
- [root@wqk1 mnt]# ./check_cpu.sh -iw 0
- CPU WARNING : user=0% system=0% iowait=0% idle=100% | cpu_user=0%;70;90; cpu_sys=0%;70;90; cpu_iowait=0%;0;90; cpu_idle=100%;
- [root@wqk1 mnt]# ./check_cpu.sh -sw 0
- CPU WARNING : user=0% system=0% iowait=0% idle=100% | cpu_user=0%;70;90; cpu_sys=0%;0;90; cpu_iowait=0%;70;90; cpu_idle=100%;
CPU CRITICAL測試:
- [root@wqk1 mnt]# ./check_cpu.sh -c 0
- CPU CRITICAL : user=1% system=0% iowait=0% idle=99% | cpu_user=1%;70;0; cpu_sys=0%;70;0; cpu_iowait=0%;70;0; cpu_idle=99%;
- [root@wqk1 mnt]# ./check_cpu.sh -uc 0
- CPU CRITICAL : user=0% system=0% iowait=0% idle=100% | cpu_user=0%;70;0; cpu_sys=0%;70;90; cpu_iowait=0%;70;90; cpu_idle=100%;
- [root@wqk1 mnt]# ./check_cpu.sh -ic 0
- CPU CRITICAL : user=0% system=0% iowait=0% idle=100% | cpu_user=0%;70;90; cpu_sys=0%;70;90; cpu_iowait=0%;70;0; cpu_idle=100%;
- [root@wqk1 mnt]# ./check_cpu.sh -sc 0
- CPU CRITICAL : user=0% system=0% iowait=0% idle=100% | cpu_user=0%;70;90; cpu_sys=0%;70;0; cpu_iowait=0%;70;90; cpu_idle=100%;
[root@wqk1 mnt]# ./check_cpu.sh -w 0 -c 0
CPU CRITICAL : user=1% system=4% iowait=0% idle=95% | cpu_user=1%;0;0; cpu_sys=4%;0;0; cpu_iowait=0%;0;0; cpu_idle=95%;
后面兩項為設置的WARNING和CRITICAL的閥值,第一項為cpu實際的使用情況。
弄清楚腳本,監控配置就容易多了。。
附腳本:
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。