CN117076185A - Server inspection method, device, equipment and medium - Google Patents

Server inspection method, device, equipment and medium Download PDF

Info

Publication number
CN117076185A
CN117076185A CN202311330444.7A CN202311330444A CN117076185A CN 117076185 A CN117076185 A CN 117076185A CN 202311330444 A CN202311330444 A CN 202311330444A CN 117076185 A CN117076185 A CN 117076185A
Authority
CN
China
Prior art keywords
server
candidate
inspection
servers
determining
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
CN202311330444.7A
Other languages
Chinese (zh)
Other versions
CN117076185B (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.)
Taiping Finance Technology Services Shanghai Co ltd
Original Assignee
Taiping Finance Technology Services Shanghai 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 Taiping Finance Technology Services Shanghai Co ltd filed Critical Taiping Finance Technology Services Shanghai Co ltd
Priority to CN202311330444.7A priority Critical patent/CN117076185B/en
Publication of CN117076185A publication Critical patent/CN117076185A/en
Application granted granted Critical
Publication of CN117076185B publication Critical patent/CN117076185B/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/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0709Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a distributed system consisting of a plurality of standalone computer nodes, e.g. clusters, client-server systems

Abstract

The invention discloses a server inspection method, a device, equipment and a medium, and relates to the technical field of server inspection. The method comprises the following steps: determining the type of a server to which the candidate server belongs in the machine room, and generating a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; if the candidate server is the main server, locally executing the candidate inspection script to obtain an inspection result; the method comprises the steps that a main server determines according to service access quantity, memory idle quantity and load rate of a candidate server in each candidate historical time period; and if the candidate server is the slave server, sending the candidate inspection script to the candidate server for execution to obtain an inspection result. According to the technical scheme provided by the embodiment of the invention, the main server is determined from the candidate servers in the machine room, and the main server is used for carrying out inspection on the candidate servers according to the candidate inspection script, so that the inspection efficiency of each candidate server in the machine room is improved.

Description

Server inspection method, device, equipment and medium
Technical Field
The present invention relates to the field of server inspection technologies, and in particular, to a method, an apparatus, a device, and a medium for server inspection.
Background
With the continuous expansion of service scale, service systems are becoming increasingly large, and are required to be deployed in multiple rooms, where a certain number of servers are deployed in each room. In order to ensure the normal and stable operation of the service system, the servers in each machine room need to be inspected. In the prior art, a method of deploying proxy service on each server in a machine room is mainly adopted to carry out inspection on each server in the machine room. According to the technical scheme, the defect of low inspection efficiency of the server exists.
Disclosure of Invention
The invention provides a method, a device, equipment and a medium for inspecting a server, which are used for improving the inspection efficiency of the server.
In a first aspect, the present invention provides a server inspection method, which is executed by a main server in a machine room, and the method includes:
determining the type of a server to which the candidate server belongs in the machine room, and generating a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification;
if the candidate server is the main server, locally executing the candidate inspection script to obtain an inspection result; the method comprises the steps that a main server determines according to service access quantity, memory idle quantity and load rate of a candidate server in each candidate historical time period;
And if the candidate server is the slave server, sending the candidate inspection script to the candidate server for execution to obtain an inspection result.
In a second aspect, the present invention further provides a server inspection device, configured as a main server in a machine room, where the device includes:
the inspection script determining module is used for determining the type of the server to which the candidate server in the machine room belongs and generating a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification;
the first result determining module is used for locally executing the candidate inspection script if the candidate server is a main server to obtain an inspection result; the main server determines according to the service access amount, the memory idle amount and the load rate of the candidate server in each candidate historical time period;
and the second result determining module is used for sending the candidate inspection script to the candidate server for execution if the candidate server is a slave server, so as to obtain an inspection result.
In a third aspect, the present invention provides an electronic device, comprising:
at least one processor; and
A memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the server patrol method of any one of the embodiments of the present invention.
In a fourth aspect, the present invention also provides a computer readable storage medium storing computer instructions for causing a processor to execute the server inspection method according to any one of the embodiments of the present invention.
The embodiment of the invention determines the type of the server to which the candidate server in the machine room belongs, and generates a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification; if the candidate server is the main server, locally executing the candidate inspection script to obtain an inspection result; the method comprises the steps that a main server determines according to service access quantity, memory idle quantity and load rate of a candidate server in each candidate historical time period; and if the candidate server is the slave server, sending the candidate inspection script to the candidate server for execution to obtain an inspection result. According to the technical scheme of the embodiment of the invention, according to the service access quantity, the memory idle quantity and the load rate of each candidate server in the machine room, the candidate server with relatively idle performance and relatively good performance is selected from the candidate servers in the machine room to serve as the main server of the machine room, so that the operation efficiency of the main server is improved; the main server performs inspection on the candidate servers according to the candidate inspection script, so that the inspection efficiency of each candidate server in the machine room is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1A is a flowchart of a server inspection method according to a first embodiment of the present invention;
fig. 1B is a schematic structural diagram of a server inspection system according to a first embodiment of the present invention;
fig. 2 is a flowchart of a server patrol method according to a second embodiment of the present invention;
fig. 3 is a structural diagram of a server inspection device according to a third embodiment of the present invention;
fig. 4 is a schematic diagram of an electronic device according to a server inspection method provided in a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first" and "second" and the like in the description and the claims of the present invention and the above drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1A is a flowchart of a server inspection method according to an embodiment of the present invention, where the embodiment is applicable to a server inspection, and the method may be performed by a server inspection device, and the server inspection device may be implemented in hardware and/or software, and is specifically configured in an electronic device, for example, a main server of a machine room.
The server patrol method as shown in fig. 1A is performed by a main server in a machine room, and the method includes:
s101, determining the type of a server to which a candidate server in a machine room belongs, and generating a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification.
In this embodiment, the candidate server may be a server in the machine room. Identifying the server type may refer to the type of server having a cryptographic expiration identifier. The generic server type may refer to a type of server without a password expiration date identification. The password expiration identifier may be used to uniquely identify the password of the candidate server as having an expiration. The candidate patrol script may be a script for collecting server operation data. Wherein the server operation data may include, but is not limited to, at least one of server operation index data, database exception data, application log exception information data, and the like.
Optionally, determining a server type to which the candidate server in the machine room belongs, and generating a candidate inspection script for the candidate server according to the server type to which the candidate server belongs, including: determining whether the candidate server in the machine room has a password validity period identifier, and obtaining the server type to which the candidate server belongs; selecting a patrol template for the candidate server from the candidate patrol templates according to the type of the server to which the candidate server belongs, and generating a candidate patrol script for the candidate server according to the selected patrol template and the IP (Internet Protocol ) address of the candidate server; the candidate inspection script is an effective period inspection script or a general inspection script.
In this embodiment, the candidate inspection templates may be script templates for collecting server operation data. The general inspection script is used for collecting server operation data except for the password validity period; the expiration date inspection template is used for server operation data including, but not limited to, cryptographic expiration dates.
Specifically, determining whether a candidate server in the machine room has a password validity period identifier; if the candidate server has the password validity period identification, determining the server type to which the candidate server belongs as an identification server; if the candidate server does not have the password validity period identification, determining that the server type to which the candidate server belongs is a universal server; if the server type of the candidate server is a universal server, the inspection template of the candidate server is a universal inspection template, and a universal inspection script is generated for the candidate server according to the universal inspection template and the IP address of the candidate server; if the server type of the candidate server is the identification server, the inspection template of the candidate server is an effective period inspection template, and an effective period inspection script is generated for the candidate server according to the effective period inspection template and the IP address of the candidate server.
It can be understood that by adopting the technical scheme, the server type of the candidate server is determined according to the password validity period identification, and the inspection template is determined according to the server type; and generating candidate patrol scripts according to the patrol templates and the IP addresses of the candidate servers, so that the generation efficiency of the candidate patrol scripts is improved, and flexible patrol of the candidate servers is realized according to the password validity period identification.
S102, if the candidate server is a main server, locally executing a candidate inspection script to obtain an inspection result; the main server determines according to the service access amount, the memory idle amount and the load rate of the candidate server in each candidate historical time period.
In this embodiment, the local server is the main server. The inspection result may be data collected from a candidate server by a candidate inspection script. The number of candidate historical time periods and the time period length can be set by the skilled person according to actual requirements or practical experience, and the invention is not limited thereto. The traffic access volume may be an access volume of traffic deployed on the candidate server; the amount of memory free may be an amount of memory unoccupied on the candidate server. Specifically, if the candidate server is a main server, executing the candidate inspection script locally so that the candidate inspection script collects server operation data of the candidate server; and determining server operation data acquired by the candidate inspection script as an inspection result.
And S103, if the candidate server is a slave server, sending the candidate inspection script to the candidate server for execution, and obtaining an inspection result.
In this embodiment, the slave server may be a candidate server other than the master server. In a specific embodiment, if the candidate server is a slave server, sending a candidate inspection script to the candidate server for execution through an SSH (Secure Shell protocol) command, so that the candidate inspection script collects server operation data of the candidate server; and taking server operation data acquired by the candidate inspection script acquired from the candidate server as an inspection result.
In an alternative embodiment, for each inspection result, converting a storage format of an occupancy rate and a disk usage rate of a CPU (Central Processing Unit ) in the inspection result into a floating point format, and converting a storage format of a password expiration time in the inspection result into a character string format, thereby obtaining an inspection result after format conversion; and packaging the routing inspection result after format conversion and the IP address of the candidate server to which the routing inspection result belongs to obtain a packaged routing inspection result, and issuing the packaged routing inspection result to a message theme.
Specifically, for each packaged inspection result, determining a message theme associated with each server operation data in the packaged inspection result from the candidate message theme according to the association relation between the dimension of the candidate operation data and the candidate message theme, and issuing each server operation data in the packaged inspection result to the associated message theme. The candidate operation data dimension is a dimension of the operation data of the server, and may include, but is not limited to, CPU occupancy rate, disk occupancy rate, password validity period, and the like.
It can be appreciated that by adopting the technical scheme, the format conversion is carried out on the data such as CPU occupancy rate, password expiration and the like in the inspection result, so that the byte size of the inspection result is effectively reduced, the bandwidth occupied by issuing the packaged inspection result to a message subject is further reduced, and the timeliness of the inspection result transmission is ensured.
Optionally, fig. 1B is a schematic structural diagram of a server inspection system. As shown in fig. 1B, the server inspection system includes a monitoring alarm platform and a master server and a slave server in each machine room. The monitoring alarm platform comprises a database, an alarm module, a display module and a message subscription module. The server inspection flow of the server inspection system in the embodiment of the invention can be as follows: aiming at each machine room, the main server determines the type of the server to which the candidate server in the machine room belongs, and generates candidate inspection scripts for the candidate server according to the type of the server to which the candidate server belongs; if the candidate server is the main server, locally executing the candidate inspection script to obtain an inspection result; if the candidate server is a slave server, sending the candidate inspection script to the candidate server for execution, and acquiring an inspection result from the server; converting a storage format of CPU occupancy rate and disk usage rate in the inspection result into a floating point format aiming at each inspection result, and converting a storage format of a password validity period in the inspection result into a character string format to obtain an inspection result after format conversion; packaging the inspection result after format conversion and the IP address of the candidate server to which the inspection result belongs to obtain a packaged inspection result, and issuing the packaged inspection result to a message theme; a message subscription module in the monitoring alarm platform subscribes the packaged inspection results published by the main servers of all the machine rooms from the message theme, stores the packaged inspection results into a database, and sends the packaged inspection results to a display module for displaying the inspection results; the database determines a candidate inspection threshold value associated with the packaged inspection result according to the association relation between the inspection dimension of the packaged inspection result and the candidate inspection threshold value, and stores the packaged inspection result which is larger than the associated candidate inspection threshold value in an alarm information table of the database; the display module displays the packaged inspection result; the alarm module reads the packaged inspection result from the alarm information table of the database according to the preset time interval, and if the read packaged inspection result is the packaged inspection result newly stored in the alarm information table, generates an alarm notification for the candidate server to which the packaged inspection result belongs according to the IP address in the packaged inspection result.
It can be appreciated that by adopting the technical scheme, the message subscription module in the monitoring alarm platform subscribes the inspection results of the candidate servers of each machine room from the message theme, so that unified monitoring of the multi-machine room server is realized, and the machine rooms in different environments and different regions can be added at will to monitor the machine rooms in different environments and different regions, thereby improving the efficiency of monitoring the multi-machine room server, and avoiding the defect of overhigh inspection cost caused by centralized collection of monitoring products in the prior art.
The embodiment of the invention determines the type of the server to which the candidate server in the machine room belongs, and generates a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification; if the candidate server is the main server, locally executing the candidate inspection script to obtain an inspection result; the method comprises the steps that a main server determines according to service access quantity, memory idle quantity and load rate of a candidate server in each candidate historical time period; and if the candidate server is the slave server, sending the candidate inspection script to the candidate server for execution to obtain an inspection result. By adopting the technical scheme, according to the service access amount, the memory idle amount and the load rate of each candidate server in the machine room, the candidate server with relatively idle performance and relatively good performance is selected from the candidate servers in the machine room to serve as the main server of the machine room, so that the operation efficiency of the main server is improved; the main server performs inspection on the candidate servers according to the candidate inspection script, so that the inspection efficiency of each candidate server in the machine room is improved.
Example two
Fig. 2 is a flowchart of a server inspection method according to a second embodiment of the present invention, where additional optimization is performed based on the technical solution of the foregoing embodiment.
Further, adding an auxiliary server from the candidate servers according to the service access amount and the memory idle amount of the candidate servers in each candidate historical time period and the number of the candidate historical time periods; and determining a main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers so as to perfect the determination operation of the main server.
A method as shown in fig. 2, the method comprising:
s201, determining an auxiliary server from the candidate servers according to the service access amount and the memory idle amount of the candidate servers in each candidate historical time period and the number of the candidate historical time periods.
Optionally, determining the auxiliary server from the candidate servers according to the traffic access amount and the memory idle amount of the candidate servers in each candidate history period and the number of the candidate history periods includes: determining, for each candidate server, a first historical period in which the traffic access amount of the candidate server is smaller than a traffic access amount threshold value and a second historical period in which the memory idle amount of the candidate server is larger than a memory idle amount threshold value from the candidate historical periods; determining a first ratio between the number of first historical time periods and the number of candidate historical time periods, and determining a second ratio between the number of second historical time periods and the number of candidate historical time periods; if the candidate server meets the server constraint condition, determining the candidate server meeting the constraint condition as an auxiliary server; the server constraint condition is that the first ratio is larger than a first time period duty ratio threshold value, and the second ratio is larger than a second time period duty ratio threshold value; if there are no candidate servers satisfying the server constraint, each candidate server is determined to be an auxiliary server.
The service access amount threshold, the memory idle amount threshold, the first time period duty ratio threshold and the second time period duty ratio threshold can be set independently by a technician according to actual requirements and practical experience, and the invention is not limited to this.
It can be appreciated that, by adopting the above technical scheme, whether the candidate server meets the server constraint condition is determined according to the service access amount, the memory idle amount and the number of candidate historical time periods; determining the auxiliary server from the candidate servers according to whether the candidate servers meet the server constraint conditions, so that the flexibility of determining the auxiliary server is improved; if the candidate servers meet the constraint condition of the server, the candidate servers meeting the constraint condition are determined to be auxiliary servers, and then the main server is determined from the auxiliary servers, so that the main server is prevented from being determined from all the candidate servers, the efficiency of determining the auxiliary servers is improved, and the efficiency of determining the main server from the auxiliary servers is further improved.
S202, determining a main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers.
Optionally, determining the primary server from the secondary servers according to the service access amount, the memory idle amount and the load rate of the secondary servers includes: under the condition that the auxiliary servers meet the constraint conditions of the servers, determining a main server from the auxiliary servers according to the load rate of the auxiliary servers; and under the condition that the auxiliary servers do not meet the server constraint conditions, determining the main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers.
In an alternative embodiment, determining the primary server from the secondary servers according to the load rate of the secondary servers includes: and selecting the auxiliary server with the smallest average load rate among the candidate historical time periods from the auxiliary servers as a main server.
In another alternative embodiment, determining the primary server from the secondary servers according to the traffic access volume, the memory idle volume, and the load rate of the secondary servers includes: for each auxiliary server, determining the average business access amount, the average memory idle amount and the average load rate of the auxiliary server in the candidate historical time period; and determining the main server from the auxiliary servers according to the average service access amount, the average memory idle amount and the average load rate of the auxiliary servers, and the service access amount weight, the memory idle amount weight and the load rate weight.
In this embodiment, the service access amount weight, the memory idle amount weight and the load rate weight may be set independently by a technician according to actual requirements or practical experience, which is not limited in the present invention. Specifically, for each auxiliary server, determining the average service access amount, the average memory idle amount and the average load rate of the auxiliary server in the candidate historical time period according to the service access amount, the memory idle amount and the load rate of the auxiliary server in each candidate historical time period; taking the product of the average service access volume of the auxiliary server and the service access volume weight as a service access volume fraction; taking the product of the average memory idle quantity of the auxiliary server and the memory idle quantity weight as a memory idle quantity score; taking the product of the load rate and the load rate weight of the auxiliary server as a load rate fraction; and determining the auxiliary server with the minimum sum of the service access volume fraction, the memory idle volume fraction and the load rate fraction as a main server.
It can be understood that, by adopting the above technical scheme, if the auxiliary servers all meet the constraint condition of the server, the main server is selected according to the average load rate, so that the data volume in the process of selecting the main server can be reduced, and the efficiency of determining the main server is improved; if the auxiliary servers do not meet the constraint conditions of the servers, the main server is selected and determined according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers, and the candidate servers with high performance can be accurately selected from the auxiliary servers to serve as the main server.
It should be noted that S201 and S202 are executed only once, and are used for determining the auxiliary server from the candidate servers in advance according to the traffic access amount and the memory idle amount of the candidate servers in each candidate history period and the number of the candidate history periods; and determining a main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers so as to determine the inspection script of the candidate servers in the machine room through the main server, and further obtain the inspection result of the candidate servers, thereby improving the inspection efficiency of the servers.
S203, determining the type of the server to which the candidate server in the machine room belongs, and generating a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification.
S204, if the candidate server is a main server, locally executing the candidate inspection script to obtain an inspection result; the main server determines according to the service access amount, the memory idle amount and the load rate of the candidate server in each candidate historical time period.
And S205, if the candidate server is a slave server, sending the candidate inspection script to the candidate server for execution, and obtaining an inspection result.
The embodiment of the invention determines an auxiliary server from candidate servers according to the service access amount and the memory idle amount of the candidate servers in each candidate historical time period and the number of the candidate historical time periods; and determining the main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers. If the auxiliary servers meet the constraint conditions of the servers, the main server is selected according to the average load rate, so that the data volume in the process of selecting the main server can be reduced, and the efficiency of determining the main server is improved; if the auxiliary servers do not meet the constraint conditions of the servers, the main server is selected and determined according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers, and high-performance candidate servers can be accurately selected from the auxiliary servers to serve as the main server, so that the inspection efficiency of the servers is improved.
Example III
Fig. 3 is a block diagram of a server inspection device according to a third embodiment of the present invention, where the present embodiment is applicable to the inspection of a server, and the server inspection device may be implemented in hardware and/or software, and specifically configured in an electronic device, for example, a main server of a machine room.
The server inspection device as shown in fig. 3 includes an inspection script determination module 301, a first result determination module 302, and a second result determination module 303. Wherein,
the inspection script determining module 301 is configured to determine a server type to which a candidate server in the machine room belongs, and generate a candidate inspection script for the candidate server according to the server type to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification;
the first result determining module 302 is configured to execute the candidate inspection script locally if the candidate server is a main server, so as to obtain an inspection result; the method comprises the steps that a main server determines according to service access quantity, memory idle quantity and load rate of a candidate server in each candidate historical time period;
and the second result determining module 303 is configured to send the candidate inspection script to the candidate server for execution if the candidate server is a slave server, so as to obtain an inspection result.
According to the embodiment of the invention, the type of the server to which the candidate server belongs in the machine room is determined through the inspection script determining module, and the candidate inspection script is generated for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification; through the first result determining module, if the candidate server is a main server, locally executing the candidate inspection script to obtain an inspection result; the method comprises the steps that a main server determines according to service access quantity, memory idle quantity and load rate of a candidate server in each candidate historical time period; and through the second result determining module, if the candidate server is a slave server, the candidate inspection script is sent to the candidate server for execution, and an inspection result is obtained. According to the technical scheme of the embodiment of the invention, according to the service access quantity, the memory idle quantity and the load rate of each candidate server in the machine room, the candidate server with relatively idle performance and relatively good performance is selected from the candidate servers in the machine room to serve as the main server of the machine room, so that the operation efficiency of the main server is improved; the main server performs inspection on the candidate servers according to the candidate inspection script, so that the inspection efficiency of each candidate server in the machine room is improved.
Optionally, the inspection script determining module 301 includes:
the server type determining unit is used for determining whether the candidate server in the machine room has a password validity period identifier or not to obtain the server type to which the candidate server belongs;
the inspection script determining unit is used for selecting an inspection template for the candidate server from the candidate inspection templates according to the type of the server to which the candidate server belongs, and generating a candidate inspection script for the candidate server according to the selected inspection template and the IP address of the candidate server; the candidate inspection script is an effective period inspection script or a general inspection script.
Optionally, the server inspection device further includes:
the auxiliary server determining module is used for determining an auxiliary server from the candidate servers according to the service access amount and the memory idle amount of the candidate servers in each candidate historical time period and the number of the candidate historical time periods;
and the main server determining module is used for determining the main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers.
Optionally, the auxiliary server determining module includes:
a time period determining unit, configured to determine, for each candidate server, a first historical time period in which the service access amount of the candidate server is smaller than a service access amount threshold value, and a second historical time period in which the memory idle amount of the candidate server is larger than a memory idle amount threshold value, from candidate historical time periods;
A ratio determining unit configured to determine a first ratio between the number of the first history periods and the number of the candidate history periods, and determine a second ratio between the number of the second history periods and the number of the candidate history periods;
a first server determining unit, configured to determine, if there is a candidate server that satisfies a server constraint condition, the candidate server that satisfies the constraint condition as an auxiliary server; the server constraint condition is that a first ratio is larger than a first time period duty ratio threshold value, and the second ratio is larger than a second time period duty ratio threshold value;
and the second server determining unit is used for determining each candidate server as an auxiliary server if the candidate server meeting the server constraint condition does not exist.
Optionally, the main server determining module includes:
the first main server determining unit is used for determining a main server from the auxiliary servers according to the load rate of the auxiliary servers under the condition that the auxiliary servers meet the constraint conditions of the servers;
and the second main server determining unit is used for determining the main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers under the condition that the auxiliary servers do not meet the server constraint conditions.
Optionally, the first main server determining unit is specifically configured to:
and selecting the auxiliary server with the smallest average load rate among the candidate historical time periods from the auxiliary servers as a main server.
Optionally, the second main server determining unit is specifically configured to:
for each auxiliary server, determining the average business access amount, the average memory idle amount and the average load rate of the auxiliary server in the candidate historical time period;
and determining the main server from the auxiliary servers according to the average service access amount, the average memory idle amount and the average load rate of the auxiliary servers, and the service access amount weight, the memory idle amount weight and the load rate weight.
Optionally, the server inspection device further includes:
the format conversion module is used for converting the storage format of the CPU occupancy rate and the disk utilization rate in the inspection result into a floating point format aiming at each inspection result, and converting the storage format of the password validity period in the inspection result into a character string format to obtain an inspection result after format conversion;
the result issuing module is used for packaging the routing inspection result after format conversion and the IP address of the candidate server to which the routing inspection result belongs to obtain a packaged routing inspection result, and issuing the packaged routing inspection result to the message theme.
The server inspection device can execute the server inspection method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the server inspection methods.
Example IV
Fig. 4 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the server patrol method.
In some embodiments, the server inspection method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the server inspection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the server patrol method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (11)

1. A server patrol method, performed by a main server in a machine room, the method comprising:
determining the type of a server to which a candidate server in a machine room belongs, and generating a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification; the candidate server is a server in the machine room;
If the candidate server is a main server, locally executing a candidate inspection script to obtain an inspection result; the main server determines according to the service access amount, the memory idle amount and the load rate of the candidate server in each candidate historical time period;
and if the candidate server is the slave server, sending the candidate inspection script to the candidate server for execution to obtain an inspection result.
2. The method of claim 1, wherein determining the server type to which the candidate server in the machine room belongs and generating the candidate inspection script for the candidate server according to the server type to which the candidate server belongs, comprises:
determining whether the candidate server in the machine room has a password validity period identifier, and obtaining the server type to which the candidate server belongs;
selecting a patrol template for the candidate server from the candidate patrol templates according to the type of the server to which the candidate server belongs, and generating a candidate patrol script for the candidate server according to the selected patrol template and the IP address of the candidate server; the candidate inspection script is an effective period inspection script or a general inspection script.
3. The method of claim 1, wherein the primary server is determined by:
Determining an auxiliary server from candidate servers according to the service access amount and the memory idle amount of the candidate servers in each candidate historical time period and the number of the candidate historical time periods;
and determining a main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers.
4. The method of claim 3, wherein determining the auxiliary server from the candidate servers based on the traffic access and memory free amounts of the candidate servers in each candidate history period and the number of candidate history periods comprises:
determining, for each candidate server, a first historical period in which the traffic access amount of the candidate server is smaller than a traffic access amount threshold value and a second historical period in which the memory idle amount of the candidate server is larger than a memory idle amount threshold value from the candidate historical periods;
determining a first ratio between the number of first historical time periods and the number of candidate historical time periods, and determining a second ratio between the number of second historical time periods and the number of candidate historical time periods;
if the candidate server meets the server constraint condition, determining the candidate server meeting the constraint condition as an auxiliary server; the server constraint condition is that a first ratio is larger than a first time period duty ratio threshold value, and the second ratio is larger than a second time period duty ratio threshold value;
If there are no candidate servers satisfying the server constraint, each candidate server is determined to be an auxiliary server.
5. A method according to claim 3, wherein determining the primary server from the secondary servers according to the traffic access volume, the memory idle volume, and the load factor of the secondary servers comprises:
under the condition that the auxiliary servers meet server constraint conditions, determining a main server from the auxiliary servers according to the load rate of the auxiliary servers;
and under the condition that the auxiliary servers do not meet the server constraint conditions, determining a main server from the auxiliary servers according to the service access quantity, the memory idle quantity and the load rate of the auxiliary servers.
6. The method of claim 5, wherein determining the primary server from the secondary servers based on the load factor of the secondary servers comprises:
and selecting the auxiliary server with the smallest average load rate among the candidate historical time periods from the auxiliary servers as a main server.
7. The method of claim 5, wherein determining the primary server from the secondary servers based on the traffic access volume, the memory free volume, and the load factor of the secondary servers comprises:
For each auxiliary server, determining the average business access amount, the average memory idle amount and the average load rate of the auxiliary server in the candidate historical time period;
and determining the main server from the auxiliary servers according to the average service access amount, the average memory idle amount and the average load rate of the auxiliary servers, and the service access amount weight, the memory idle amount weight and the load rate weight.
8. The method according to claim 1, wherein the method further comprises:
converting a storage format of CPU occupancy rate and disk usage rate in the inspection result into a floating point format for each inspection result, and converting a storage format of password expiration time in the inspection result into a character string format to obtain an inspection result after format conversion;
and packaging the routing inspection result after format conversion and the IP address of the candidate server to which the routing inspection result belongs to obtain a packaged routing inspection result, and issuing the packaged routing inspection result to a message theme.
9. A server inspection device, characterized by a main server disposed in a machine room, the device comprising:
the inspection script determining module is used for determining the type of the server to which the candidate server in the machine room belongs and generating a candidate inspection script for the candidate server according to the type of the server to which the candidate server belongs; the server type is an identification server with a password validity period identification or a general server without the password validity period identification; the candidate server is a server in the machine room;
The first result determining module is used for locally executing the candidate inspection script if the candidate server is a main server to obtain an inspection result; the main server determines according to the service access amount, the memory idle amount and the load rate of the candidate server in each candidate historical time period;
and the second result determining module is used for sending the candidate inspection script to the candidate server for execution if the candidate server is a slave server, so as to obtain an inspection result.
10. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the server patrol method of any of claims 1-8.
11. A computer readable storage medium, characterized in that the computer readable storage medium stores computer instructions for causing a processor to implement the server patrol method according to any one of claims 1-8 when executed.
CN202311330444.7A 2023-10-16 2023-10-16 Server inspection method, device, equipment and medium Active CN117076185B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311330444.7A CN117076185B (en) 2023-10-16 2023-10-16 Server inspection method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311330444.7A CN117076185B (en) 2023-10-16 2023-10-16 Server inspection method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN117076185A true CN117076185A (en) 2023-11-17
CN117076185B CN117076185B (en) 2024-01-05

Family

ID=88708365

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311330444.7A Active CN117076185B (en) 2023-10-16 2023-10-16 Server inspection method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117076185B (en)

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391299A (en) * 2012-05-08 2013-11-13 深圳市腾讯计算机系统有限公司 Load balance method and load balance system
US20140324839A1 (en) * 2013-04-30 2014-10-30 Hewlett-Packard Development Company, L.P. Determining candidate scripts from a catalog of scripts
US9391865B1 (en) * 2013-09-20 2016-07-12 Veritas Technologies Llc Systems and methods for facilitating fault-tolerant backup jobs
CN107395379A (en) * 2016-05-16 2017-11-24 北京京东尚科信息技术有限公司 A kind of cluster cruising inspection system and method
CN109495347A (en) * 2018-12-10 2019-03-19 北京北信源信息安全技术有限公司 A kind of collecting method and system
CN109992478A (en) * 2019-03-29 2019-07-09 广东电网有限责任公司 A kind of server method for inspecting and device
CN110826052A (en) * 2019-10-18 2020-02-21 上海易点时空网络有限公司 Method and device for protecting server password security
CN111585786A (en) * 2020-03-30 2020-08-25 青岛青软实训教育科技股份有限公司 Realization of secret-free building method of big data cluster
CN112615944A (en) * 2020-12-11 2021-04-06 互联网域名系统北京市工程研究中心有限公司 Method and system for master and slave synchronization of distributed DNS (Domain name System)
CN112671813A (en) * 2019-10-15 2021-04-16 浙江宇视科技有限公司 Server determination method, device, equipment and storage medium
CN113032188A (en) * 2019-12-24 2021-06-25 腾讯科技(深圳)有限公司 Method, device, server and storage medium for determining main server
CN113553623A (en) * 2021-07-30 2021-10-26 北京天空卫士网络安全技术有限公司 Access request authentication method and device
CN116185774A (en) * 2023-02-07 2023-05-30 中国工商银行股份有限公司 Log monitoring installation method, device, computer equipment and storage medium
CN116185630A (en) * 2023-02-17 2023-05-30 平安付科技服务有限公司 Service processing method and device of system cluster, electronic equipment and medium
CN116594847A (en) * 2023-07-18 2023-08-15 太平金融科技服务(上海)有限公司 Server inspection method, system, device, server, medium and program product
CN116827601A (en) * 2023-05-29 2023-09-29 苏州浪潮智能科技有限公司 Data transmission method, device, electronic equipment and storage medium
CN116886490A (en) * 2023-06-08 2023-10-13 中国联合网络通信集团有限公司 Server inspection method and device and computer readable storage medium

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103391299A (en) * 2012-05-08 2013-11-13 深圳市腾讯计算机系统有限公司 Load balance method and load balance system
US20140324839A1 (en) * 2013-04-30 2014-10-30 Hewlett-Packard Development Company, L.P. Determining candidate scripts from a catalog of scripts
US9391865B1 (en) * 2013-09-20 2016-07-12 Veritas Technologies Llc Systems and methods for facilitating fault-tolerant backup jobs
CN107395379A (en) * 2016-05-16 2017-11-24 北京京东尚科信息技术有限公司 A kind of cluster cruising inspection system and method
CN109495347A (en) * 2018-12-10 2019-03-19 北京北信源信息安全技术有限公司 A kind of collecting method and system
CN109992478A (en) * 2019-03-29 2019-07-09 广东电网有限责任公司 A kind of server method for inspecting and device
CN112671813A (en) * 2019-10-15 2021-04-16 浙江宇视科技有限公司 Server determination method, device, equipment and storage medium
CN110826052A (en) * 2019-10-18 2020-02-21 上海易点时空网络有限公司 Method and device for protecting server password security
CN113032188A (en) * 2019-12-24 2021-06-25 腾讯科技(深圳)有限公司 Method, device, server and storage medium for determining main server
CN111585786A (en) * 2020-03-30 2020-08-25 青岛青软实训教育科技股份有限公司 Realization of secret-free building method of big data cluster
CN112615944A (en) * 2020-12-11 2021-04-06 互联网域名系统北京市工程研究中心有限公司 Method and system for master and slave synchronization of distributed DNS (Domain name System)
CN113553623A (en) * 2021-07-30 2021-10-26 北京天空卫士网络安全技术有限公司 Access request authentication method and device
CN116185774A (en) * 2023-02-07 2023-05-30 中国工商银行股份有限公司 Log monitoring installation method, device, computer equipment and storage medium
CN116185630A (en) * 2023-02-17 2023-05-30 平安付科技服务有限公司 Service processing method and device of system cluster, electronic equipment and medium
CN116827601A (en) * 2023-05-29 2023-09-29 苏州浪潮智能科技有限公司 Data transmission method, device, electronic equipment and storage medium
CN116886490A (en) * 2023-06-08 2023-10-13 中国联合网络通信集团有限公司 Server inspection method and device and computer readable storage medium
CN116594847A (en) * 2023-07-18 2023-08-15 太平金融科技服务(上海)有限公司 Server inspection method, system, device, server, medium and program product

Also Published As

Publication number Publication date
CN117076185B (en) 2024-01-05

Similar Documents

Publication Publication Date Title
CN115396289A (en) Fault alarm determination method and device, electronic equipment and storage medium
CN117076185B (en) Server inspection method, device, equipment and medium
CN115617549A (en) Thread decoupling method and device, electronic equipment and storage medium
CN114756301A (en) Log processing method, device and system
CN114327392A (en) Data processing method and device and electronic equipment
CN114650222B (en) Parameter configuration method, device, electronic equipment and storage medium
CN116843415A (en) Service order processing method, device, equipment and storage medium
CN114553894B (en) Data synchronization method, device, system and storage medium
CN116109387A (en) Electronic contract processing method and device, electronic equipment and medium
CN115665240A (en) Proxy service adding method, device, electronic equipment and storage medium
CN117156398A (en) Message processing method, device, electronic equipment and storage medium
CN116170188A (en) Network access control method, device, electronic equipment and storage medium
CN117668114A (en) Data synchronization method, device, equipment and medium
CN116384121A (en) Data processing method and device, electronic equipment and storage medium
CN116800665A (en) Edge node management method, device, equipment and storage medium
CN117608879A (en) Message queue processing method and device, electronic equipment and storage medium
CN117818714A (en) Architecture and method for multi-column control access railway signal centralized monitoring system
CN115599734A (en) Data acquisition method and device, electronic equipment and storage medium
CN115442252A (en) Call chain construction method and device, electronic equipment and readable storage medium
CN115577958A (en) Risk processing method, device, equipment and storage medium
CN117650967A (en) Multi-cluster index processing method, system, electronic equipment and storage medium
CN117749614A (en) Protocol rule determining method and device, electronic equipment and storage medium
CN117785413A (en) Task forwarding method, device, equipment and storage medium
CN117477543A (en) Power distribution system stability evaluation system, method and electronic equipment
CN115034927A (en) Data processing method and device, electronic equipment and storage medium

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