CPU 负荷过重时邮件报警
Posted develon
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CPU 负荷过重时邮件报警相关的知识,希望对你有一定的参考价值。
首先介绍一下 top
命令的使用方法, top 程序提供了运行系统的动态实时视图, 它可以显示系统摘要信息以及当前线程或进程的列表
$ top -h
procps-ng 3.3.12
Usage:
top -hv | -bcHioss -d secs -n max -u|U user -p pid(s) -o field -w [cols]
Global-defaults
A - Alt display Off (full-screen)
* d - Delay time 1.5 seconds
* H - Threads mode Off (summarize as tasks)
I - Irix mode On (no, `solaris' smp)
* p - PID monitoring Off (show all processes)
* s - Secure mode Off (unsecured)
B - Bold enable On (yes, bold globally)
Summary-Area-defaults
l - Load Avg/Uptime On (thus program name)
t - Task/Cpu states On (1+1 lines, see `1')
m - Mem/Swap usage On (2 lines worth)
1 - Single Cpu Off (thus multiple cpus)
Task-Area-defaults
b - Bold hilite Off (use `reverse')
* c - Command line Off (name, not cmdline)
* i - Idle tasks On (show all tasks)
J - Num align right On (not left justify)
j - Str align right Off (not right justify)
R - Reverse sort On (pids high-to-low)
* S - Cumulative time Off (no, dead children)
* u - User filter Off (show euid only)
* U - User filter Off (show any uid)
V - Forest view On (show as branches)
x - Column hilite Off (no, sort field)
y - Row hilite On (yes, running tasks)
z - color/mono On (show colors)
-hv 两者都是打印版本等帮助信息
-b 非窗口模式的输出
-c 显示进程的 command
-H 线程模式
以上是关于CPU 负荷过重时邮件报警的主要内容,如果未能解决你的问题,请参考以下文章
使用Shell写一个脚本,CPU使用率超过80%或硬盘超过85%邮件报警
老男孩教育每日一题-2017-04-17:使用Shell或Python写一个脚本,CPU使用率超过80%或硬盘超过85%邮件报警