CN103019910B - A kind of monitor the method and system of resource in Linux server - Google Patents

A kind of monitor the method and system of resource in Linux server Download PDF

Info

Publication number
CN103019910B
CN103019910B CN201110288505.9A CN201110288505A CN103019910B CN 103019910 B CN103019910 B CN 103019910B CN 201110288505 A CN201110288505 A CN 201110288505A CN 103019910 B CN103019910 B CN 103019910B
Authority
CN
China
Prior art keywords
monitoring
step
monitored
linux server
described
Prior art date
Application number
CN201110288505.9A
Other languages
Chinese (zh)
Other versions
CN103019910A (en
Inventor
郭永震
Original Assignee
北京新媒传信科技有限公司
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 北京新媒传信科技有限公司 filed Critical 北京新媒传信科技有限公司
Priority to CN201110288505.9A priority Critical patent/CN103019910B/en
Publication of CN103019910A publication Critical patent/CN103019910A/en
Application granted granted Critical
Publication of CN103019910B publication Critical patent/CN103019910B/en

Links

Abstract

The invention discloses and a kind of monitor the method and system of resource in Linux server, method includes: step 1, and monitoring system is connected in monitored Linux server;Step 2, monitoring system obtains the data of necessary for monitoring by performing shell-command in described Linux server;Step 3, the data that monitoring system preservation obtains;Step 4, monitoring system is according to the data genaration monitoring pattern preserved or form.The resource of the Linux server of monitoring can be patterned display by the present invention, and without installing client software.

Description

A kind of monitor the method and system of resource in Linux server

Technical field

The present invention relates to monitoring field, particularly relate to the method and system of resource in monitoring Linux server.

Background technology

What current linux system was general is applied in server field, but Linux itself is not for the graphical performance counter of the process of operation, it is impossible to reflect server performance situation of change by the formal intuition of graphical icon.

Third-party monitoring resource software of the prior art, it usually needs user installation client just can complete monitoring purpose.This kind of scheme uses to user and brings inconvenience.

Summary of the invention

The invention provides and a kind of monitor the method for resource in Linux server, the resource of the Linux server of monitoring can be patterned display by the method, and without installing client software so that monitoring is more directly perceived and convenient.

Present invention also offers and a kind of monitor the system of resource in Linux server, the resource of the Linux server of monitoring can be patterned display by this system, and without installing client software so that monitoring is more directly perceived and convenient.

For reaching above-mentioned purpose, the technical scheme is that and be achieved in that:

The invention discloses and a kind of monitor the method for resource in Linux server, including:

Step 1, monitoring system is connected in monitored Linux server;

Step 2, monitoring system obtains the data of necessary for monitoring by performing shell-command in described Linux server;

Step 3, the data that monitoring system preservation obtains;

Step 4, monitoring system is according to the data genaration monitoring pattern preserved or form.

It is also preferred that the left described step 1 is further,

Step 21, monitoring system is connected in monitored Linux server by safety shell protocol.

It is also preferred that the left described step 2 is further,

Step 31, monitoring system is connected in described monitored Linux server by safety shell protocol and performs shell-command;

Step 32, monitored Linux server returns and performs result to monitoring system;

Step 33, performs result described in monitoring system analysis, obtains the data of necessary for monitoring.

It is also preferred that the left described step 2 is further,

Step 41, monitoring system is connected to the ps order performing shell-command in described monitored Linux server by safety shell protocol;

Step 42, the title according to the monitored process of configuration, inquire monitored state of a process information, described status information composition performs result, and monitored Linux server returns and performs result to monitoring system;

Step 43, monitoring system parses monitored state of a process information from execution result.

It is also preferred that the left described step 2 is further,

Monitoring system periodically carries out shell-command with the refresh interval arranged for the cycle in described Linux server, obtains the data of necessary for monitoring;

Described step 3 is further,

Step 51, monitoring system, for each monitored process, preserves the status information of correspondence in chronological order.

It is also preferred that the left described step 4 is further,

Step 61, the monitored state of a process information according to preserving sets up ordinate of orthogonal axes information, using the time as transverse axis coordinate information, draws the monitoring curve chart of monitored process.

It is also preferred that the left described method also includes:

Step 71, adjusts the fine degree of monitoring curve chart by adjusting refresh interval.

It is also preferred that the left also include after described step 2:

Step 81, monitoring system judges that performing the process that data in result are empty performs to terminate, and terminates the monitoring to described process.

The invention also discloses and a kind of monitor the system of resource in Linux server, including:

Link block, for connecting the system to the Linux server being monitored;

Data acquisition module, for the data by performing shell-command acquirement necessary for monitoring in described Linux server;

Preserve module, for preserving the data of acquirement;

Chart generating module, for according to described data genaration monitoring pattern or form.

It is also preferred that the left described data acquisition module is further used for periodically carrying out shell-command with the refresh interval arranged in described Linux server for the cycle, obtain the data of necessary for monitoring;

Described preservation module is further used for, for each monitored process, preserving the status information of correspondence in chronological order.

From above-mentioned, the present invention is connected in Linux server is performed shell-command, acquisition necessary for monitoring data by what sets up, it is not necessary to installs client and just can be monitored;By the data obtained are preserved and make chart, it is possible to performance monitoring information intuitively;By periodically performing shell-command, make the curve chart of monitored process, it is possible to provide the user monitored process and change over information;Additionally, by adjusting the refresh interval time, it is possible to adjust the fine degree of curve chart further.

Accompanying drawing explanation

Fig. 1 is that the present invention monitors the flow chart of the method for resource in Linux server;

Fig. 2 is the curve chart taking situation of the CPU in the Linux server that the present invention monitors;

Fig. 3 is the structural representation of the inventive method specific embodiment;

Fig. 4 is the flow chart of the inventive method specific embodiment.

Detailed description of the invention

In order to make the object, technical solutions and advantages of the present invention clearly, describe the present invention below in conjunction with the drawings and specific embodiments.

A kind of monitor in Linux server the method for resource as shown in Figure 1.

Step S100, monitoring system is connected in monitored Linux server.

Monitoring system can be accomplished in several ways to the connection of monitored Linux server.Such as, monitoring system is connected in monitored Linux server by SSH (SecureShell, safety shell protocol).

Step S200, monitoring system obtains the data of necessary for monitoring by performing shell-command in this Linux server.

When using SSH to be attached, step S200 can be achieved by the following scheme.

Step S210, monitoring system is connected in monitored Linux server by SSH and performs shell-command.

Step S220, monitored Linux server returns and performs result to monitoring system.

Step S230, monitoring system analysis performs result, obtains the data of necessary for monitoring.

Shell-command both provided the interface of linux kernel, included again command set.By performing command set obtains the order of progress information, for instance ps, pstree, it is thus achieved that monitoring data.

For example, monitoring system is connected to the ps order performing shell-command in monitored Linux server by SSH.The title of the monitored process according to configuration, inquires monitored state of a process information, and monitored Linux server returns and performs result to monitoring system, performs to include the monitored state of a process information in monitored Linux server in result.This status information include monitored process committed memory numerical value, take in CPU numerical value and Thread Count one or more.Monitoring system parses monitored state of a process information from execution result.

Step S300, the data that monitoring system preservation obtains.

Step S400, monitoring system is according to the data genaration monitoring pattern preserved or form.

Monitoring pattern or form that monitoring system generates can be various ways.For example, according to the data in certain execution result once returned, contrast each a certain status information of monitored process in same monitored Linux server, as CPU takies percentage ratio, generate block diagram or the percentage ratio pie chart of performance relativity.

When requiring the curve chart generating monitored process, it is possible to complete as follows.

Monitoring system periodically carries out shell-command with the refresh interval arranged for the cycle in Linux server, obtains monitored state of a process information.Monitoring system, for each monitored process, preserves the status information of correspondence in chronological order.Monitored state of a process information according to preserving sets up ordinate of orthogonal axes information, using the time as transverse axis coordinate information, draws the monitoring curve chart of monitored process.

For contrasting conveniently, it is possible at the monitoring curve chart of the multiple monitored process of same interface display.

Additionally, the data of monitoring process can be arranged by monitoring system, count the resource service condition of each program or task further, generate figure or form.As in figure 2 it is shown, the CPU that user represents user takies percentage ratio;System represents that the CPU of system takies percentage ratio;Iowait represents that the CPU of input and output takies percentage ratio;Total represent CPU overall utilize percentage ratio, including above-mentioned user, system, iowait, and other tasks.

Further, the fine degree of monitoring curve chart can also be adjusted by the method by adjustment refresh interval.

When performing the data of a certain monitored state of a process information in result and being empty, monitoring system judges that this process performs to terminate, and automatically terminates the monitoring to this process.

The structure of the inventive method specific embodiment is as shown in Figure 3.Wherein, monitoring system is connected with Linux server by network.Monitoring system monitors multiple processes of multiple stage Linux server simultaneously, and contrasts the monitored results of acquisition.The configuration that monitoring system is carried out includes the Linux server and the IP address thereof that are monitored, the title of user name password and monitored process, and refresh interval.The flow process of specific embodiment is as shown in Figure 4.

Step S401, monitoring system is connected to Linux server by SSH mode.

Step S402, monitoring system connects execution shell-command by the SSH set up, and is obtained the cpu usage of process by ps order, internal memory service condition, Thread Count, inquires monitored state of a process information according to the monitored process title of configuration, and these status informations constitute execution result;Linux server will perform result and return monitoring system with tabular form.

Step S403, monitoring system obtains the cpu usage of monitored process, internal memory service condition, the numerical information of Thread Count from the results list returned.

Step S404, analytical data, and data are saved in chronological order this locality.

Step S405, sets up ordinate of orthogonal axes information according to the data that this locality preserves, and draws curve chart using the time as transverse axis coordinate information.

For CPU, the numerical curve of the different contents such as internal memory uses different colours as differentiation, and is shown on system interface, and the renewal frequency scalable that figure shows carrys out the fine degree of controlling curve figure according to different refresh interval.

For the ease of paired observation, a plurality of curve in same display interface, can be shown.

Step S406, if the data of the monitored process fetched by shell-command are empty data, it is determined that this monitored process performs to terminate, and automatically terminates the monitoring to this monitoring process;For other monitored processes, after waiting refresh interval duration, perform step S401.

The present invention is a kind of, and to monitor the system of resource in Linux server as described below, including:

Link block, for connecting the system to the Linux server being monitored.

Link block is further used for being connected in monitored Linux server by SSH.

Data acquisition module, for the data by performing shell-command acquirement necessary for monitoring in Linux server.

In embodiment one, data acquisition module is further used for being connected in described monitored Linux server by SSH and performs shell-command;The Linux server being monitored is returned and performs result to monitoring system;Resolve after receiving execution result and perform result, obtain the data of necessary for monitoring.

In embodiment two, data acquisition module is further used for being connected to the ps order performing shell-command in monitored Linux server by SSH;The title of the monitored process according to configuration, inquires monitored state of a process information, and these status informations composition performs result, and makes the Linux server being monitored return execution result to monitoring system;After receiving execution result, from execution result, parse monitored state of a process information.

Preserve module, for preserving the data of acquirement;

Chart generating module, for according to the data genaration monitoring pattern preserved or form.

In preferably embodiment, data acquisition module is further used for periodically carrying out shell-command with the refresh interval arranged in Linux server for the cycle, obtains the data of necessary for monitoring.Preserve module to be further used for, for each monitored process, preserving the status information of correspondence in chronological order.

The monitored state of a process information that chart generating module is further used for according to preserving sets up ordinate of orthogonal axes information, using the time as transverse axis coordinate information, draws the monitoring curve chart of monitored process.

Furthermore, it is possible to adjust the fine degree of monitoring curve chart by adjusting refresh interval.

Data acquisition module is additionally operable to after obtaining necessary for monitoring data, it is judged that performs the process that data in result are empty and performs to terminate, and terminates the monitoring to this process.

The foregoing is only presently preferred embodiments of the present invention, not in order to limit the present invention, all within the spirit and principles in the present invention, any amendment of making, equivalent replacement, improvement etc., should be included within the scope of protection of the invention.

Claims (6)

1. monitor the method for resource in Linux server for one kind, it is characterised in that just can be monitored without installing client software, including:
Step 1, monitoring system is connected in monitored Linux server by safety shell protocol SSH;
Step 2, monitoring system by performing to obtain in shell-command the data of the order acquirement necessary for monitoring of progress information in described Linux server;
Step 3, the data that monitoring system preservation obtains;
Step 4, monitoring system is according to the data genaration monitoring pattern preserved or form;
Described step 2 is further,
Monitoring system periodically carries out shell-command with the refresh interval arranged for the cycle in described Linux server, obtains the data of necessary for monitoring;
Described step 3 is further,
Step 51, monitoring system, for each monitored process, preserves the status information of correspondence in chronological order;
Described step 4 is further,
Step 61, the monitored state of a process information according to preserving sets up ordinate of orthogonal axes information, using the time as transverse axis coordinate information, draws the monitoring curve chart of monitored process.
2. the method for resource in monitoring Linux server according to claim 1, it is characterised in that described step 2 is further,
Step 31, monitoring system is connected in described monitored Linux server by safety shell protocol and performs shell-command;
Step 32, monitored Linux server returns and performs result to monitoring system;
Step 33, performs result described in monitoring system analysis, obtains the data of necessary for monitoring.
3. the method for resource in monitoring Linux server according to claim 2, it is characterised in that described step 2 is further,
Step 41, monitoring system is connected to the ps order performing shell-command in described monitored Linux server by safety shell protocol;
Step 42, the title according to the monitored process of configuration, inquire monitored state of a process information, described status information composition performs result, and monitored Linux server returns and performs result to monitoring system;
Step 43, monitoring system parses monitored state of a process information from execution result.
4. the method for resource in monitoring Linux server according to claim 1, it is characterised in that
Described method also includes:
Step 71, adjusts the fine degree of monitoring curve chart by adjusting refresh interval.
5. the method for resource in monitoring Linux server according to claim 1, it is characterised in that
Also include after described step 2:
Step 81, monitoring system judges that performing the process that data in result are empty performs to terminate, and terminates the monitoring to described process.
6. monitor the system of resource in Linux server for one kind, it is characterised in that just can be monitored without installing client software, including:
Link block, for being connected to monitored Linux server by system by safety shell protocol SSH;
Data acquisition module, for the data by performing shell-command acquirement necessary for monitoring in described Linux server;
Preserve module, for preserving the data of acquirement;
Chart generating module, for according to described data genaration monitoring pattern or form;Described data acquisition module is further used for periodically carrying out shell-command with the refresh interval arranged in described Linux server for the cycle, obtains the data of necessary for monitoring;
Described preservation module is further used for, for each monitored process, preserving the status information of correspondence in chronological order;
The monitored state of a process information that described chart generating module is further used for according to preserving sets up ordinate of orthogonal axes information, using the time as transverse axis coordinate information, draws the monitoring curve chart of monitored process.
CN201110288505.9A 2011-09-26 2011-09-26 A kind of monitor the method and system of resource in Linux server CN103019910B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110288505.9A CN103019910B (en) 2011-09-26 2011-09-26 A kind of monitor the method and system of resource in Linux server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110288505.9A CN103019910B (en) 2011-09-26 2011-09-26 A kind of monitor the method and system of resource in Linux server

Publications (2)

Publication Number Publication Date
CN103019910A CN103019910A (en) 2013-04-03
CN103019910B true CN103019910B (en) 2016-06-29

Family

ID=47968539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110288505.9A CN103019910B (en) 2011-09-26 2011-09-26 A kind of monitor the method and system of resource in Linux server

Country Status (1)

Country Link
CN (1) CN103019910B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104243230B (en) * 2013-06-24 2018-04-27 北京新媒传信科技有限公司 The method and apparatus of monitoring data in a kind of acquisition Linux server
CN103294584B (en) * 2013-06-24 2016-03-30 北京华胜天成科技股份有限公司 A computer display methods and apparatus for resource usage
CN104657273A (en) * 2015-03-05 2015-05-27 浪潮电子信息产业股份有限公司 Method for testing system resources occupied by software
CN105490870A (en) * 2015-11-20 2016-04-13 浪潮电子信息产业股份有限公司 Method for monitoring operation state of Linux server in batch
CN107341249A (en) * 2017-07-07 2017-11-10 北京奇艺世纪科技有限公司 The storage of server info and extracting method and system, extraction element
CN108566314A (en) * 2018-03-06 2018-09-21 平安科技(深圳)有限公司 The acquisition methods and storage medium of status information under electronic device, cluster environment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1428125B1 (en) * 2001-09-19 2010-11-03 Hewlett-Packard Company Monitoring in component-based systems at runtime
CN101986280A (en) * 2010-11-29 2011-03-16 浙江大学 Automatic testing platform for virtual computing system
CN102025536A (en) * 2010-11-25 2011-04-20 成都勤智数码科技有限公司 Method and device for collecting Unix/Linux system operation data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1428125B1 (en) * 2001-09-19 2010-11-03 Hewlett-Packard Company Monitoring in component-based systems at runtime
CN102025536A (en) * 2010-11-25 2011-04-20 成都勤智数码科技有限公司 Method and device for collecting Unix/Linux system operation data
CN101986280A (en) * 2010-11-29 2011-03-16 浙江大学 Automatic testing platform for virtual computing system

Also Published As

Publication number Publication date
CN103019910A (en) 2013-04-03

Similar Documents

Publication Publication Date Title
DE60116788T2 (en) Plc with integrated webserver
US8276115B2 (en) Automated construction and deployment of complex event processing applications and business activity monitoring dashboards
EP2439687A1 (en) System and method for cloud enterprise services
US20040032430A1 (en) System and method for generating user interfaces for different instrument types
JP2005174201A6 (en) Resource allocation system, method and program
US9270521B2 (en) Provisioning and managing a cluster deployed on a cloud
JP2010250689A (en) Performance monitoring system, bottleneck detection method, and management computer
US9015278B2 (en) Transaction correlation using three way handshake
US20070233838A1 (en) Method for workload management of plural servers
EP1750200A2 (en) System and method for executing job step, and computer product
US20140351394A1 (en) Reporting performance capabilities of a computer resource service
US20140277597A1 (en) System and method for managing industrial processes
Truong et al. SCALEA-G: A unified monitoring and performance analysis system for the grid
US20040045009A1 (en) Observation tool for signal processing components
EP1910924A2 (en) Methods and system for distributing data to technical computing workers
RU2428802C2 (en) Connection of networks with networks of various types via common user interface
US20050086645A1 (en) Methods and systems for control discovery in computing systems
CA2486103A1 (en) System and method for autonomic optimization of physical and virtual resource use in a data center
US20060200373A1 (en) Facilitating Root Cause Analysis for Abnormal Behavior of Systems in a Networked Environment
CN101834890B (en) Intelligent management system and method of distributed system
EP1416400B1 (en) System and method for providing data and services to devices over public networks, and device using said provided data and services
EP2053502A2 (en) Apparatus and methods to access information associated with a process control system
EP2098932A2 (en) Field instrument management apparatus
US6959264B2 (en) Autonomous computing probe agent
US7814123B2 (en) Management of component members using tag attributes

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant