CN114328130B - Server monitoring method, system, equipment and computer readable storage medium - Google Patents

Server monitoring method, system, equipment and computer readable storage medium Download PDF

Info

Publication number
CN114328130B
CN114328130B CN202210200595.XA CN202210200595A CN114328130B CN 114328130 B CN114328130 B CN 114328130B CN 202210200595 A CN202210200595 A CN 202210200595A CN 114328130 B CN114328130 B CN 114328130B
Authority
CN
China
Prior art keywords
monitoring
server
cluster
preset
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210200595.XA
Other languages
Chinese (zh)
Other versions
CN114328130A (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.)
Shenzhen Mingyuan Cloud Technology Co Ltd
Original Assignee
Shenzhen Mingyuan Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Mingyuan Cloud Technology Co Ltd filed Critical Shenzhen Mingyuan Cloud Technology Co Ltd
Priority to CN202210200595.XA priority Critical patent/CN114328130B/en
Publication of CN114328130A publication Critical patent/CN114328130A/en
Application granted granted Critical
Publication of CN114328130B publication Critical patent/CN114328130B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a server monitoring method, a system, equipment and a computer readable storage medium, and relates to the technical field of computers. The server monitoring method comprises the following steps: sending a preset monitoring command to a target server; when the target server is a K8S cluster server, controlling a daemon process set of the K8S cluster server to run corresponding monitoring daemon processes on each host forming the K8S cluster server on the basis of the preset monitoring command; acquiring first monitoring information of each host submitted by the monitoring daemon, and storing the first monitoring information to a preset storage space; and when the target server is a single-host server, controlling the single-host server to execute the preset monitoring command, acquiring second monitoring information, and storing the second monitoring information to a preset storage space. The invention realizes the unified monitoring of the servers in the single-host environment and the K8S cluster environment.

Description

Server monitoring method, system, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a server monitoring method, system, device, and computer-readable storage medium.
Background
With the maturation of the Linux server technology, the application of the Linux server is more and more extensive, and at present, there are the Linux servers in a single host environment and the Linux servers in a K8S (i.e., kubernets, which is an arrangement management tool of a portable container for serving containers) cluster environment. In the case of a single host environment, all identification information is based on Linux servers, and in the case of a K8S cluster environment, the identification problem of K8S and the attribution problem of Linux servers are considered. In this case, if host monitoring, installation, operation and maintenance are performed according to the traditional business method, since the number of hosts of the servers in the K8S cluster environment is large, it is difficult to perform unified monitoring with the servers in the single-host environment.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a server monitoring method, and aims to solve the technical problem that servers in a single-host environment and a K8S cluster environment are difficult to monitor in a unified manner.
In order to achieve the above object, the present invention provides a server monitoring method, including the steps of:
sending a preset monitoring command to a target server;
when the target server is a K8S cluster server, controlling a daemon process set of the K8S cluster server to run corresponding monitoring daemon processes on each host forming the K8S cluster server on the basis of the preset monitoring command;
acquiring first monitoring information of each host submitted by the monitoring daemon, and storing the first monitoring information to a preset storage space;
and when the target server is a single-host server, controlling the single-host server to execute the preset monitoring command, acquiring second monitoring information, and storing the second monitoring information to a preset storage space.
Preferably, when the target server is a K8S cluster server, the step of controlling the daemon set of the K8S cluster server to run a corresponding monitoring daemon on each host constituting the K8S cluster server based on the preset monitoring command includes:
when the target server is a K8S cluster server, storing the preset monitoring command into a Dockerfile file of the K8S cluster server;
and controlling the daemon sets to run corresponding monitoring daemons on all hosts forming the K8S cluster server based on the preset monitoring commands in the Dockerfile file.
Preferably, when the target server is a K8S cluster server, the step of running a corresponding monitoring daemon on each host that constitutes the K8S cluster server by the daemon set that controls the K8S cluster server based on the preset monitoring command further includes:
calling a preset monitoring tool, and mapping the preset monitoring tool to a corresponding proxy node service in the K8S cluster server;
and receiving cluster overall monitoring information collected by a preset data exporter in the K8S cluster server based on the proxy node service.
Preferably, the step of receiving, based on the proxy node service, the cluster overall monitoring information collected by a preset data exporter in the K8S cluster server is followed by:
acquiring cluster identity identification information of the K8S cluster server;
and marking the cluster overall monitoring information according to the cluster identity identification information, and storing the marked cluster overall monitoring information to a preset storage space.
Preferably, the step of storing the first monitoring information in a preset storage space includes:
acquiring first identity identification information of each host;
and identifying the first monitoring information according to the first identity identification information, and storing the identified first monitoring information to a preset storage space.
Preferably, when the target server is a single host server, the step of controlling the single host server to execute the preset monitoring command, obtaining second monitoring information, and storing the second monitoring information in a preset storage space further includes:
and carrying out visualization processing on the real-time monitoring information in the preset storage space, and displaying the visualized real-time monitoring information on preset display equipment.
In addition, to achieve the above object, the present invention further provides a server monitoring system, including:
the command module is used for sending a preset monitoring command to the target server;
the cluster monitoring module is used for controlling a daemon process set of the K8S cluster server to run corresponding monitoring daemon processes on all hosts forming the K8S cluster server based on the preset monitoring command when the target server is the K8S cluster server;
the cluster storage module is used for acquiring first monitoring information of each host submitted by the monitoring daemon in a cluster and storing the first monitoring information to a preset storage space;
and the single-host monitoring module is used for controlling the single-host server to execute the preset monitoring command to obtain second monitoring information and storing the second monitoring information to a preset storage space when the target server is the single-host server.
In addition, to achieve the above object, the present invention also provides a server monitoring apparatus, including: a memory, a processor and a server monitor stored on the memory and operable on the processor, the server monitor when executed by the processor implementing the steps of the server monitoring method as claimed in any one of the above.
Further, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon a server monitoring program, which when executed by a processor, implements the steps of the server monitoring method as described in any one of the above.
According to the server monitoring method, after a preset monitoring command is sent to a target server, when the target server is a K8S cluster server, monitoring daemons corresponding to the preset monitoring command are deployed on all hosts forming the K8S cluster server by controlling a daemons set of the K8S cluster server, then the corresponding monitoring daemons are operated on all the hosts, the operation state information of all the hosts is collected to serve as first monitoring information, and the first monitoring data are stored in a preset storage space. And when the target server is a single-host server, acquiring running state information of the single-host server directly according to the preset monitoring command by controlling the single-host server to serve as second monitoring information, and storing the second monitoring data into a preset storage space. The invention can acquire the running state information of the servers in two environments based on the same preset monitoring instruction, thereby realizing the unified monitoring of the servers in the single-host environment and the K8S cluster environment.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating a first embodiment of a server monitoring method according to the present invention;
FIG. 2 is a flowchart illustrating a server monitoring method according to a second embodiment of the present invention;
fig. 3 is a schematic diagram of a server monitoring system according to an embodiment of the present invention;
fig. 4 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings. Specific embodiments of the present application have been shown by way of example in the drawings and will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the recitation of an element by the phrase "comprising an … …" does not exclude the presence of additional like elements in the process, method, article, or apparatus that comprises the element, and further, where similarly-named elements, features, or elements in different embodiments of the disclosure may have the same meaning, or may have different meanings, that particular meaning should be determined by their interpretation in the embodiment or further by context with the embodiment.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context. Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, species, and/or groups thereof. The terms "or," "and/or," "including at least one of the following," and the like, as used herein, are to be construed as inclusive or mean any one or any combination. For example, "includes at least one of: A. b, C "means" any of the following: a; b; c; a and B; a and C; b and C; a and B and C ", again for example," A, B or C "or" A, B and/or C "means" any of the following: a; b; c; a and B; a and C; b and C; a and B and C'. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some way.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or partially with other steps or at least some of the sub-steps or stages of other steps.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It should be noted that, step numbers such as S100 and S200 are used herein for the purpose of more clearly and briefly describing the corresponding contents, and do not constitute a substantial limitation on the sequence, and those skilled in the art may perform S200 first and then S100 in the specific implementation, but these should be within the protection scope of the present application.
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for the convenience of description of the present application, and have no specific meaning in themselves. Thus, "module", "component" or "unit" may be used mixedly.
Referring to fig. 1, a first embodiment of the present invention provides a server monitoring method, including the steps of:
step S100, sending a preset monitoring command to a target server;
specifically, the target server is a Linux server in a single-host environment or a Linux server in a K8S cluster environment, the preset monitoring command is a Linux shell command, the preset monitoring command is used for commanding the target server to monitor running state information of a Central Processing Unit (CPU), a memory, a disk, a network and the like of a host constituting the target server, and the preset monitoring command may be a command preset by a user or a command generated in real time according to an operation of the user.
Step S200, when the target server is a K8S cluster server, controlling a daemon process set of the K8S cluster server to run corresponding monitoring daemon processes on each host forming the K8S cluster server based on the preset monitoring command;
specifically, the daemon process set (DaemonSet) is a smallest unit created or deployed by a Pod (K8S), and a Pod encapsulates one or more containers (containers), storage resources (volumes), an independent network IP, and policy options for managing and controlling the operation modes of the containers), so as to ensure that all (or some) nodes (e.g., hosts) of the cluster run a Pod copy. When new nodes are added into the cluster, a Pod is added to the new nodes; when a node is removed from the cluster, these Pod will also be reclaimed. Therefore, when the target server is a K8S cluster server, the daemon set of the K8S cluster server may be controlled to generate a corresponding monitoring daemon (that is, a Pod copy corresponding to each host of the K8S cluster server) based on the preset monitoring command, and then the corresponding monitoring daemon is run on each host of the K8S cluster server to acquire the running state information of each host of the K8S cluster server, and it may be ensured that each host of the K8S cluster has and only has one Pod copy (that is, the monitoring daemon), thereby avoiding redundancy of the acquired running state information.
Further, step S200 further includes the steps of:
step S210, when the target server is a K8S cluster server, storing the preset monitoring command into a Dockerfile file of the K8S cluster server;
step S211, controlling the daemon process set to run corresponding monitoring daemon processes on each host that constitutes the K8S cluster server based on the preset monitoring command in the Dockerfile file.
Specifically, the servers of the K8S cluster support Shell commands (i.e., preset monitoring instructions) to collect monitoring information through a cluster container packed command set. When the target server is a K8S cluster server, storing the preset monitoring command in a Dockerfile file of the K8S cluster server, and then enabling a Docker (an open-source application container engine) of the K8S cluster to read the preset monitoring command in the Dockerfile file to automatically construct a container, and making a mirror image corresponding to the preset monitoring command. And then the daemon process set runs corresponding monitoring daemon processes on all hosts forming the K8S cluster server based on the mirror image made by the preset monitoring command in the Dockerfile file, so that the running state information of all the hosts is collected.
Step S300, acquiring first monitoring information of each host submitted by the monitoring daemon, and storing the first monitoring information to a preset storage space;
specifically, the monitoring daemon collects and submits the running state information of each host in the running process, so as to obtain the first monitoring information of each host. And then, the first monitoring information can be stored in a preset storage space, wherein the preset storage space can be a cloud or other memories selected by a user. The first monitoring information may include at least one of the following information: CPU state information (such as CPU frequency, occupancy, etc.), memory state information (memory usage, occupancy, etc.), disk state information (disk usage, read-write speed, etc.), network state information (uplink/downlink traffic, packet loss, etc.).
Further, the step of storing the first monitoring information in a preset storage space further includes:
step S310, acquiring first identity identification information of each host;
step S320, identifying the first monitoring information according to the first identity information, and storing the identified first monitoring information in a preset storage space.
Specifically, the first identification information may be an IP address, a MAC address, or other identification information (such as a number, a character string, or other information for distinguishing from other hosts) preset by a user of each host in the K8S cluster. The first monitoring information can be identified according to the first identity identification information, and the identified first monitoring information is stored in a preset storage space. Therefore, the monitoring information corresponding to different hosts in the K8S cluster is distinguished, so that the user can grasp the operating state of each host in the K8S cluster more accurately and clearly, and the monitoring information is more convenient when needing to be further processed.
Step S400, when the target server is a single-host server, controlling the single-host server to execute the preset monitoring command, obtaining second monitoring information, and storing the second monitoring information to a preset storage space.
Specifically, when the target server is a single-host server, the single-host server may directly acquire the running state information of the single-host server according to the preset monitoring command because the preset monitoring command is a basic Linux shell command. The single host server may be controlled to execute the preset monitoring command, so as to obtain second monitoring information of the single host server, and store the second monitoring information to a preset storage space. The second monitoring information may include at least one of the following information: CPU state information (such as CPU frequency, occupancy, etc.), memory state information (memory usage, occupancy, etc.), disk state information (disk usage, read-write speed, etc.), network state information (uplink/downlink traffic, packet loss, etc.).
Further, the step of storing the second monitoring information in a preset storage space further includes:
step S410, acquiring second identification information of the single host server;
step S420, identify the second monitoring information according to the second identification information, and store the identified second monitoring information in a preset storage space.
Specifically, the second identification information may be an IP address of the single host server, a MAC address, or other identifiable information preset by a user (e.g., a number, a character string, or other information for distinguishing from other hosts). The second monitoring information can be identified according to the second identification information, and the identified second monitoring information is stored in a preset storage space. So that the monitoring information of the single host server can be distinguished from the monitoring data of other single host servers or the K8S cluster server.
In the first embodiment of the present invention, after a preset monitoring command is sent to a target server, when the target server is a K8S cluster server, a monitoring daemon corresponding to the preset monitoring command is deployed on each host constituting the K8S cluster server by controlling a daemon set of the K8S cluster server, and then, by running the corresponding monitoring daemon on each host, running state information of each host is collected as first monitoring information, and the first monitoring data is stored in a preset storage space. And when the target server is a single-host server, acquiring running state information of the single-host server directly according to the preset monitoring command by controlling the single-host server to serve as second monitoring information, and storing the second monitoring data into a preset storage space. In this embodiment, the server in the K8S cluster environment runs corresponding monitoring daemon on each host that constitutes the K8S cluster server through the daemon set based on the preset monitoring command, so as to obtain corresponding monitoring information. The server in the single-host environment originally supports the preset monitoring command, so that the preset monitoring command can be directly executed without additional operation to upload corresponding monitoring information. The running state information of the servers in the two environments can be collected based on the same preset monitoring instruction, so that unified monitoring of the servers in the single-host environment and the K8S cluster environment is realized.
Further, referring to fig. 2, a second embodiment of the present invention provides a server monitoring method, based on the above embodiment shown in fig. 1, after step S200, the following steps are included:
step S220, calling a preset monitoring tool, and mapping the preset monitoring tool to a corresponding proxy node service in the K8S cluster server;
step S221, receiving, based on the proxy node service, the cluster overall monitoring information collected by a preset data exporter in the K8S cluster server.
Specifically, the preset monitoring tool may be an HTTP monitoring program, which may be started, and the HTTP monitoring program is mapped to a corresponding proxy node Service HTTP:// agent-node-Service by issuing Service in the K8S cluster server. In the case of a K8S cluster, in order to additionally monitor the overall situation of the K8S cluster server, a microserver of a data exporter may be additionally issued in the K8S cluster server, and the data exporter is responsible for collecting the cluster overall monitoring information of the K8S cluster server, such as pod, node, cluster total memory, and limited memory. And the data exporter submits the cluster overall monitoring information of the K8S cluster server through the proxy node service. Therefore, the cluster overall monitoring information collected by the preset data exporter in the K8S cluster server can be received based on the proxy node service, and the overall operation state of the K8S cluster server can be monitored.
Further, step S221 is followed by the following steps:
step S230, obtaining the cluster identity identification information of the K8S cluster server;
step S231, identifying the cluster whole monitoring information according to the cluster identity identification information, and storing the identified cluster whole monitoring information to a preset storage space.
Specifically, the cluster identification information is identification information for distinguishing the K8S cluster servers, and the cluster identification information of the K8S cluster servers may be generated according to information such as an IP address, an MAC address, a subnet mask, and the number of hosts of each host in the K8S cluster server. And marking the cluster overall monitoring information according to the cluster identity identification information, and storing the marked cluster overall monitoring information to a preset storage space. Therefore, the monitoring information of the K8S cluster server can be distinguished from the monitoring data of other single host servers or K8S cluster servers.
Still further, the following steps may be further included after step S400:
and S500, performing visualization processing on the real-time monitoring information in the preset storage space, and displaying the visualized real-time monitoring information on preset display equipment.
Specifically, the visualization process is a process of converting information into a chart form, including but not limited to a dashboard, a bar graph, a line graph, a dot graph, a pie graph, a table, and the like. The real-time monitoring information may include one or more of first monitoring information, second monitoring information, and cluster overall monitoring information stored in the preset storage space. The real-time monitoring information in the preset storage space can be visualized, and the visualized real-time monitoring information is displayed on preset display equipment (such as a television, a display, a notebook computer and the like). According to the embodiment, the monitoring information is displayed after being visualized, convenience of knowing the monitoring information by the user is improved, and the user can quickly know the running states of the servers and the host through the corresponding charts.
As shown in fig. 3, fig. 3 is a schematic diagram of a server monitoring system according to an embodiment of the present invention, and in an embodiment of the present invention, a server monitoring system is provided, where the server monitoring system includes:
the command module 10 is configured to send a preset monitoring command to a target server;
the cluster monitoring module 20 is configured to, when the target server is a K8S cluster server, control a daemon process set of the K8S cluster server to run a corresponding monitoring daemon process on each host that constitutes the K8S cluster server based on the preset monitoring command;
the cluster storage module 30 is configured to acquire, by a cluster, first monitoring information of each host submitted by the monitoring daemon, and store the first monitoring information to a preset storage space;
and the single-host monitoring module 40 is configured to, when the target server is a single-host server, control the single-host server to execute the preset monitoring command, obtain second monitoring information, and store the second monitoring information in a preset storage space.
Still further, the server monitoring system further includes:
the cluster monitoring module 20 is further configured to, when the target server is a K8S cluster server, store the preset monitoring command in a Dockerfile file of the K8S cluster server;
the cluster monitoring module 20 is further configured to control the daemon set to run corresponding monitoring daemons on each host that forms the K8S cluster server based on the preset monitoring command in the Dockerfile file.
Still further, the server monitoring system further includes: the cluster monitoring module 20 further comprises an integral monitoring module;
the integral monitoring module is used for calling a preset monitoring tool and mapping the preset monitoring tool to a corresponding proxy node service in the K8S cluster server;
and the overall monitoring module is used for receiving cluster overall monitoring information acquired by a preset data exporter in the K8S cluster server based on the proxy node service.
Still further, the server monitoring system further includes: a first identification module;
the first identification module is used for acquiring the cluster identity identification information of the K8S cluster server;
and the first identification module is used for identifying the cluster overall monitoring information according to the cluster identity identification information and storing the identified cluster overall monitoring information to a preset storage space.
Still further, the server monitoring system further includes: a second identification module;
the second identification module is used for acquiring first identity identification information of each host;
and the second identification module is used for identifying the first monitoring information according to the first identity identification information and storing the identified first monitoring information to a preset storage space.
Still further, the server monitoring system further includes: a third identification module;
the third identification module is used for acquiring second identity identification information of the single host server;
and the third identification module is used for identifying the second monitoring information according to the second identity identification information and storing the identified second monitoring information to a preset storage space.
Still further, the server monitoring system further includes: a display module;
and the display module is used for carrying out visual processing on the real-time monitoring information in the preset storage space and displaying the real-time monitoring information after the visual processing on preset display equipment.
As shown in fig. 4, fig. 4 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 4, the server monitoring apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) as a Display unit, may include a Keyboard (Keyboard) as an input unit, or may include a Touch screen (Touch Panel) as an input unit in addition to the Display unit, and the optional user interface 1003 may include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface (e.g., USB interface), a wireless interface (e.g., Bluetooth interface, WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the device may further include RF (Radio Frequency) circuitry, sensors, audio circuitry, WiFi modules, bluetooth modules, and the like. Those skilled in the art will appreciate that the device configuration shown in fig. 4 does not constitute a limitation of the server monitoring device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 4, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a server monitoring application program.
In the device shown in fig. 4, the processor 1001 may be configured to invoke a server monitor stored in the memory 1005 and perform the following operations:
sending a preset monitoring command to a target server;
when the target server is a K8S cluster server, controlling a daemon process set of the K8S cluster server to run corresponding monitoring daemon processes on all hosts forming the K8S cluster server on the basis of the preset monitoring command;
acquiring first monitoring information of each host submitted by the monitoring daemon, and storing the first monitoring information to a preset storage space;
and when the target server is a single-host server, controlling the single-host server to execute the preset monitoring command, acquiring second monitoring information, and storing the second monitoring information to a preset storage space.
Still further, the processor 1001 may be further configured to invoke a server monitor stored in the memory 1005 and perform the following operations:
when the target server is a K8S cluster server, storing the preset monitoring command into a Dockerfile file of the K8S cluster server;
and controlling the daemon sets to run corresponding monitoring daemons on all hosts forming the K8S cluster server based on the preset monitoring commands in the Dockerfile file.
Still further, the processor 1001 may be further configured to invoke a server monitor stored in the memory 1005 and perform the following operations:
calling a preset monitoring tool, and mapping the preset monitoring tool to a corresponding proxy node service in the K8S cluster server;
and receiving cluster overall monitoring information collected by a preset data exporter in the K8S cluster server based on the proxy node service.
Still further, the processor 1001 may be further configured to invoke a server monitor stored in the memory 1005 and perform the following operations:
acquiring cluster identity identification information of the K8S cluster server;
and marking the cluster overall monitoring information according to the cluster identity identification information, and storing the marked cluster overall monitoring information to a preset storage space.
Still further, the processor 1001 may be further configured to invoke a server monitor stored in the memory 1005 and perform the following operations:
acquiring first identity identification information of each host;
and identifying the first monitoring information according to the first identity identification information, and storing the identified first monitoring information to a preset storage space.
Still further, the processor 1001 may be further configured to invoke a server monitor stored in the memory 1005 and perform the following operations:
acquiring second identity identification information of the single host server;
and identifying the second monitoring information according to the second identity identification information, and storing the identified second monitoring information to a preset storage space.
Still further, the processor 1001 may be further configured to invoke a server monitor stored in the memory 1005 and perform the following operations:
and carrying out visualization processing on the real-time monitoring information in the preset storage space, and displaying the visualized real-time monitoring information on preset display equipment.
In addition, the embodiment of the invention also provides a computer storage medium.
The computer storage medium stores a computer program, and the computer program, when executed by the processor, implements the operations in the server monitoring method provided by the above embodiments, and specific implementation steps may refer to the above embodiments and are not described in detail herein.
It is to be understood that the foregoing scenarios are only examples, and do not constitute a limitation on application scenarios of the technical solutions provided in the embodiments of the present application, and the technical solutions of the present application may also be applied to other scenarios. For example, as can be known by those skilled in the art, with the evolution of system architecture and the emergence of new service scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The units in the device in the embodiment of the application can be merged, divided and deleted according to actual needs.
In the present application, the same or similar term concepts, technical solutions and/or application scenario descriptions will be generally described only in detail at the first occurrence, and when the description is repeated later, the detailed description will not be repeated in general for brevity, and when understanding the technical solutions and the like of the present application, reference may be made to the related detailed description before the description for the same or similar term concepts, technical solutions and/or application scenario descriptions and the like which are not described in detail later.
In the present application, each embodiment is described with emphasis, and reference may be made to the description of other embodiments for parts that are not described or illustrated in any embodiment.
The technical features of the technical solution of the present application may be arbitrarily combined, and for brevity of description, all possible combinations of the technical features in the embodiments are not described, however, as long as there is no contradiction between the combinations of the technical features, the scope of the present application should be considered as being described in the present application.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application or portions contributing to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (such as a ROM/RAM, a magnetic disk, and an optical disk) as above, and includes several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, a controlled terminal, or a network device) to execute the method of each embodiment of the present application.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, memory Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (8)

1. A server monitoring method is characterized by comprising the following steps:
sending a preset monitoring command to a target server, wherein the preset monitoring command is a Linux shell command;
when the target server is a K8S cluster server, controlling a daemon process set of the K8S cluster server to run corresponding monitoring daemon processes on each host forming the K8S cluster server on the basis of the preset monitoring command;
acquiring first monitoring information of each host submitted by the monitoring daemon, and storing the first monitoring information to a preset storage space;
when the target server is a single-host server, controlling the single-host server to execute the preset monitoring command, acquiring second monitoring information, and storing the second monitoring information to a preset storage space;
when the target server is a K8S cluster server, the step of controlling the daemon set of the K8S cluster server to run corresponding monitoring daemons on each host constituting the K8S cluster server based on the preset monitoring command further includes:
calling a preset monitoring tool, and mapping the preset monitoring tool to a corresponding proxy node service in the K8S cluster server;
receiving cluster overall monitoring information collected by a preset data exporter in the K8S cluster server based on the proxy node service;
acquiring cluster identity identification information of the K8S cluster server;
and marking the cluster overall monitoring information according to the cluster identity identification information, and storing the marked cluster overall monitoring information to a preset storage space.
2. The server monitoring method according to claim 1, wherein, when the target server is a K8S cluster server, the step of controlling the daemon set of the K8S cluster server to run a corresponding monitoring daemon on each host constituting the K8S cluster server based on the preset monitoring command comprises:
when the target server is a K8S cluster server, storing the preset monitoring command into a Dockerfile file of the K8S cluster server;
and controlling the daemon sets to run corresponding monitoring daemons on all hosts forming the K8S cluster server based on the preset monitoring commands in the Dockerfile file.
3. The server monitoring method according to claim 1, wherein the step of storing the first monitoring information to a preset storage space comprises:
acquiring first identity identification information of each host;
and identifying the first monitoring information according to the first identity identification information, and storing the identified first monitoring information to a preset storage space.
4. The server monitoring method according to claim 1, wherein the step of storing the second monitoring information to a preset storage space further comprises:
acquiring second identity identification information of the single host server;
and identifying the second monitoring information according to the second identity identification information, and storing the identified second monitoring information to a preset storage space.
5. The server monitoring method according to any one of claims 1 to 4, wherein, when the target server is a single-host server, the step of controlling the single-host server to execute the preset monitoring command, obtain second monitoring information, and store the second monitoring information in a preset storage space further includes:
and carrying out visualization processing on the real-time monitoring information in the preset storage space, and displaying the visualized real-time monitoring information on preset display equipment.
6. A server monitoring system, characterized in that the server monitoring system comprises:
the command module is used for sending a preset monitoring command to the target server, wherein the preset monitoring command is a Linux skin 1 command;
the cluster monitoring module is used for controlling a daemon process set of the K8S cluster server to run corresponding monitoring daemon processes on all hosts forming the K8S cluster server based on the preset monitoring command when the target server is the K8S cluster server;
the cluster storage module is used for a cluster to acquire first monitoring information of each host submitted by the monitoring daemon and store the first monitoring information to a preset storage space;
the single-host monitoring module is used for controlling the single-host server to execute the preset monitoring command to obtain second monitoring information and storing the second monitoring information to a preset storage space when the target server is the single-host server;
the integral monitoring module is used for calling a preset monitoring tool and mapping the preset monitoring tool to a corresponding proxy node service in the K8S cluster server; calling a preset monitoring tool, and mapping the preset monitoring tool into a corresponding proxy node service in the K8S cluster server;
the integral monitoring module is used for receiving cluster integral monitoring information acquired by a preset data exporter in the K8S cluster server based on the proxy node service;
the first identification module is used for acquiring the cluster identity identification information of the K8S cluster server;
and the first identification module is used for identifying the cluster overall monitoring information according to the cluster identity identification information and storing the identified cluster overall monitoring information to a preset storage space.
7. A server monitoring device, characterized in that the server monitoring device comprises: memory, a processor and a server monitoring program stored on the memory and executable on the processor, the server monitoring program when executed by the processor implementing the steps of the server monitoring method according to any one of claims 1 to 5.
8. A computer-readable storage medium, having stored thereon a server monitoring program, which when executed by a processor, carries out the steps of the server monitoring method according to any one of claims 1 to 5.
CN202210200595.XA 2022-03-03 2022-03-03 Server monitoring method, system, equipment and computer readable storage medium Active CN114328130B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210200595.XA CN114328130B (en) 2022-03-03 2022-03-03 Server monitoring method, system, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210200595.XA CN114328130B (en) 2022-03-03 2022-03-03 Server monitoring method, system, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114328130A CN114328130A (en) 2022-04-12
CN114328130B true CN114328130B (en) 2022-08-12

Family

ID=81029759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210200595.XA Active CN114328130B (en) 2022-03-03 2022-03-03 Server monitoring method, system, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114328130B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114826939B (en) * 2022-04-25 2024-04-23 神州灵云(北京)科技有限公司 Network traffic analysis method of K8S cluster

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603329A (en) * 2016-12-02 2017-04-26 曙光信息产业(北京)有限公司 Server cluster monitoring method and system
CN108566290A (en) * 2018-02-07 2018-09-21 平安科技(深圳)有限公司 service configuration management method, system, storage medium and server
CN109743199A (en) * 2018-12-25 2019-05-10 中国联合网络通信集团有限公司 Containerization management system based on micro services
CN111158872A (en) * 2019-12-16 2020-05-15 北京明朝万达科技股份有限公司 Method and device for submitting and guarding spark task
CN114090386A (en) * 2021-11-24 2022-02-25 浪潮云信息技术股份公司 Method and system for monitoring running of Kubernets

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6470389B1 (en) * 1997-03-14 2002-10-22 Lucent Technologies Inc. Hosting a network service on a cluster of servers using a single-address image
US10223248B2 (en) * 2017-05-15 2019-03-05 Bank Of America Corporation Conducting automated software testing using centralized controller and distributed test host servers
CN114125021B (en) * 2021-10-20 2024-01-30 安徽峰泰技术开发有限公司 Terminal information release system based on Netty message drive

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603329A (en) * 2016-12-02 2017-04-26 曙光信息产业(北京)有限公司 Server cluster monitoring method and system
CN108566290A (en) * 2018-02-07 2018-09-21 平安科技(深圳)有限公司 service configuration management method, system, storage medium and server
CN109743199A (en) * 2018-12-25 2019-05-10 中国联合网络通信集团有限公司 Containerization management system based on micro services
CN111158872A (en) * 2019-12-16 2020-05-15 北京明朝万达科技股份有限公司 Method and device for submitting and guarding spark task
CN114090386A (en) * 2021-11-24 2022-02-25 浪潮云信息技术股份公司 Method and system for monitoring running of Kubernets

Also Published As

Publication number Publication date
CN114328130A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
EP2682863B1 (en) Installing applications remotely
CN105071976B (en) Data transmission method and device
CN110635933B (en) Apparatus, control method, and recording medium for managing network of SDN
US11646939B2 (en) Network function NF management method and NF management device
CN108696581B (en) Distributed information caching method and device, computer equipment and storage medium
CN113791759A (en) Code development processing method and device, electronic equipment and storage medium
US20160205278A1 (en) Information processing apparatus, system, and control method for information processing apparatus
CN114328130B (en) Server monitoring method, system, equipment and computer readable storage medium
CN110445632B (en) Method and device for preventing client from crashing
CN111198859A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN112860953A (en) Data importing method, device, equipment and storage medium of graph database
CN112333289A (en) Reverse proxy access method, device, electronic equipment and storage medium
CN110069406B (en) Automatic triggering TPC-DS test method and system
US8655928B2 (en) Device and method for storing file
CN114090623A (en) Method and device for creating cache resources, electronic equipment and storage medium
CN113301155A (en) Data routing method, device, equipment and storage medium
JP2000071576A (en) Printer managing system and method for managing printer
EP2928158A1 (en) Distribution apparatus and distribution method
US20220173964A1 (en) System and method for setting information on wireless communication
CN112104513B (en) Visual software load method, device, equipment and storage medium
CN111126604B (en) Model training method, device, server and storage medium
CN114265655A (en) Cloud application data processing method, device and system and storage medium
CN112650677A (en) Interface calling method, device, server and storage medium
US7216151B2 (en) Computer apparatus and program for controlling same
CN112527276A (en) Data updating method and device in visual programming tool and terminal equipment

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