CPU, hard disk, memory utilization under Linux system

Source: Internet
Author: User
Tags snmp

Install SNMP Service on 1.linux

First step: Install the SNMP service on the company 192.168.100.171 Linux virtual machine.

The second step: get the corresponding value through the nodes in the Host-resources-mib library.

Step three: You can only pass: The 1.3.6.1.2.1.25.1.1.0 node object gets to the system run time and cannot get the value to the other node.

Fourth step: Modify the/etc/snmp/snmpd.conf file

Add a line: View SystemView included. 1

Fifth step: Restart the SNMP service after modifying the configuration.

2.CPU, HDD, Memory utilization Calculation 2.1 CPU Utilization 2.1.1 formula

CPU utilization = (sum of CPU load values/number of processors) *100%

2.1.1 Algorithm (Flow) description

(1) Get the corresponding CPU load value via node: Hrprocessorload (1.3.6.1.2.1.25.3.3.1.2):

(2) There are 4 values indicating that the system has a core number of 4 cores

(3) CPU utilization = (1+1+1+1)/4 *100% = 1%

2.2 HDD Utilization Calculation 2.1.1 formula

Used hard disk size = number of used clusters * size of each cluster

Total hard disk size = total number of clusters in the hard disk * size of each cluster

HDD utilization = (used hard drive size/hard disk total size) * 100%

2.1.1 Algorithm (Flow) description

hrstorageused:1.3.6.1.2.1.25.2.3.1.6

hrstoragesize:1.3.6.1.2.1.25.2.3.1.5

hrstorageallocationunits:1.3.6.1.2.1.25.2.3.1.4

The number of clusters used per partition:

hrstorageused.31

1220045

hrstorageused.35

57

hrstorageused.36

39874

hrstorageused.37

363210

hrstorageused.40

2181544

The total number of clusters per partition:

hrstoragesize.31

12901535

hrstoragesize.35

1005704

hrstoragesize.36

495844

hrstoragesize.37

11766514

hrstoragesize.40

2181544

The size of the cluster corresponding to each partition

hrstorageallocationunits.31

4096

hrstorageallocationunits.35

4096

hrstorageallocationunits.36

1024

hrstorageallocationunits.37

4096

hrstorageallocationunits.40

2048

HDD Utilization Calculation:

HDD Utilization = (1220045 * 4096 + 57 * 4096 + 39874 * 1024 + 363210 * 4096 + 2181544 * 2048)/(12901535 * 4096 + 1005704 * 40) 96 + 495844 * 1024 + 11766514 * 4096 + 2181544 * 2048) * 100% = 9.98%

2.3 Memory Utilization Calculation 2.1.1 formula

Memory size used = number of clusters used * size of each cluster

Total memory size = Total number of families * size of each cluster

Memory Utilization = (memory size used/total memory size) *100%

2.1.1 Algorithm (Flow) description

Get memory-corresponding information:

hrstorageused:1.3.6.1.2.1.25.2.3.1.6

hrstoragesize:1.3.6.1.2.1.25.2.3.1.5

hrstorageallocationunits:1.3.6.1.2.1.25.2.3.1.4

Hrstorageused.1

1463816 number of clusters used

Hrstoragesize.1

Total number of 8045632 clusters

Hrstorageallocationunits.1

1024 size of each cluster

Memory Utilization Calculation:

Memory Utilization = (1463816 * 1024)/(8045632 *1024) *100% = 18.1

CPU, hard disk, memory utilization under Linux system

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.