Cpu usage
Collection AlgorithmCollect and calculate the total CPU usage or single-core usage using the/proc/stat file. Taking cpu0 as an example, the algorithm is as follows:1. cat/proc/stat | grep 'cpu0' to obtain cpu0 Information2. cpuTotal1 =
When a Linux system encounters a problem, we not only need to view the system log information, but also need to use a large number of performance monitoring tools to determine which part (memory, CPU, hard disk ......) An error occurred. In Linux,
Monitoring is the core task of cluster management. Monitoring data can be used for scheduling tasks, load balancing, reporting software and hardware faults to administrators, and extensively controlling system usage. The monitoring information must
I have been watching the device model over the past few days, and the kernel code has become increasingly frustrating, especially the relationship between kboject, kset, and ktype. However, I plan to skip these important structures and introduce the
This article mainly introduces how to use python to monitor system load scripts in linux. For more information, see the following code:
#! /Usr/bin/env PythonImport OSDef load_stat ():Loadavg = {}F = open ("/proc/loadavg ")Con = f. read (). split
Cat/proc/stat
The specific meaning of each field:User: indicates the CPU time in the User State from the time the system starts to the current time. The unit is 0.01 s.Nice: the CPU time occupied by processes with a negative nice value from the
Reference blog: http://www.cnblogs.com/chensiqiqi/p/6243549.html Thank Yumbo Lord for learning Linux for me to specify the direction!!Linux directory: Everything starts with "root", "/" is the starting point of all directories (fixed point)Linux
When there is a problem with the Linux system, we not only need to look at the system log information, but also use a lot of performance monitoring tools to determine what part (memory, CPU, hard disk ...). ) out of the question. In the Linux system,
It's not easy to ask the mobile phones of the monitoring group to do something! You want to ask who they are? They are gods. Do not find them easily, because find is also white find. The last time because Python and Redis long brpop, the thread
1, Linux system different directory can be distributed in different partitions or different hard disk devices, which is difficult for windows to reach. Directory and disk partitions are not associated.2, Mount point is the entry of the system into
CPU Information Acquisition
CPU UsageAcquisition algorithmCollect and calculate total CPU usage or single core utilization with/proc/stat files. Take cpu0 as an example, the algorithm is as follows:1. Cat/proc/stat | grep ' cpu0 ' gets cpu0 's
System
# Uname-a # view kernel/operating system/CPU Information
# Head-n 1/etc/issue # view the operating system version
# Cat/proc/cpuinfo # view CPU Information
# Hostname # view the computer name
# Lspci-TV # list all PCI devices
# Lsusb-TV
Meaning of linux folders (the most complete version)/bin: where binary programs live. /boot: the special programs that start the system when you turn the machine on. /dev: aaaaaalll the "device" listings for hardware of every concievable flavor,
1. vmstat reports virtual memory statisticsVmstat [-V] [-n] [delay [count] delay is the delay time between two outputs. count is the number of times counted based on this interval. Example: vmstat-n 3 (refresh once every 3 seconds)Procs -----------
# Uname-a # view kernel/operating system/CPU Information# Head-n 1/etc/issue # view the operating system version# Hostname # view the computer name# Lspci-TV # list all PCI devices# Lsusb-TV # list all USB devices# Lsmod # list loaded Kernel Modules#
[Root @ yufei ~] # Uname-a # linux system information command for viewing kernel/operating system/CPU information [root @ yufei ~] # Head-n1/etc/issue # view the operating system version, is the number 1 is not the letter L [root @ yufei ~] #
As we all know, everything in Linux is a file, in the root directory of Linux/unix, there is a/proc directory, this/proc is a kernel and kernel module used to send information to the process (processes) mechanism (so called "/proc"), This pseudo
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.