CN109800131A - Monitor processing method, device, computer equipment and the storage medium of Linux server - Google Patents

Monitor processing method, device, computer equipment and the storage medium of Linux server Download PDF

Info

Publication number
CN109800131A
CN109800131A CN201811546633.7A CN201811546633A CN109800131A CN 109800131 A CN109800131 A CN 109800131A CN 201811546633 A CN201811546633 A CN 201811546633A CN 109800131 A CN109800131 A CN 109800131A
Authority
CN
China
Prior art keywords
resource
information
linux server
application program
cpu
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.)
Granted
Application number
CN201811546633.7A
Other languages
Chinese (zh)
Other versions
CN109800131B (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.)
Ping An Health Insurance Company of China Ltd
Original Assignee
Ping An Health Insurance Company of China 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 Ping An Health Insurance Company of China Ltd filed Critical Ping An Health Insurance Company of China Ltd
Priority to CN201811546633.7A priority Critical patent/CN109800131B/en
Publication of CN109800131A publication Critical patent/CN109800131A/en
Application granted granted Critical
Publication of CN109800131B publication Critical patent/CN109800131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

This application involves a kind of monitor processing method of Linux server, device, computer equipment and storage mediums.This method is by monitoring server when reaching monitoring condition, the resource using information of monitored Linux server is obtained from database, the resource content and process instruction of corresponding resource classification are searched according to resource using information, resource content and process instruction are sent to Linux server, by Linux server according to process instruction, predefined reduction resource is executed to resource content and uses processing.When due to using more than the upper limit in the resource for detecting Linux server, it is able to carry out predefined reduction resource and uses processing, it is used with reducing the resource of Linux server, is not necessarily to manual decision, the resource that can handle Linux server in time uses abnormal conditions.

Description

Monitor processing method, device, computer equipment and the storage medium of Linux server
Technical field
This application involves field of computer technology, monitor processing method, dress more particularly to a kind of Linux server It sets, computer equipment and storage medium.
Background technique
(SuSE) Linux OS has the advantages that high performance-price ratio and opens, therefore Linux server becomes many application services The preferred operating system platform of device.
For better maintenance system, prevent operating-system resources from exhausting, traditional method is by Linux server The middle resource service condition data for executing shell-command and obtaining necessary for monitoring.It is configured with the threshold value of different resource, when resource uses When situation reaches threshold value of warning, early warning mail is sent to administrator, administrator is notified to carry out decision.
This method needs to carry out decision by administrator, this results in reaching when the resource service condition of Linux server When early warning, it cannot handle in time.
Summary of the invention
Based on this, it is necessary to which in view of the above technical problems, providing one kind process resource can use abnormal Linux in time Monitor processing method, device, computer equipment and the storage medium of server.
A kind of monitor processing method of Linux server, which comprises
The resource using information of monitored Linux server is obtained from database;Wherein, the Linux server When reaching acquisition condition, acquires resource using information and be inserted into the table of database;
When judging that resource uses more than the upper limit according to the resource using information, searched according to the resource using information The resource content and process instruction of corresponding resource classification;
Send the resource content and the process instruction to the Linux server, by the Linux server according to The process instruction executes predefined reduction resource to the resource content and uses processing.
In another embodiment, the resource using information includes memory usage information or CPU use information;The money Source category includes memory or CPU;
The step of searching the resource content and process instruction of corresponding resource classification according to the resource using information, comprising:
According to memory usage information or CPU use information, the process for occupying most memories or most multi -CPU is determined;
It determines application program belonging to the process, obtains the application program for occupying most memories or most multi -CPU;
If the application program for occupying most memories or most multi -CPU is the application program of configuration, obtain with memory or The corresponding reset command of CPU;The reset command, which is used to indicate after the Linux server kills the application program, restarts institute State application program.
In another embodiment, if the application program for occupying most memories or most multi -CPU is the application program of non-configuration, Then obtain command for stopping corresponding with memory or CPU;The command for stopping is used to indicate described in the Linux server kill and answers Use program.
In another embodiment, the resource using information includes disc information;The resource class includes disk;
The step of searching the resource content and process instruction of corresponding resource classification according to the resource using information, comprising:
It is determined according to the disc information and occupies the most catalogue of disk;
The most journal file of disk is occupied according to the directory search;
Obtain log processing instruction corresponding with disk;The log processing instruction is used to indicate Linux server to institute It states journal file to be cut, and the journal file after cutting is managed, only retain newest log.
In another embodiment, the method also includes:
The disc information of Linux server after obtaining execution journal process instruction;
If the disc information according to treated, disk use then obtains flush instructions still above the upper limit, described to empty Instruction is used to indicate the Linux server and empties the journal file.
In another embodiment, Xiang Suoshu Linux server sends the resource content and the process instruction, by institute Linux server is stated according to the process instruction, predefined reduction resource is executed to the resource content and uses the step of processing After rapid, further includes:
It obtains after executing predefined reduction resource using processing, the more new resources service condition of the resource class;
If judging that resource use still above the upper limit, sends warning information according to the more new resources service condition.
In another embodiment, which comprises
The interface of the application program of the Linux server is called, interface call result is obtained;
The interface call result is compared with desired value;
If the interface call result of same interface and the inconsistent abnormal conditions of desired value reach configuration threshold value, send out Send warning information.
A kind of monitoring processing unit of Linux server, described device include:
Resource information obtains module, for obtaining the resource using information of monitored Linux server from database; Wherein, the Linux server acquires resource using information and is inserted into the table of database when reaching acquisition condition;
Searching module, for when judging that resource uses more than the upper limit according to the resource using information, according to the money The resource content and process instruction of source use information lookup corresponding resource classification;
Processing module, for sending the resource content and the process instruction to the Linux server, by described Linux server executes predefined reduction resource to the resource content and uses processing according to the process instruction.
A kind of computer equipment, including memory and processor, the memory are stored with computer program, the processing The step of device realizes the method for the various embodiments described above when executing the computer program.
A kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method of the various embodiments described above is realized when being executed by processor.
Monitor processing method, device, computer equipment and the storage medium of above-mentioned Linux server, by monitoring server When reaching monitoring condition, the resource using information of monitored Linux server is obtained from database, is used according to resource The resource content and process instruction of information searching corresponding resource classification send resource content and process instruction to Linux server, By Linux server according to process instruction, predefined reduction resource is executed to resource content and uses processing.Due to detecting When the resource of Linux server uses more than the upper limit, predefined reduction resource is able to carry out using processing, to reduce Linux The resource of server uses, and is not necessarily to manual decision, and the resource that can handle linux server in time uses abnormal conditions.
Detailed description of the invention
Fig. 1 is the application scenario diagram of the monitor processing method of Linux server in one embodiment;
Fig. 2 is the flow diagram of the monitor processing method of Linux server in one embodiment;
Fig. 3 is the structural block diagram of the monitoring processing unit of Linux server in one embodiment;
Fig. 4 is the internal structure chart of computer equipment in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, not For limiting the application.
The monitor processing method of Linux server provided by the present application can be applied to application environment as shown in Figure 1 In.Wherein, multiple Linux servers 102 are connected by network and database 104, and database 104 passes through network and monitoring service Device 106 connects.When Linux server 102 reaches acquisition condition, acquires resource using information and be inserted into the table of database.? When reaching monitoring condition, the resource that monitoring server 102 obtains monitored Linux server from database 104 uses letter Breath.When monitoring server 102 judges that resource using information is more than the upper limit, corresponding resource classification is searched according to resource using information Resource content and process instruction, send resource content and process instruction to Linux server, by Linux server according to Reason instruction executes predefined reduction resource to resource content and uses processing.Monitoring server 106 can use independent server The either server cluster of multiple servers composition is realized.
In one embodiment, as shown in Fig. 2, providing a kind of monitor processing method of Linux server, in this way Applied to being illustrated for the monitoring server in Fig. 1, comprising the following steps:
S202 obtains the resource using information of monitored Linux server from database;Wherein, Linux server When reaching acquisition condition, acquires resource using information and be inserted into the table of database.
Wherein, resource includes the memory, CPU, disk of Linux server, thread, the information such as access interface.Linux service Device is provided with acquisition condition, when reaching acquisition condition, acquires resource using information, and be inserted into the table of database.Wherein, it adopts Collection condition can be set to time conditions, such as acquire resource service condition at regular intervals or in the set time.Pick-up slip The trigger mechanism that part can also pre-set.For example, detect application program launching, detect application program task executing Etc..The resource service condition of acquisition is stored in database.
Specifically, libsigar-amd64-linux.so file is placed in monitored Linux server, acquisition The information of acquisition is inserted into the table of database by the cpu of Linux server, memory, storage, the information such as thread, and record is each The resource service condition of acquisition time, time point can be configured, for example every 5 minutes are acquired.
Monitoring server is responsible for monitoring the resource service condition of each Linux server.Specifically, monitoring server monitoring is every The resource service condition of a time point each Linux server, time point can be configured, for example every 10 minutes are monitored.
S204, when judging that resource uses more than the upper limit according to resource using information, according to resource using information lookup pair Answer the resource content and process instruction of resource class.
The upper limit refers to that pre-set resource maximum uses threshold value, wherein for different resource class, according to resources-type The upper limit of each resource class is respectively set in other significance level.Wherein, the resource class of Linux server includes CPU, memory, Disk and network etc..Resource class for evaluating resource using information can be according to circumstances arranged.Commonly resource class includes CPU, memory and disk.
Resource content refers to that Linux server occupies the application program or file of the resource, resource content and resource class It is corresponding.By taking resource class is CPU or memory as an example, resource content is the application program for occupying the memory or CPU of resource, with resource Classification is for disk, resource content is the file for occupying disk, and by taking resource class is network as an example, resource content is to occupy net The application program of network.
Process instruction is corresponding with resource class, and for different occupancy resources, process instruction is different, process instruction for pair Resource content, which executes, reduces resource using processing, to reduce the resource service condition of Linux server.For example, being accounted for for memory With the application program for being more than the upper limit, process instruction can be termination application program.In another example occupying over the upper limit for disk Application program, process instruction can be to empty certain journal files etc..
S206 sends resource content and process instruction to Linux server, right by Linux server according to process instruction Resource content executes predefined reduction resource and uses processing.
Resource is reduced to refer to using the mode of processing to resource content execution predefined processing side corresponding with process instruction Formula, so that the resource of Linux server uses reduction.For example, application program occupy most resources be CPU or memory when, then Process instruction is instruction of restarting, and reducing resource using processing is reboot process.In another example application program occupies most resources is It when disk, instructs and is instructed for log processing, reducing resource using processing is log cutting, empties and only retains newest log.
The monitor processing method of above-mentioned Linux server, by monitoring server when reaching monitoring condition, from database The middle resource using information for obtaining monitored Linux server, the money of corresponding resource classification is searched according to resource using information Source contents and process instruction send resource content and process instruction to Linux server, are referred to by Linux server according to processing It enables, predefined reduction resource is executed to resource content and uses processing.It is super due to being used in the resource for detecting Linux server When crossing the upper limit, predefined reduction resource is able to carry out using processing, is used with reducing the resource of Linux server, is not necessarily to people Work decision can handle the resource of linux server using abnormal conditions in time, further reduce because of Linux server The problem of resource leads to application failure by excessive occupancy.
In another embodiment, resource using information includes memory usage information or CPU use information.Memory uses letter Breath refers to the service condition of memory, the memory size that each application program including the operation of current Linux server occupies, and works as Memory shared by whole application programs of preceding Linux server operation uses accounting.Wherein, memory shared by whole application programs It the use of accounting is the ratio between each application program committed memory capacity and total memory size.CPU use information refers to the use feelings of CPU Condition, the CPU accounting that each application program including the operation of current Linux server occupies, and current Linux server operation CPU accounting shared by whole application programs.Resource class includes memory or CPU.
The step of searching the resource content and process instruction of corresponding resource classification according to resource using information, comprising: according to Memory usage information or CPU use information determine the process for occupying most memories or most multi -CPU, determine application belonging to process Program obtains the application program for occupying most memories or most multi -CPU, if the application program for occupying most memories or most multi -CPU is The application program of configuration then obtains reset command corresponding with memory or CPU;Reset command is used to indicate Linux server and kills Re-launching applications after dead application program.
The application program for occupying most memories or most multi -CPU refers in Linux server that is currently run is each using journey In sequence, the most memories of resource or the application program of CPU are occupied.For example, operation has application program A in a Linux server, Application program B and application program C, the EMS memory occupation of three application programs exceed the upper limit, triggering monitoring.Wherein, application program A is accounted for Memory is greater than the memory that application program B and application program C is occupied, then application program A is the application journey for occupying most memories Sequence.
The application program of configuration refers to the application-specific for being previously deployed at and running in Linux server, as Linux takes The operating system platform of business device runs essential operation program.
When CPU uses more than the upper limit, according to CPU use information, finds and occupy the process of most multi -CPU most, if this Process is to facilitate technical staff to check reason in the application process of deployment, then record thread stack information to log and table.Simultaneously By the predefined processing Rule corresponding reset command of process title come re-launching applications.Wherein, predefined Processing rule stores process title and reset command existing for each Linux server, occupies most when being determined according to memory information The application program of multi -CPU is the application of configuration, kills process, is restarted according to the predefined processing Rule process is corresponding Order, re-launching applications.
When EMS memory occupation is more than the upper limit, according to memory usage information, the highest process of committed memory is found, if this Process is to facilitate technical staff to check reason in the application process of deployment, then record thread stack information to log and table.Simultaneously By the predefined processing Rule corresponding reset command of process title come re-launching applications.Wherein, predefined Processing rule stores process title and reset command existing for each Linux server, occupies most when being determined according to memory information The application program of multi -CPU is the application of configuration, kills process, is restarted according to the predefined processing Rule process is corresponding Order, re-launching applications.
If the application program for occupying most resources is the application program of non-configuration, end corresponding with memory or CPU is obtained It only instructs, command for stopping is used to indicate Linux server and kills application program, to the letter of Linux server sending application program Breath and command for stopping execute predefined termination to application program by Linux server according to process instruction, to reduce The resource of Linux server uses.
The monitor processing method of above-mentioned Linux server, according to memory usage information or CPU use information, in resource When using more than the upper limit, reboot process or termination are carried out to application program, used with reducing the resource of Linux server.
In another embodiment, resource using information includes disc information, and disk refers to Linux for storing information The service condition of disk in server.Resource class includes disk.
The step of searching the resource content and process instruction of corresponding resource classification according to resource using information, comprising: according to Disc information, which determines, occupies the most catalogue of disk, occupies the most journal file of disk, acquisition and disk according to directory search Corresponding log processing instruction;Log processing instruction is used to indicate Linux server and cuts to journal file, and to cutting Journal file afterwards is managed, and only retains newest log.
Specifically, it when the disk storage of server is more than threshold value, finds disk and occupies maximum catalogue, then level-one one Grade directory search uses maximum file, finds and occupies the most journal file of disk.Process instruction corresponding with disk is Log processing instruction and journal file are sent to Linux server, by Linux server to log text by log processing instruction Part is cut, the journal file after deleting other cuttings in addition to newest journal file only retains newest log.
Further, the monitor processing method of the Linux server further include: after obtaining execution journal process instruction The disc information of Linux server, if disk use then obtains still above the upper limit and empties finger according to treated disc information It enables, flush instructions are used to indicate Linux server Clear Log file.Specifically, after log is cut and is cleared up, if disk makes With still above the upper limit, then Clear Log file.Specifically, using order echo " " > ./log, file is emptied.
The monitor processing method of above-mentioned Linux server uses more than the upper limit in resource according to disk use information When, journal file is cut and is cleared up, is used with reducing the resource of Linux server.
In another embodiment, resource content and process instruction are sent to Linux server, by Linux server root According to process instruction, predefined reductions resource is executed using after the step of processing to resource content, further includes: obtain and execute in advance After the reduction resource of definition is using processing, the more new resources service condition of resource class, if being sentenced according to more new resources service condition Resource use break still above the upper limit, then sends warning information.
Specifically, if after performing predefined reduction resource using processing, the use of memory, disk or CPU is still super The upper limit is crossed, then sends early warning information to preset staff.The mode for sending early warning information includes but is not limited to: to configuration Email address sends warning information;Warning information is sent to the phone number of configuration;It is sent to the instant messaging account of configuration pre- Alert information.
In another embodiment, the monitor processing method of Linux server is also used to the interface to Linux server It is monitored, to detect interface abnormal case in time.Specifically, comprising: call connecing for the application program of Linux server Mouthful, obtain interface call result, interface call result is compared with desired value, if the interface call result of same interface and The inconsistent abnormal conditions of desired value reach configuration threshold value, then send warning information.
Specifically, monitoring server can be used http mode and call monitored interface, and post or get request is sent to The monitored interface of Linux server obtains the interface call result that interface returns, compares whether the interface call result meets Desired value.Desired value refers to that interface calls the actual value that should be returned, may if desired value and interface call result are inconsistent There are interface exceptions.Wherein, interface monitoring can be carried out periodically.If calling interface result is not desired value, it is possible to because of processing Caused by other problems or unstable networks, rather than it is genuine abnormal.In the present embodiment, to reject false abnormal conditions, if The configuration threshold value set, the configuration threshold value are used for according to the numbers of inconsistent abnormal conditions, judge whether manually it is abnormal to interface into Row processing.It is adjustable to configure threshold value.In a kind of embodiment, configuration threshold value is set as 3 times, if interface call result and desired value Inconsistent abnormal conditions reach more than 3 times (such case is particularly likely that caused by program bug), then send mail to phase Pass personnel remind related personnel's processing.
The monitor processing method of the Linux server, additionally it is possible to Linux server interface abnormal conditions are monitored, And when monitoring interface abnormal conditions, handled by related personnel.
In another embodiment, the monitor processing method of Linux server further include: monitoring Linux server resource Use information uses distribution situation from default dimensional analysis resource according to resource using information.
Specifically, in the set time, such as 8 points of every morning, monitoring server converges the resource using information of yesterday Always, include that every monitoring machine resources are averaged service condition, peak service condition and time point, be more than threshold number and place Manage number, resource situation before processing and treated information such as resource situation.And to resource service condition from preset to degree point The distribution situation that analysis resource uses, the resource including every Linux server use rush hour and low ebb time, analyze flow The time point of distribution.
In another embodiment, the monitor processing method of Linux server further includes using distribution situation according to resource It obtains resource and uses slack hours using rush hour and resource;Slack hours tune is used using rush hour and resource for resource Whole threshold value.
Threshold value includes the configuration threshold value of interface, the upper limit threshold etc. that resource uses in the present embodiment.By by threshold value according to Resource is adjusted using rush hour and resource using slack hours, for example, the meeting when the time point for using peak to resource Threshold value is automatically updated, keeps threshold value higher, when the time point for using ebb in resource, then threshold value is reduced, so as to neatly The resource of Linux server is handled using abnormal, avoids Linux server weight bearing excessive.
It should be understood that although each step in the flow chart of Fig. 2 is successively shown according to the instruction of arrow, this A little steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly state otherwise herein, these steps It executes there is no the limitation of stringent sequence, these steps can execute in other order.Moreover, at least part in Fig. 2 Step may include that perhaps these sub-steps of multiple stages or stage are executed in synchronization to multiple sub-steps It completes, but can execute at different times, the execution sequence in these sub-steps or stage, which is also not necessarily, successively to be carried out, But it can be executed in turn or alternately at least part of the sub-step or stage of other steps or other steps.
In one embodiment, as shown in figure 3, providing a kind of monitoring processing unit of Linux server, comprising: money Source information obtains module, searching module and processing module, in which:
Resource information obtains module 302, and the resource for obtaining monitored Linux server from database uses letter Breath;Wherein, Linux server acquires resource using information and is inserted into the table of database when reaching acquisition condition.
Searching module 304, for being used according to resource when judging that resource uses more than the upper limit according to resource using information The resource content and process instruction of information searching corresponding resource classification;
Processing module 306, for sending resource content and process instruction to Linux server, by Linux server according to Process instruction executes predefined reduction resource to resource content and uses processing.
The monitoring processing unit of above-mentioned Linux server, by monitoring server when reaching monitoring condition, from database The middle resource using information for obtaining monitored Linux server, the money of corresponding resource classification is searched according to resource using information Source contents and process instruction send resource content and process instruction to Linux server, are referred to by Linux server according to processing It enables, predefined reduction resource is executed to resource content and uses processing.It is super due to being used in the resource for detecting Linux server When crossing the upper limit, predefined reduction resource is able to carry out using processing, is used with reducing the resource of Linux server, is not necessarily to people Work decision, the resource that can handle Linux server in time use abnormal conditions.
In another embodiment, resource using information includes memory usage information or CPU use information;Resource class packet Include memory or CPU;
Searching module includes:
Process obtains module, for determining and occupying most memories or most according to memory usage information or CPU use information The process of CPU.
Application program determining module obtains occupying most memories or most multi -CPU for determining application program belonging to process Application program.
Matching module is searched, if the application program for occupying most memories or most multi -CPU is the application program of configuration, Obtain reset command corresponding with memory or CPU;Reset command, which is used to indicate after Linux server kills application program, restarts and answers Use program.
In another embodiment, matching module is searched, if being also used to occupy the application program of most memories or most multi -CPU For the application program of non-configuration, then command for stopping corresponding with memory or CPU is obtained;Command for stopping is used to indicate Linux service Device kills application program.
In another embodiment, resource using information includes disc information;Resource class includes disk;
Searching module includes:
Catalogue obtains module, occupies the most catalogue of disk for determining according to disc information.
File acquisition module, for occupying the most journal file of disk according to directory search;
Processing module is searched, for obtaining log processing instruction corresponding with disk;Log processing instruction is used to indicate Linux server cuts journal file, and is managed to the journal file after cutting, only retains newest log.
In another embodiment, resource information obtains module, the Linux after being also used to obtain execution journal process instruction The disc information of server.
Searching module, if being also used to according to treated disc information, disk use then obtains still above the upper limit and empties finger It enables, flush instructions are used to indicate the Linux server and empty the journal file.
In another embodiment, resource information obtains module, is also used to obtain the predefined reduction resource of execution and uses After processing, the more new resources service condition of resource class.
Processing module, if being also used to be judged according to more new resources service condition, resource use still above the upper limit, is sent pre- Alert information.
In another embodiment, the monitoring processing unit of Linux server further include:
Interface calling module, the interface of the application program for calling Linux server obtain interface call result.
Comparison module, for interface call result to be compared with desired value.
Processing module is matched if the interface call result for being also used to same interface abnormal conditions inconsistent with desired value reach Threshold value is set, then sends warning information.
The specific restriction of monitoring processing unit about Linux server may refer to above for Linux server Monitor processing method restriction, details are not described herein.Modules in the monitoring processing unit of above-mentioned Linux server can It is realized fully or partially through software, hardware and combinations thereof.Above-mentioned each module can be embedded in the form of hardware or independently of meter It calculates in the processor in machine equipment, can also be stored in a software form in the memory in computer equipment, in order to handle Device, which calls, executes the corresponding operation of the above modules.
In one embodiment, a kind of computer equipment is provided, which can be server, internal junction Composition can be as shown in Figure 3.The computer equipment includes processor, memory and the network interface connected by system bus. Wherein, the processor of the computer equipment is for providing calculating and control ability.The memory of the computer equipment includes non-easy The property lost storage medium, built-in storage.The non-volatile memory medium is stored with operating system, computer program and database.It should Built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The computer equipment Network interface be used to communicate with external terminal by network connection.To realize one when the computer program is executed by processor The monitor processing method of kind Linux server.
It will be understood by those skilled in the art that structure shown in Fig. 3, only part relevant to application scheme is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including memory and processor are provided, which is stored with Computer program, the processor perform the steps of when executing computer program
The resource using information of monitored Linux server is obtained from database;Wherein, Linux server is reaching When to acquisition condition, acquisition resource using information is simultaneously inserted into the table of database;
When judging that resource uses more than the upper limit according to resource using information, corresponding resource is searched according to resource using information The resource content and process instruction of classification;
Resource content and process instruction are sent to Linux server, by Linux server according to process instruction, to resource Content executes predefined reduction resource and uses processing.
In another embodiment, resource using information includes memory usage information or CPU use information;Resource class packet Include memory or CPU;
The step of searching the resource content and process instruction of corresponding resource classification according to resource using information, comprising:
According to memory usage information or CPU use information, the process for occupying most memories or most multi -CPU is determined;
It determines application program belonging to process, obtains the application program for occupying most memories or most multi -CPU;
If the application program for occupying most memories or most multi -CPU is the application program configured, obtain and memory or CPU pairs The reset command answered;Reset command is used to indicate Linux server and kills re-launching applications after application program.
In another embodiment, if the application program for occupying most memories or most multi -CPU is the application program of non-configuration, Then obtain command for stopping corresponding with memory or CPU;Command for stopping is used to indicate Linux server and kills application program.
In another embodiment, resource using information includes disc information;Resource class includes disk;
The step of searching the resource content and process instruction of corresponding resource classification according to resource using information, comprising:
It is determined according to disc information and occupies the most catalogue of disk;
The most journal file of disk is occupied according to directory search;
Obtain log processing instruction corresponding with disk;Log processing instruction is used to indicate Linux server to log text Part is cut, and is managed to the journal file after cutting, and newest log is only retained.
In another embodiment, it is also performed the steps of when processor executes computer program
The disc information of Linux server after obtaining execution journal process instruction;
If disk use then obtains flush instructions still above the upper limit, and flush instructions are used for according to treated disc information Indicate Linux server Clear Log file.
In another embodiment, resource content and process instruction are sent to Linux server, by Linux server root According to process instruction, predefined reductions resource is executed using after the step of processing to resource content, further includes:
It obtains after executing predefined reduction resource using processing, the more new resources service condition of resource class;
If judging that resource use still above the upper limit, sends warning information according to more new resources service condition.
In one embodiment, it is also performed the steps of when processor executes computer program
The interface of the application program of Linux server is called, interface call result is obtained;
Interface call result is compared with desired value;
If the interface call result of same interface and the inconsistent abnormal conditions of desired value reach configuration threshold value, send pre- Alert information.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
The resource using information of monitored Linux server is obtained from database;Wherein, Linux server is reaching When to acquisition condition, acquisition resource using information is simultaneously inserted into the table of database;
When judging that resource uses more than the upper limit according to resource using information, corresponding resource is searched according to resource using information The resource content and process instruction of classification;
Resource content and process instruction are sent to Linux server, by Linux server according to process instruction, to resource Content executes predefined reduction resource and uses processing.
In another embodiment, resource using information includes memory usage information or CPU use information;Resource class packet Include memory or CPU;
The step of searching the resource content and process instruction of corresponding resource classification according to resource using information, comprising:
According to memory usage information or CPU use information, the process for occupying most memories or most multi -CPU is determined;
It determines application program belonging to process, obtains the application program for occupying most memories or most multi -CPU;
If the application program for occupying most memories or most multi -CPU is the application program configured, obtain and memory or CPU pairs The reset command answered;Reset command is used to indicate Linux server and kills re-launching applications after application program.
In another embodiment, if the application program for occupying most memories or most multi -CPU is the application program of non-configuration, Then obtain command for stopping corresponding with memory or CPU;Command for stopping is used to indicate Linux server and kills application program.
In another embodiment, resource using information includes disc information;Resource class includes disk;
The step of searching the resource content and process instruction of corresponding resource classification according to resource using information, comprising:
It is determined according to disc information and occupies the most catalogue of disk;
The most journal file of disk is occupied according to directory search;
Obtain log processing instruction corresponding with disk;Log processing instruction is used to indicate Linux server to log text Part is cut, and is managed to the journal file after cutting, and newest log is only retained.
In another embodiment, it is also performed the steps of when processor executes computer program
The disc information of Linux server after obtaining execution journal process instruction;
If disk use then obtains flush instructions still above the upper limit, and flush instructions are used for according to treated disc information Indicate Linux server Clear Log file.
In another embodiment, resource content and process instruction are sent to Linux server, by Linux server root According to process instruction, predefined reductions resource is executed using after the step of processing to resource content, further includes:
It obtains after executing predefined reduction resource using processing, the more new resources service condition of resource class;
If judging that resource use still above the upper limit, sends warning information according to more new resources service condition.
In one embodiment, it is also performed the steps of when processor executes computer program
The interface of the application program of Linux server is called, interface call result is obtained;
Interface call result is compared with desired value;
If the interface call result of same interface and the inconsistent abnormal conditions of desired value reach configuration threshold value, send pre- Alert information.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (10)

1. a kind of monitor processing method of Linux server, which comprises
The resource using information of monitored Linux server is obtained from database;Wherein, the Linux server is reaching When to acquisition condition, acquisition resource using information is simultaneously inserted into the table of database;
When judging that resource uses more than the upper limit according to the resource using information, is searched and corresponded to according to the resource using information The resource content and process instruction of resource class;
The resource content and the process instruction are sent to the Linux server, as the Linux server according to Process instruction executes predefined reduction resource to the resource content and uses processing.
2. the method according to claim 1, wherein the resource using information include memory usage information or CPU use information;The resource class includes memory or CPU;
The step of searching the resource content and process instruction of corresponding resource classification according to the resource using information, comprising:
According to memory usage information or CPU use information, the process for occupying most memories or most multi -CPU is determined;
It determines application program belonging to the process, obtains the application program for occupying most memories or most multi -CPU;
If the application program for occupying most memories or most multi -CPU is the application program configured, obtain and memory or CPU pairs The reset command answered;The reset command, which is used to indicate after the Linux server kills the application program, restarts described answer Use program.
3. according to the method described in claim 2, it is characterized in that, if the application program for occupying most memories or most multi -CPU is The application program of non-configuration then obtains command for stopping corresponding with memory or CPU;The command for stopping is used to indicate described Linux server kills the application program.
4. the method according to claim 1, wherein the resource using information includes disc information;The money Source category includes disk;
The step of searching the resource content and process instruction of corresponding resource classification according to the resource using information, comprising:
It is determined according to the disc information and occupies the most catalogue of disk;
The most journal file of disk is occupied according to the directory search;
Obtain log processing instruction corresponding with disk;The log processing instruction is used to indicate Linux server to the day Will file is cut, and is managed to the journal file after cutting, and newest log is only retained.
5. according to the method described in claim 4, it is characterized in that, the method also includes:
The disc information of Linux server after obtaining execution journal process instruction;
If the disc information according to treated, disk use then obtains flush instructions, the flush instructions still above the upper limit It is used to indicate the Linux server and empties the journal file.
6. the method according to claim 1, wherein to the Linux server send the resource content and The process instruction executes predefined reduction to the resource content by the Linux server according to the process instruction Resource used after the step of processing, further includes:
It obtains after executing predefined reduction resource using processing, the more new resources service condition of the resource class;
If judging that resource use still above the upper limit, sends warning information according to the more new resources service condition.
7. the method according to claim 1, wherein the described method includes:
The interface of the application program of the Linux server is called, interface call result is obtained;
The interface call result is compared with desired value;
If the interface call result of same interface and the inconsistent abnormal conditions of desired value reach configuration threshold value, send pre- Alert information.
8. a kind of monitoring processing unit of Linux server, which is characterized in that described device includes:
Resource information obtains module, for obtaining the resource using information of monitored Linux server from database;Its In, the Linux server acquires resource using information and is inserted into the table of database when reaching acquisition condition;
Searching module, for being made according to the resource when judging that resource uses more than the upper limit according to the resource using information With the resource content and process instruction of information searching corresponding resource classification;
Processing module, for sending the resource content and the process instruction to the Linux server, by the Linux Server executes predefined reduction resource to the resource content and uses processing according to the process instruction.
9. a kind of computer equipment, including memory and processor, the memory are stored with computer program, feature exists In the step of processor realizes any one of claims 1 to 7 the method when executing the computer program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program The step of method described in any one of claims 1 to 7 is realized when being executed by processor.
CN201811546633.7A 2018-12-18 2018-12-18 Monitoring processing method and device of Linux server, computer equipment and storage medium Active CN109800131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811546633.7A CN109800131B (en) 2018-12-18 2018-12-18 Monitoring processing method and device of Linux server, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811546633.7A CN109800131B (en) 2018-12-18 2018-12-18 Monitoring processing method and device of Linux server, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109800131A true CN109800131A (en) 2019-05-24
CN109800131B CN109800131B (en) 2024-04-05

Family

ID=66556945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811546633.7A Active CN109800131B (en) 2018-12-18 2018-12-18 Monitoring processing method and device of Linux server, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109800131B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124820A (en) * 2019-12-13 2020-05-08 郑州威科姆科技股份有限公司 Method for realizing off-line monitoring and analysis of operating system and process resources
CN111427704A (en) * 2020-03-13 2020-07-17 平安科技(深圳)有限公司 Remote monitoring method, device and equipment for configuration instruction and storage medium
CN112084094A (en) * 2020-09-16 2020-12-15 北京自如信息科技有限公司 Multi-server resource monitoring method and device and computer equipment
CN112165450A (en) * 2020-08-27 2021-01-01 杭州安恒信息技术股份有限公司 Safety protection method and device for WEB application firewall and electronic device
CN113253657A (en) * 2021-06-02 2021-08-13 扬州希华数字科技有限公司 Data control system
CN113568822A (en) * 2021-08-03 2021-10-29 安天科技集团股份有限公司 Business resource monitoring method and device, computing equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473164A (en) * 2013-09-25 2013-12-25 浪潮电子信息产业股份有限公司 Monitoring and early-warning method for linux server
CN106815363A (en) * 2017-01-24 2017-06-09 郑州云海信息技术有限公司 One kind rotates management method and device based on linux daily records
CN106874366A (en) * 2016-12-30 2017-06-20 腾讯科技(深圳)有限公司 The processing method and processing device of software information
CN108388503A (en) * 2018-02-13 2018-08-10 中体彩科技发展有限公司 Data-base performance monitoring method, system, equipment and computer readable storage medium
CN108874618A (en) * 2018-05-04 2018-11-23 平安科技(深圳)有限公司 Monitoring method, device, computer equipment and the storage medium of Cognos process
CN108874546A (en) * 2018-06-26 2018-11-23 郑州云海信息技术有限公司 A kind of system and method that linux optimization resource uses

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473164A (en) * 2013-09-25 2013-12-25 浪潮电子信息产业股份有限公司 Monitoring and early-warning method for linux server
CN106874366A (en) * 2016-12-30 2017-06-20 腾讯科技(深圳)有限公司 The processing method and processing device of software information
WO2018121442A1 (en) * 2016-12-30 2018-07-05 腾讯科技(深圳)有限公司 Method and device for processing software information, storage medium, and electronic device
CN106815363A (en) * 2017-01-24 2017-06-09 郑州云海信息技术有限公司 One kind rotates management method and device based on linux daily records
CN108388503A (en) * 2018-02-13 2018-08-10 中体彩科技发展有限公司 Data-base performance monitoring method, system, equipment and computer readable storage medium
CN108874618A (en) * 2018-05-04 2018-11-23 平安科技(深圳)有限公司 Monitoring method, device, computer equipment and the storage medium of Cognos process
CN108874546A (en) * 2018-06-26 2018-11-23 郑州云海信息技术有限公司 A kind of system and method that linux optimization resource uses

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124820A (en) * 2019-12-13 2020-05-08 郑州威科姆科技股份有限公司 Method for realizing off-line monitoring and analysis of operating system and process resources
CN111124820B (en) * 2019-12-13 2023-12-22 郑州威科姆科技股份有限公司 Method for realizing off-line monitoring and analysis of operating system and process resources
CN111427704A (en) * 2020-03-13 2020-07-17 平安科技(深圳)有限公司 Remote monitoring method, device and equipment for configuration instruction and storage medium
CN111427704B (en) * 2020-03-13 2024-05-28 平安科技(深圳)有限公司 Remote monitoring method, device, equipment and storage medium for configuration instruction
CN112165450A (en) * 2020-08-27 2021-01-01 杭州安恒信息技术股份有限公司 Safety protection method and device for WEB application firewall and electronic device
CN112165450B (en) * 2020-08-27 2023-04-21 杭州安恒信息技术股份有限公司 Security protection method and device for WEB application firewall and electronic device
CN112084094A (en) * 2020-09-16 2020-12-15 北京自如信息科技有限公司 Multi-server resource monitoring method and device and computer equipment
CN113253657A (en) * 2021-06-02 2021-08-13 扬州希华数字科技有限公司 Data control system
CN113568822A (en) * 2021-08-03 2021-10-29 安天科技集团股份有限公司 Business resource monitoring method and device, computing equipment and storage medium
CN113568822B (en) * 2021-08-03 2023-09-05 安天科技集团股份有限公司 Service resource monitoring method, device, computing equipment and storage medium

Also Published As

Publication number Publication date
CN109800131B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN109800131A (en) Monitor processing method, device, computer equipment and the storage medium of Linux server
CN111212391B (en) Short message pushing method, device, equipment and readable medium
CN113051075A (en) Kubernetes intelligent capacity expansion method and device
JP7369706B2 (en) Automatic database query load evaluation and adaptive processing
CN110007978A (en) A kind of method, device and equipment preloading the page
CN108628740A (en) A kind of filec descriptor leakage detection method and device
EP1604275B1 (en) Method for managing the triggering of an application in a service terminal, particularly in a telecommunication terminal
CN111209110A (en) Task scheduling management method, system and storage medium for realizing load balance
US10642585B1 (en) Enhancing API service schemes
CN113760652B (en) Method, system, device and storage medium for full link monitoring based on application
CN107977296A (en) A kind of method, apparatus and medium of NAS storage system performance test
CN112612618A (en) Interface current limiting method and device, computer equipment and storage medium
CN106936688A (en) Notice sending method and device
CN112003895B (en) Cloud host evacuation method, device, equipment and storage medium in OpenStack cloud platform
CN110674149B (en) Service data processing method and device, computer equipment and storage medium
CN114884840A (en) Application health state checking method and electronic equipment
CN109271381A (en) Processing method, device, computer equipment and the storage medium of test data table
CN109960658B (en) Application programming interface testing method and device, electronic equipment and storage medium
CN102385536A (en) Method and system for realization of parallel computing
CN114257550A (en) Automatic control method and device for interface access flow, storage medium and server
EP3945420A1 (en) Method and apparatus for data processing, server and storage medium
CN112702437B (en) Real-time automatic adjustment method for link data sampling rate
CN112235471B (en) Call center work order processing method and device, computer equipment and storage medium
CN113608838A (en) Deployment method and device of application image file, computer equipment and storage medium
CN111309442B (en) Method, device, system, medium and equipment for adjusting number of micro-service containers

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