CN111124820B - Method for realizing off-line monitoring and analysis of operating system and process resources - Google Patents

Method for realizing off-line monitoring and analysis of operating system and process resources Download PDF

Info

Publication number
CN111124820B
CN111124820B CN201911277567.2A CN201911277567A CN111124820B CN 111124820 B CN111124820 B CN 111124820B CN 201911277567 A CN201911277567 A CN 201911277567A CN 111124820 B CN111124820 B CN 111124820B
Authority
CN
China
Prior art keywords
operating system
acquisition
resource
monitoring
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911277567.2A
Other languages
Chinese (zh)
Other versions
CN111124820A (en
Inventor
贾小波
张伟
李洪坤
王天还
黄登军
张芝庆
刘林松
孙鸿建
姜耀凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Vcom Science And Technology Co ltd
Original Assignee
Zhengzhou Vcom Science And Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhengzhou Vcom Science And Technology Co ltd filed Critical Zhengzhou Vcom Science And Technology Co ltd
Priority to CN201911277567.2A priority Critical patent/CN111124820B/en
Publication of CN111124820A publication Critical patent/CN111124820A/en
Application granted granted Critical
Publication of CN111124820B publication Critical patent/CN111124820B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a method for realizing off-line monitoring and analysis of an operating system and a process resource, which comprises the following steps: starting an operating system resource collector to collect information at regular time; writing the acquired information and the acquisition time into an acquisition log file; analyzing the acquisition log and displaying the acquisition result. The invention can carry out resource monitoring and scene playback on Linux and Windows systems, and realize unattended off-line monitoring: only the resource collector is required to be started, and the collection log is stored for being consulted and played back at any time; custom monitoring items and custom query results: the monitoring item and the monitoring process can be specified according to the self-needs, and each monitoring object can be queried in a self-defined manner; the acquisition result can be stored for a long time, and playback inquiry can be carried out at any time; the use method is simple, and can be normally used by non-professional personnel.

Description

Method for realizing off-line monitoring and analysis of operating system and process resources
Technical Field
The invention relates to the field of information monitoring, in particular to a method for realizing offline monitoring and analysis of an operating system and process resources.
Background
The current Windows system resource monitoring technology mainly uses a Windows system self-contained system monitoring tool and a secondary development technology, and the main technology is as follows:
1) Performance tabs for Windows operating system task manager;
2) Windows operating system resource monitor;
3) Windows operating system performance monitor;
4) Reading Windows operating system Performance Counter data to obtain resource occupation data;
the Linux operating system resource monitoring technology mainly uses a resource monitoring command provided by a Linux operating system, and the main resource monitoring command is as follows: ps, pstree, top, free, mpstat, vmstst, pidstat, iostat, iotop; by using the commands, the occupation condition of the resources of the Linux operating system can be completely checked.
Although resource monitoring methods are provided in windows and Linux operating systems, for example, a resource monitoring tool of the windows operating system and a resource viewing command also provided in the Linux operating system are provided; but currently there is no capability to resource monitor two different operating systems across platforms.
The Windows operating system own resource monitoring tool has the following disadvantages:
1) Integrated with an operating system, and cannot be modified in a self-defined way;
2) The history record cannot be saved and the resource history scene cannot be played back;
3) Performance Counter data requires professional personnel to develop and realize the secondary, and the difficulty is high.
The Linux operating system resource-related commands have the following disadvantages: :
1) Each command can only complete a certain function related to the command, and complete system monitoring cannot be realized;
2) The history of command execution cannot be saved and the resource history scene cannot be played back;
3) Requiring specialized personnel to do so.
Disclosure of Invention
In order to avoid the above problems, a method for implementing offline monitoring and analysis of operating system and process resources is provided.
The object of the invention is achieved in the following way:
a method for realizing off-line monitoring and analysis of operating system and process resources comprises the following steps
S1: starting an operating system resource collector to collect information at regular time;
s2: writing the acquired information and the acquisition time into an acquisition log file;
s3: analyzing the acquisition log and displaying the acquisition result.
The collected information comprises system CPU utilization rate, system memory occupation, network throughput, system IO read-write, user-defined process CPU occupation rate, user-defined process memory occupation, user-defined process network throughput and user-defined process IO read-write.
The operating system resource manager comprises a Linux operating system resource collector and a Windows operating system resource collector.
The Linux operating system resource collector uses Linux Shell script to collect, and the implementation process is as follows:
the parameters when the script is started specify the process to be monitored, each parameter specifies a process name, and a plurality of parameters can be added;
adding a cycle in a Shell script, designating cycle acquisition interval time, acquiring system CPU, memory and IO resource occupation conditions in a cycle body by using a Linux command vmstat command, and acquiring system resources and resource occupation conditions of designated processes by using ps and pstree;
read network throughput: and reading the transmission data volume of the network card equipment at the time of 1 second to obtain the network throughput.
The Windows operating system resource collector uses python programming to realize Windows resource monitoring, and the specific implementation process is as follows:
specifying a process to be monitored in a configuration file;
using a python system monitoring module psutil to monitor the system resource kernel process resource;
program execution process: after the program is started, firstly, the process needing to be monitored in the configuration file is read, a loop is added, the loop acquisition interval time is designated, and resources occupied by the CPU, the memory, the IO and the designated process are acquired by using a psutil related system resource function in the loop body.
In the step S3, the specific steps are as follows: reading log file contents line by line, respectively analyzing acquisition time, system CPU, memory, IO, network throughput information and resource information occupied by processes, and writing an acquisition result of each time point into an access database as a record; and outputting the acquisition result by adopting the two-dimensional table, using the acquisition time as the transverse axis of the two-dimensional table, using the acquisition result as the longitudinal axis of the two-dimensional table, and displaying the acquisition result.
A readable storage medium having stored thereon an executable program which when executed by a processor performs the steps of the above method.
An electronic device, comprising:
a memory having an executable program stored thereon;
and a processor for executing the executable program in the memory to implement the steps of the above method.
The invention has the beneficial effects that: 1. cross-platform: the resource monitoring and scene playback can be carried out on the Linux and Windows systems;
2. unattended offline monitoring: only the resource collector is required to be started, and the collection log is stored for being consulted and played back at any time;
3. custom monitoring items and custom query results: the monitoring item and the monitoring process can be specified according to the self-needs, and each monitoring object can be queried in a self-defined manner;
4. the acquisition result can be stored for a long time, and playback inquiry can be carried out at any time;
5. the use method is simple, and can be normally used by non-professional personnel.
Drawings
FIG. 1 is a schematic diagram of the operation of a method of the present invention for implementing off-line monitoring and analysis of operating system and process resources.
FIG. 2 is an interface diagram of a Linux operating system acquisition log of the present invention.
FIG. 3 is an interface diagram of a Windows operating system acquisition log according to the present invention.
FIG. 4 is an interface diagram showing the system CPU idle rate and results for a certain period of time in a two-dimensional table of acquisition logs according to the present invention.
Detailed Description
The invention will be described in further detail with reference to the drawings and the detailed description.
As shown in FIG. 1, a method for offline monitoring and analyzing of operating system and process resources comprises the following steps
S1: starting an operating system resource collector to collect information at fixed time, wherein the collected information comprises system CPU utilization rate, system memory occupation, network throughput, system IO read-write, user-defined process CPU occupation rate, user-defined process memory occupation, user-defined process network throughput and user-defined process IO read-write quantity;
s2: writing the acquired information data and the acquisition time into an acquisition log file;
s3: the local workbench acquires the acquisition log file, analyzes the acquisition log and displays the acquisition result.
The operating system resource manager comprises a Linux operating system resource collector and a Windows operating system resource collector. The Linux operating system resource collector and the Windows operating system resource collector are installed on a computer running on a monitor.
The Linux operating system resource collector realizes the principle: the Linux Shell is adopted for writing, so that the resource occupation condition of an operating system and a self-defined process can be acquired at fixed time, and the acquired information comprises system real-time CPU, memory, network throughput and IO information, system resources occupied by the self-defined process and process number information; and writing the acquired data into the acquisition log file according to a specific rule at regular time. The implementation principle of the Windows operating system resource collector is as follows: the resource occupation conditions of the operating system and the custom process can be acquired at fixed time, and the acquired information comprises system real-time CPU, memory, network and IO information, and system resources occupied by the custom process; and writing the acquired data into the acquisition log file according to a specific rule at regular time.
The Linux operating system resource collector uses Linux Shell script to collect, and the specific implementation process is as follows:
the parameters when the script is started specify the process to be monitored, each parameter specifies a process name, and a plurality of parameters can be added;
adding a cycle in a Shell script, designating cycle acquisition interval time, acquiring system CPU, memory and IO resource occupation conditions in a cycle body by using a Linux command vmstat command, and acquiring system resources and resource occupation conditions of designated processes by using ps and pstree;
read network throughput: and reading the transmission data volume of the network card equipment at the time of 1 second to obtain the network throughput.
The Windows operating system resource collector uses python programming to realize Windows resource monitoring, and the specific implementation process is as follows:
adding a process name which is required to be monitored in a process configuration item part in a program configuration file config;
using a python system monitoring module psutil to monitor the system resource kernel process resource;
program execution process: after the program is started, firstly, the process needing to be monitored in the configuration file is read, a loop is added, the loop acquisition interval time is designated, and resources occupied by the CPU, the memory, the IO and the designated process are acquired by using a psutil related system resource function in the loop body.
In the step S3, after the local workstation obtains the acquisition log file, the acquisition log is analyzed, and the acquisition log is displayed in a graphical manner to observe the running state of the system and the process in a certain time period, wherein the local workstation is a computer as shown in fig. 2 and 3, the programming language is implemented by using Delphi, and the analysis result is stored by using access; the specific analysis steps are as follows: reading log file contents line by line, respectively analyzing acquisition time, system CPU, memory, IO, network throughput information and resource information occupied by processes, and writing an acquisition result of each time point into an access database as a record; and outputting the acquisition result by adopting the two-dimensional table, using the acquisition time as the transverse axis of the two-dimensional table, using the acquisition result as the longitudinal axis of the two-dimensional table, and displaying the acquisition result.
The manner in which the local workstation obtains the acquisition log file includes copying.
A readable storage medium having stored thereon an executable program which when executed by a processor performs the steps of the above method.
An electronic device, comprising:
a memory having an executable program stored thereon;
and a processor for executing the executable program in the memory to implement the steps of the above method.
The invention has the following advantages: cross-platform: resource monitoring and scene playback can be performed on Linux and Windows systems.
Unattended offline monitoring: only the resource collector needs to be started, and the collection log can be stored for reference and playback at any time.
Custom monitoring and query modes: the monitoring items and the monitoring process can be specified according to the needs of the user, and each monitoring object can be queried in a self-defined mode.
The acquisition result can be stored for a long time, and playback inquiry can be carried out at any time.
The use method is simple, and can be normally used by non-professional personnel.
The foregoing is merely a preferred embodiment of the present invention, and it should be noted that it will be apparent to those skilled in the art that several changes and modifications can be made without departing from the general inventive concept, and these should also be regarded as the scope of the invention.

Claims (5)

1. A method for realizing off-line monitoring and analysis of operating system and process resources is characterized in that: comprises the following steps
S1: starting an operating system resource collector to collect information at regular time;
s2: writing the acquired information and the acquisition time into an acquisition log file;
s3: analyzing the acquisition log and displaying the acquisition result;
the operating system resource collector comprises a Linux operating system resource collector and a Windows operating system resource collector;
the Windows operating system resource collector uses python programming to realize Windows resource monitoring, and the specific implementation process is as follows:
specifying a process to be monitored in a configuration file;
using a python system monitoring module psutil to monitor the system resource kernel process resource;
program execution process: after a program is started, firstly, a process needing to be monitored in a configuration file is read, a cycle is added, the cycle acquisition interval time is designated, and resources occupied by a CPU, a memory, IO and the designated process are acquired by using a psuil related system resource function in the cycle body;
in the step S3, the specific steps are as follows: reading log file contents line by line, respectively analyzing acquisition time, system CPU, memory, IO, network throughput information and resource information occupied by processes, and writing an acquisition result of each time point into an access database as a record; and outputting the acquisition result by adopting the two-dimensional table, using the acquisition time as the transverse axis of the two-dimensional table, using the acquisition result as the longitudinal axis of the two-dimensional table, and displaying the acquisition result.
2. The method for implementing off-line monitoring and analysis of operating system and process resources of claim 1, wherein: the collected information comprises system CPU utilization rate, system memory occupation, network throughput, system IO read-write, user-defined process CPU occupation rate, user-defined process memory occupation, user-defined process network throughput and user-defined process IO read-write.
3. The method for implementing off-line monitoring and analysis of operating system and process resources of claim 1, wherein: the Linux operating system resource collector uses Linux Shell script to collect, and the implementation process is as follows:
the parameters when the script is started specify the process to be monitored, each parameter specifies a process name, and a plurality of parameters can be added;
adding a cycle in a Shell script, designating cycle acquisition interval time, acquiring system CPU, memory and IO resource occupation conditions in a cycle body by using a Linux command vmstat command, and acquiring system resources and resource occupation conditions of designated processes by using ps and pstree;
read network throughput: and reading the transmission data volume of the network card equipment at the time of 1 second to obtain the network throughput.
4. A readable storage medium having stored thereon an executable program, which when executed by a processor, implements the steps of the method of any of claims 1-3.
5. An electronic device, comprising:
a memory having an executable program stored thereon;
a processor for executing the executable program in the memory to implement the steps of the method of any one of claims 1-4.
CN201911277567.2A 2019-12-13 2019-12-13 Method for realizing off-line monitoring and analysis of operating system and process resources Active CN111124820B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911277567.2A CN111124820B (en) 2019-12-13 2019-12-13 Method for realizing off-line monitoring and analysis of operating system and process resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911277567.2A CN111124820B (en) 2019-12-13 2019-12-13 Method for realizing off-line monitoring and analysis of operating system and process resources

Publications (2)

Publication Number Publication Date
CN111124820A CN111124820A (en) 2020-05-08
CN111124820B true CN111124820B (en) 2023-12-22

Family

ID=70498525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911277567.2A Active CN111124820B (en) 2019-12-13 2019-12-13 Method for realizing off-line monitoring and analysis of operating system and process resources

Country Status (1)

Country Link
CN (1) CN111124820B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112162821B (en) * 2020-09-25 2022-04-26 中国电力科学研究院有限公司 Container cluster resource monitoring method, device and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533366A (en) * 2009-03-09 2009-09-16 浪潮电子信息产业股份有限公司 Method for acquiring and analyzing performance data of server
CN103544095A (en) * 2012-07-12 2014-01-29 腾讯科技(深圳)有限公司 Server program monitoring method and system of server program
CN103685399A (en) * 2012-09-17 2014-03-26 腾讯科技(深圳)有限公司 Method, device and system for logging in Unix-like virtual container
CN106708700A (en) * 2016-12-13 2017-05-24 广东金赋科技股份有限公司 Operation and maintenance monitoring method and device applied to server side
CN107423198A (en) * 2017-07-10 2017-12-01 中核核电运行管理有限公司 A kind of EAM platform monitorings management method and system
CN109491897A (en) * 2018-10-26 2019-03-19 成都安恒信息技术有限公司 A kind of system resource leak testing method based on trend analysis
CN109800131A (en) * 2018-12-18 2019-05-24 平安健康保险股份有限公司 Monitor processing method, device, computer equipment and the storage medium of Linux server
CN110554949A (en) * 2019-08-30 2019-12-10 苏州浪潮智能科技有限公司 Cross-platform process data collecting and analyzing tool, method and using method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10284627B2 (en) * 2013-03-29 2019-05-07 Citrix Systems, Inc. Data management for an application with multiple operation modes

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533366A (en) * 2009-03-09 2009-09-16 浪潮电子信息产业股份有限公司 Method for acquiring and analyzing performance data of server
CN103544095A (en) * 2012-07-12 2014-01-29 腾讯科技(深圳)有限公司 Server program monitoring method and system of server program
CN103685399A (en) * 2012-09-17 2014-03-26 腾讯科技(深圳)有限公司 Method, device and system for logging in Unix-like virtual container
CN106708700A (en) * 2016-12-13 2017-05-24 广东金赋科技股份有限公司 Operation and maintenance monitoring method and device applied to server side
CN107423198A (en) * 2017-07-10 2017-12-01 中核核电运行管理有限公司 A kind of EAM platform monitorings management method and system
CN109491897A (en) * 2018-10-26 2019-03-19 成都安恒信息技术有限公司 A kind of system resource leak testing method based on trend analysis
CN109800131A (en) * 2018-12-18 2019-05-24 平安健康保险股份有限公司 Monitor processing method, device, computer equipment and the storage medium of Linux server
CN110554949A (en) * 2019-08-30 2019-12-10 苏州浪潮智能科技有限公司 Cross-platform process data collecting and analyzing tool, method and using method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A robot simulation, monitoring and control system based on network and Java3D;Chen Yimin等;Proceedings of the 4th World Congress on Intelligent Control and Automation;全文 *
Windows环境下的进程监视***的设计与实现;黄竞斌;彭新一;黄志炜;;计算机与现代化;第2010卷(第10期);全文 *
嵌入式Linux内核运行态性能可视化分析方法的设计与实现;崔娟;测控技术;第35卷(第01期);全文 *

Also Published As

Publication number Publication date
CN111124820A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
WO2019153111A1 (en) Intermittent failure metrics in technological processes
US20130081001A1 (en) Immediate delay tracker tool
US20070220360A1 (en) Automated display of trace historical data
EP2960797B1 (en) Identification of software phases using machine learning
CN112148610A (en) Test case execution method and device, computer equipment and storage medium
US10528456B2 (en) Determining idle testing periods
CN113656245B (en) Data inspection method and device, storage medium and processor
CN111045911A (en) Performance test method, performance test device, storage medium and electronic equipment
CN108768790A (en) Distributed search cluster monitoring method and device, computing device, storage medium
CN111782452A (en) Method, system, device and medium for interface contrast test
CN111339118A (en) Kubernetes-based resource change history recording method and device
CN111124820B (en) Method for realizing off-line monitoring and analysis of operating system and process resources
US20130318499A1 (en) Test script generation
CN111708576A (en) Cross-operating-system equipment network card adapting and managing method, device and system
CN107330031A (en) A kind of method of data storage, device and electronic equipment
CN110990227A (en) Numerical pool application characteristic performance acquisition and monitoring system and operation method thereof
CN113448867B (en) Software pressure testing method and device
CN112560938A (en) Model training method and device and computer equipment
US20200285647A1 (en) Asynchronous data enrichment for an append-only data store
CN113282631A (en) Method and equipment for determining target user based on user portrait data
WO2023221004A1 (en) Test data processing method and apparatus, and electronic device and storage medium
CN117130946B (en) Test scene generation method and device, electronic equipment and readable storage medium
CN112765128B (en) REPL-based data development method, system and electronic equipment
CN101655945B (en) Method and device for processing business record in business information management system
CN116701196A (en) Method, system and equipment for testing compatibility of client operating system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant