display of DataView is inaccurate.Workaround (Pending validation):1. Use the built-in Zabbix variable proc.cpu.util[2. Modify the commands in the script, using the following method instead:First, get the PID of the process name, and then combine top to run the following command:Top-b-n 1-p $pid 2>1 | Awk-v pid= $pid ' {if (= = pid) print $9} '3. Modify the commands in the script, using the following method instead:The PID of the process name is obtained first, and then the relevant data is read
| awk' {SSD = NF-4} {print $ SSD} ''// obtain the process's CPU usage.Echo "CPU:" $ CPU>/home/user/share/test/proc_memlog.txt // write the CPU usage rate to the proc_memlog.txt file.Echo $ blank>/home/user/share/test/proc_memlog.txt // write a blank row into the proc_memlog.txt FileSleep $ IntervalDone// Run the script2. Monitoring scriptRun the terminal, switch to the directory where the script is created, and enter sh./***. Sh // to
# extract the IP address of the server IP = 'ifconfigeth0 | grep "inetaddr" | cut-f2-d ": "| cut-f1-d" "'# Take the percentage of the current idle cpu (only integer) cpu_idle = 'top-b-n1 | grepCpu | awk' {print $5} '| cut-f1-d ". "'# Set the alarm value of idle cpu to 20%. if the current cpu usage exceeds 80% (that is, the remaining cpu usage is less than 20%), send an email to send an alarm if ($ cpu_idle
Use the top command to dynamically monitor the memory usage of programs that run for a short period of time.
Solution:
Top-d 0.01-N2000-B | grep lzma
-D specifies the interval at which top data is collected. The value is 0.01 seconds.
-N indicates the total number of statistics. Set this parameter to 2000 to ensure that the top node does not end the stati
=" http://s3.51cto.com/wyfs02/M02/6E/F6/wKiom1WM8gPQQRyZAALAZZkB_o8110.jpg "title=" 7.png " alt= "Wkiom1wm8gpqqryzaalazzkb_o8110.jpg"/>Some of the options shown. Here we select information such as CPU memory load mount points. Click SaveClick New Graphs on the left to enter650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/F3/wKioL1WM89DCSPbBAALfGez6nQw381.jpg "title=" 8.png " alt= "Wkiol1wm89dcspbbaalfgez6nqw381.jpg"/>The page shown in the
Use the shell to monitor CPU, disk, memory usage, reach alert thresholds and email notificationsAnd with the task plan, you can get the alarm information in time#!/bin/bash############################################## #Author:liuzhengwei-[email Protected] #QQ: 1135960569#lastmodified:2017-04-1921:50#filename:jiankong.sh#description : ############################
Use the top command to dynamically monitor the memory usage of programs with very short running times
Solution:
Top-d 0.01-N2000-B | grep lzma
-D specifies the interval at which top data is collected. The value is 0.01 seconds.
-N indicates the total number of statistics. Set this parameter to 2000 to ensure that the top node does not end the statistics d
Solution:top-d 0.01-n 2000-b|grep Lzma-d Specifies how often the top collects data, which is 0.01 seconds.-n Specifies the total number of times, which is set to 2000, to ensure that top does not end the statistics during the program run.GREP specifies the process characteristics that need to be counted.How to use:1. Enable 2 sessions, one session runs as above command, another session runs the specified program, and the top command outputs the resource usag
" fuquanjun@xxx.com
Fi
# chmod a+x/scripts/cpu-warning.sh
Monitor system memory using free command:
1, use the free command to view the Linux system memory usage: (in m)
Copy Code code as follows:
# free-m
Total used free shared buffers Cached
mem:3952 3414 538 0 168 484
-/+ buffe
One of the best known advantages of Java technology is that, unlike other languages such as C programmers, Java programmers do not have to be responsible for daunting memory allocations and releases. The Java runtime can manage these tasks for you. Each instantiated object automatically allocates memory in the heap, and the garbage collector periodically reclaims the me
Tags: Linux grab tcpdump netstat view network status PS System State free memory usage Iostat disk performanceMonitoring IO Disk Performance命令如下:iostat -x 磁盘使用iotop 磁盘使用
%util look at the health of a hard drive,
Installing Iotop[[emailprotected] ~]# yum install -y iotop
Iotop command, mainly to see the io> column, see the performance of the disk
Free to view
Zabbix Monitor nginx,php-fpm and MySQL memory usage and number of processes with custom scriptsFirst, add a script under the Zabbix script directory and write the following code#!/bin/bash#license: GPL#mail: [Email protected]#date: 2015.04.16Top-bn1>/usr/local/zabbix-2.4.4/scripts/process.logLog=/usr/local/zabbix-2.4.4/scripts/process.logPHP_FPM () {grep "PHP-FPM
$} '#设置交换分区的告警值为20%swap_warn=0.20if (($swap _used! = 0)); Then#如果交换分区已被使用, calculates the percentage of the total of the current remaining swap partition free, in decimal notation, to complement an integer digit before the decimal point 0Swap_per= ' echo ' scale=2;b= $swap _free/$swap _total;if (length (b) ==scale (b)) print 0;print B "|BC"#当前剩余交换分区百分比与告警值进行比较 (1 is returned when the value is less than 20%, and 0 is returned if it is less than)swap_now= ' expr $swap _per \ #如果当前交换分区使用即剩余小于20% (
In order to more easily know the memory usage on the server, and according to the memory use size to restart the service, I only the whole fault alarm, if you want to automatically restart the service, we will have to modify their own.
Script content:
It's written, it's not very good-looking, and it's not very good with awk, it's not going to be output in awk,
PC-Lint software usage
1. installation and configuration
PC-Lint software is cost-effective, easy to learn, easy to promote and solidify into the software development and testing process, so it has been widely used in the world. PC-Lint is easy to use. You can use the command line method. For example, lint-NT-u STD.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.