溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

nagios——check_cpu.sh測(cè)試使用

發(fā)布時(shí)間:2020-10-06 01:34:11 來源:網(wǎng)絡(luò) 閱讀:1040 作者:151wqooo 欄目:移動(dòng)開發(fā)

 查看腳本幫助: 

  1. [root@wqk1 mnt]# ./check_cpu.sh  -h 
  2.  
  3. check_cpu.sh Revision 1.0 - CPU Utilization check script for Nagios 
  4.  
  5. Usage: check_cpu.sh [flags] 
  6.  
  7. Flags: 
  8.   -w  <number> : Global Warning level in % for user/system/io-wait cpu 
  9.   -uw <number> : Warning level in % for user cpu 
  10.   -iw <number> : Warning level in % for IO_wait cpu 
  11.   -sw <number> : Warning level in % for system cpu 
  12.   -c  <number> : Global Critical level in % for user/system/io-wait cpu 
  13.   -uc <number> : Critical level in % for user cpu 
  14.   -ic <number> : Critical level in % for IO_wait cpu 
  15.   -sc <number> : Critical level in % for system cpu 
  16.   -i  <number> : Interval in seconds for iostat (default : 1) 
  17.   -n  <number> : Number report for iostat (default : 3) 
  18.   -h  Show this page 
  19.  
  20. Usage: check_cpu.sh 
  21. Usage: check_cpu.sh --help 
  22.  
  23.  
  24. This plugin will check cpu utilization (user,system,iowait,idle in %) 

正常測(cè)試:

  1. [root@wqk1 mnt]# ./check_cpu.sh  
  2. CPU OK : user=0system=0iowait=0idle=100% | cpu_user=0%;70;90; cpu_sys=0%;70;90; cpu_iowait=0%;70;90; cpu_idle=100%; 

CPU WARNING測(cè)試:

  1. [root@wqk1 mnt]# ./check_cpu.sh  -w 0 
  2. CPU WARNING : user=0system=0iowait=0idle=100% | cpu_user=0%;0;90; cpu_sys=0%;0;90; cpu_iowait=0%;0;90; cpu_idle=100%; 
  3. [root@wqk1 mnt]# ./check_cpu.sh  -uw 0 
  4. CPU WARNING : user=0system=0iowait=0idle=100% | cpu_user=0%;0;90; cpu_sys=0%;70;90; cpu_iowait=0%;70;90; cpu_idle=100%; 
  5. [root@wqk1 mnt]# ./check_cpu.sh  -iw 0 
  6. CPU WARNING : user=0system=0iowait=0idle=100% | cpu_user=0%;70;90; cpu_sys=0%;70;90; cpu_iowait=0%;0;90; cpu_idle=100%; 
  7. [root@wqk1 mnt]# ./check_cpu.sh  -sw 0 
  8. CPU WARNING : user=0system=0iowait=0idle=100% | cpu_user=0%;70;90; cpu_sys=0%;0;90; cpu_iowait=0%;70;90; cpu_idle=100%; 

CPU CRITICAL測(cè)試: 

  1. [root@wqk1 mnt]# ./check_cpu.sh  -c 0 
  2. CPU CRITICAL : user=1system=0iowait=0idle=99% | cpu_user=1%;70;0cpu_sys=0%;70;0cpu_iowait=0%;70;0cpu_idle=99%; 
  3. [root@wqk1 mnt]# ./check_cpu.sh  -uc 0 
  4. CPU CRITICAL : user=0system=0iowait=0idle=100% | cpu_user=0%;70;0cpu_sys=0%;70;90; cpu_iowait=0%;70;90; cpu_idle=100%; 
  5. [root@wqk1 mnt]# ./check_cpu.sh  -ic 0 
  6. CPU CRITICAL : user=0system=0iowait=0idle=100% | cpu_user=0%;70;90; cpu_sys=0%;70;90; cpu_iowait=0%;70;0cpu_idle=100%; 
  7. [root@wqk1 mnt]# ./check_cpu.sh  -sc 0 
  8. CPU CRITICAL : user=0system=0iowait=0idle=100% | cpu_user=0%;70;90; cpu_sys=0%;70;0cpu_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%;

后面兩項(xiàng)為設(shè)置的WARNING和CRITICAL的閥值,第一項(xiàng)為cpu實(shí)際的使用情況。

弄清楚腳本,監(jiān)控配置就容易多了。。

附腳本:

 

附件:http://down.51cto.com/data/2362603
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI