校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > 自動殺掉占用較多CPU資源的Shell腳本

自動殺掉占用較多CPU資源的Shell腳本

熱門標簽:打電話機器人接我是他的秘書 如果做線上地圖標注 華鋒e路航港口地圖標注 地圖標注員都是年輕人 客服外呼系統怎么樣 江蘇云電銷機器人公司 河南信譽好的不封卡電話外呼系統 揭陽智能電話機器人推薦 百度地圖標注錯了有責任嗎

復制代碼 代碼如下:

#!/bin/bash

# March-13-2006
# CPUuse trigger script by Noel
#
# bash code to watch a running program's CPU usage.
# if it's above a set value, it will auto send an email.
# You will need to set a Cron job to run this script every xx minutes
#
# Set some needed things:
#
processToWatch="convert" # in my case I need to watch convert
emailAddress="root@host" # this is my main emailaddress
triggerValue=90 # if the CPU use is above 90% send an email. DO NOT USE a DOT or COMMA!
tempFileName=tmp-cpu # some name of the temp file for the ps, grep data

ps auxww | grep "$processToWatch" | grep -v grep > /tmp/$tempFileName
export LINE
(
read LINE
while [ -n "$LINE" ]
do
set $LINE
read LINE
if [ $(echo "$3" | sed -e 's/\.[0-9]*//g') -gt $triggerValue ]; then
mail -s "CPU message alert for: $processToWatch" $emailAddress -END
This is to inform you that the following process: $processToWatch with PID (Process ID) $2 is now using more than your preset $triggerValue value.

Process: $processToWatch is using: $3 of CPU power!
The command used is: $11
END
fi
done
) /tmp/$tempFileName

您可能感興趣的文章:
  • 一個用了統計CPU 內存 硬盤 使用率的shell腳本
  • 統計 cpu 內存 使用率的shell腳本代碼
  • 消耗CPU資源的shell腳本
  • 使用shell腳本采集系統cpu、內存、磁盤、網絡等信息
  • Linux中使用Shell腳本查看Java線程的CPU使用情況
  • Shell腳本實現把進程負載均衡到多核CPU中
  • shell腳本監控系統負載、CPU和內存使用情況
  • Linux shell腳本實現CPU預警

標簽:淘寶邀評 許昌 赤峰 邵陽 婁底 馬鞍山 巴彥淖爾 金昌

巨人網絡通訊聲明:本文標題《自動殺掉占用較多CPU資源的Shell腳本》,本文關鍵詞  自動,殺掉,占用,較多,CPU,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《自動殺掉占用較多CPU資源的Shell腳本》相關的同類信息!
  • 本頁收集關于自動殺掉占用較多CPU資源的Shell腳本的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 临城县| 太康县| 伊通| 扎鲁特旗| 莆田市| 吴忠市| 沙雅县| 津市市| 中山市| 新蔡县| 镇平县| 中超| 平度市| 南乐县| 稷山县| 新民市| 龙胜| 柳林县| 沙洋县| 介休市| 贵阳市| 隆德县| 靖边县| 新昌县| 龙口市| 常德市| 怀化市| 平湖市| 建始县| 南雄市| 清远市| 巴林左旗| 浦东新区| 丹棱县| 婺源县| 桓仁| 洪洞县| 揭东县| 内乡县| 宝丰县| 凤凰县|