Label-based server monitoring method and device and computer equipment
Through the tag-based server monitoring method, automatically adding tags to the server and associating monitoring templates, the problems of low manual configuration efficiency and slow response speed in the existing technology are solved, and efficient and automated server monitoring is achieved.
Patent Information
- Application Number
- CN202510084288.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-13
AI Technical Summary
The existing server monitoring methods have problems such as low manual configuration efficiency, slow response speed for dynamic updates, and inability to automate monitoring objects.
The tag-based server monitoring method is adopted, and by receiving tag addition requests from the server, adding basic usage tags and resource type tags to the server, and associated them with preset monitoring templates to achieve automated monitoring.
It realizes efficient and fast-responsive server monitoring, can automatically manage monitoring objects, and improves monitoring efficiency and accuracy.
Smart Images

Figure CN119988136A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of server monitoring, and in particular to a tag-based server monitoring method, device, computer equipment and storage medium. Background Art
[0002] With the rapid development of the Internet and cloud computing, servers have become a core part of the operations of enterprises and organizations. The stability, performance, and security of servers are crucial to ensuring business continuity and data security.
[0003] Currently, in the field of server monitoring, open source monitoring systems such as Zabbix and Prometheus are widely used. These systems mainly collect data on monitored objects through manual configuration and automatic discovery based on monitoring agents. However, the above methods still have problems such as low efficiency caused by manual configuration, slow response speed for dynamically updated servers, and inability to achieve automation of monitored objects.
[0004] Therefore, based on the above problems, an efficient, fast-response, and automated server monitoring method is in urgent need in this field. Summary of the invention
[0005] The embodiments of the present invention propose a tag-based server monitoring method, apparatus, computer equipment and storage medium to solve the problems of low efficiency caused by manual configuration in current server monitoring methods, slow response speed to dynamically updated servers, and inability to achieve automation of monitoring objects.
[0006] In a first aspect, an embodiment of the present invention provides a tag-based server monitoring method, the method comprising:
[0007] Receive a tag adding request from an active server, and add a basic usage tag to the active server;
[0008] According to the resource type of the active server, adding a resource type tag to the active server;
[0009] According to the basic usage tag and the resource type tag, the active server is associated with a preset monitoring template; the preset monitoring template includes preset monitoring indicators and preset alarm thresholds for servers of different tag types;
[0010] According to the preset monitoring indicators, obtaining monitoring indicator data of the active server;
[0011] If the monitoring indicator data exceeds the preset alarm threshold, an alarm message is sent.
[0012] In a second aspect, an embodiment of the present invention further provides a tag-based server monitoring device, the device comprising:
[0013] A basic label adding module is used to receive a label adding request from an active server and add a basic usage label to the active server;
[0014] A resource tag adding module, used for adding a resource type tag to the active server according to the resource type of the active server;
[0015] An association module, configured to associate the active server with a preset monitoring template according to the basic usage tag and the resource type tag; the preset monitoring template includes preset monitoring indicators and preset alarm thresholds for servers of different tag types;
[0016] A monitoring indicator data acquisition module, used to acquire the monitoring indicator data of the active server according to the preset monitoring indicator;
[0017] The alarm module is used to send an alarm message if the monitoring indicator data exceeds the preset alarm threshold.
[0018] In a third aspect, an embodiment of the present invention further provides a computer device, the computer device comprising:
[0019] one or more processors;
[0020] a memory for storing one or more programs,
[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the tag-based server monitoring method as described in any one of the first aspects.
[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the tag-based server monitoring method as described in any one of the first aspects is implemented.
[0023] In this embodiment, a tag adding request of an active server is received, and a basic usage tag is added to the active server; a resource type tag is added to the active server according to the resource type of the active server; the active server is associated with a preset monitoring template according to the basic usage tag and the resource type tag; the preset monitoring template includes preset monitoring indicators and preset alarm thresholds for servers of different tag types; the monitoring indicator data of the active server is obtained according to the preset monitoring indicators; if the monitoring indicator data exceeds the preset alarm threshold, an alarm message is sent. The purpose of efficient and automatic monitoring of servers is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A flowchart of a tag-based server monitoring method provided in Example 1 of the present invention;
[0025] Figure 2 This is an example diagram of the management interface of the asset platform provided in the first embodiment of the present invention;
[0026] Figure 3 This is an example diagram of the management backend interface of the asset platform provided in the first embodiment of the present invention;
[0027] Figure 4 This is an example flow chart of a tag-based server monitoring method provided in Embodiment 1 of the present invention;
[0028] Figure 5 An example diagram of automatic creation of a timing sequence of monitoring objects provided in the first embodiment of the present invention;
[0029] Figure 6 An example diagram of an automatic creation sequence of monitoring objects using an external interface provided in the first embodiment of the present invention;
[0030] Figure 7 A schematic diagram of the structure of a tag-based server monitoring device provided in Embodiment 2 of the present invention;
[0031] Figure 8 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0032] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It is also necessary to explain that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0033] Embodiment 1
[0034] Figure 1 A flowchart of a tag-based server monitoring method provided in the first embodiment of the present invention specifically includes the following steps:
[0035] Step 101: Receive a tag adding request from an active server and add a basic usage tag to the active server.
[0036] In the embodiment of the present invention, the monitoring system receives a tag adding request of an active server through an interface or a management tool with a server asset platform.
[0037] In actual applications, the tag adding request can be initiated by the server administrator or automatically triggered by the server asset platform when the server is allocated to a user.
[0038] Furthermore, the monitoring system verifies the legitimacy of the request to ensure that the request comes from an authorized user or system. For example, the verification content includes the identity of the requester, the requested server information, etc.
[0039] Among them, after verification, if Figure 5 As shown in Figure 1, add basic usage tags to active servers in the server asset platform. Basic usage tags are used to identify the basic usage status of the server, such as "in use" or "under testing". Tags can be added through the asset platform management interface (such as Figure 2 ) or automated scripting.
[0040] It can be understood that the verification content and label marking content involved in the above description are set by relevant technical personnel according to actual applications, and the embodiments of the present invention do not impose specific limitations.
[0041] Step 102: Add a resource type tag to the active server according to the resource type of the active server.
[0042] In the embodiment of the present invention, Figure 5 As shown, the system obtains resource type information of active servers through the server asset platform or directly from the server. Resource types include but are not limited to operating system type, database type (such as MySQL, Redis, Kafka, etc.), middleware type, etc.
[0043] According to the determined resource type, add the corresponding resource type tag to the active server. For example, if the server runs MySQL database, add the "MySQL" tag to it; if the server runs Kafka message queue, add the "Kafka" tag to it. Tags can be added through the asset platform management interface (such as Figure 2 ) or automated scripting.
[0044] Step 103: Associating the active server with a preset monitoring template according to the basic usage tag and the resource type tag; the preset monitoring template includes preset monitoring indicators and preset alarm thresholds for servers of different tag types.
[0045] In the embodiment of the present invention, Figure 4 As shown in the figure, the system searches for preset monitoring templates based on the basic usage tags and resource type tags of the active servers. Preset monitoring templates are predefined and contain preset monitoring indicators and preset alarm thresholds for servers of different tag types.
[0046] It is understandable that the monitoring indicators and alarm thresholds are set by relevant technical personnel according to actual needs, and the embodiments of the present invention are not limited to this.
[0047] Preferably, in another embodiment of the present invention, it also includes:
[0048] Step D1: receiving a request for collecting the preset monitoring indicators of the active server.
[0049] Specifically, when receiving data collection requests for active servers from other platforms, first, obtain the corresponding preset monitoring template according to the data indicators in the data collection request, and then associate the active server with the matching monitoring template. The association operation can be completed through the asset platform interface or the management tool of the monitoring system. Figure 3 As shown in the figure, in the management backend interface of the asset platform, set the association between the server and the monitoring template. The system verifies whether the association is successful and ensures that the active server has been correctly associated with the monitoring template. The verification content includes whether the monitoring indicators have been correctly configured and whether the alarm thresholds have been correctly set.
[0050] Furthermore, after association, the monitoring system will automatically apply the monitoring indicators and alarm thresholds in the monitoring template to the active servers.
[0051] Step 104: Acquire monitoring indicator data of the active server according to the preset monitoring indicator.
[0052] In the embodiment of the present invention, the monitoring system initializes the monitoring of the active server according to the preset monitoring index.
[0053] Among them, Figure 4 As shown, monitoring indicators include but are not limited to CPU usage, memory usage, disk usage, network traffic, application performance indicators, etc. The monitoring system obtains monitoring indicator data through a monitoring agent or directly from a server.
[0054] Furthermore, a monitoring agent can be installed on the server to regularly collect and report monitoring data to the monitoring system.
[0055] The collected monitoring indicator data is stored in the database of the monitoring system for subsequent analysis and alarm processing.
[0056] Preferably, in another embodiment of the present invention, step 104 further includes:
[0057] Sub-step C1: according to the preset monitoring indicator, obtain the corresponding preset indicator collection interface.
[0058] Specifically, the monitoring system extracts preset monitoring indicators associated with the active server from the preset monitoring template. These indicators may include, but are not limited to, CPU usage, memory usage, disk I / O, network traffic, and application-specific indicators (such as the number of database connections, query response time, etc.). For example, if the active server is a server running a MySQL database, the preset monitoring indicators may include the number of database connections, query response time, buffer pool hit rate, etc.
[0059] Furthermore, the preset monitoring template also includes a preset indicator collection interface set according to the preset monitoring indicator. Figure 5 As shown, the monitoring system searches for the corresponding preset indicator collection interface based on the preset monitoring indicators. These interfaces are predefined and are used to collect specific monitoring indicator data from the server or application. For example, for the indicator of the number of database connections, the preset indicator collection interface may obtain the current number of connections from the system table of the MySQL database through an SQL query statement. For the indicator of CPU usage, the preset indicator collection interface may obtain the current CPU usage through system commands (such as top or vmstat) or system APIs (such as the / proc file system).
[0060] Finally, the system verifies whether the preset indicator collection interface is available. This includes checking whether the interface is correctly configured, whether it can connect to the target server or application, and whether it has the necessary permissions. For example, if the collection interface needs to connect to the server through the network, the system will check whether the network connection is normal; if the collection interface requires specific permissions, the system will verify whether the current user or monitoring agent has these permissions.
[0061] Sub-step C2: obtaining monitoring indicator data of the active server through the preset indicator collection interface.
[0062] Specifically, Figure 5 As shown, the monitoring system obtains the monitoring indicator data of the active server by calling the preset indicator collection interface. For example, the collection interface can obtain the number of connections from the MySQL database through an SQL query statement, and the monitoring system will send an SQL query request to the database server.
[0063] Step 105: If the monitoring indicator data exceeds the preset alarm threshold, an alarm message is sent.
[0064] In the embodiment of the present invention, Figure 4 As shown, the monitoring system detects in real time whether the monitoring indicator data exceeds the preset alarm threshold. The alarm threshold is a pre-defined critical value used to determine when to trigger an alarm.
[0065] If the monitoring indicator data exceeds the preset alarm threshold, the monitoring system generates an alarm message. The alarm message includes detailed information such as server ID, alarm time, alarm indicator, alarm threshold, current value, etc. The monitoring system sends the alarm message through the preset alarm management module.
[0066] In actual applications, the alarm management module can support multiple notification methods, such as email, SMS, enterprise communication tools, etc. Alarm information is sent to the designated administrator or operation and maintenance team to handle the alarm event in a timely manner.
[0067] Specifically, the monitoring system records the alarm information in the alarm log for subsequent audit and analysis. The alarm log includes information such as alarm time, alarm level, and processing status.
[0068] It is understandable that the content and sending method of the alarm information are set by relevant technical personnel according to actual needs, and the embodiment of the present invention does not limit this.
[0069] Preferably, in another embodiment of the present invention, it also includes:
[0070] Step A1: display the monitoring indicator data and / or the alarm information on a user interface.
[0071] Specifically, Figure 5 As shown, the acquired monitoring data and its analysis results are displayed on the user interface. If the monitoring data exceeds the preset alarm threshold, the alarm information can be directly displayed on the user interface.
[0072] Preferably, in another embodiment of the present invention, it also includes:
[0073] Step B1: receiving a new request from the server.
[0074] Specifically, Figure 6 As shown in the figure, the user initiates a request to add a new Kafka node to the system through the interface or API. The Kafka backend verifies the legitimacy of the request, including user permissions, Kafka node configuration information, etc. Once the request is verified, the Kafka backend starts to initialize the new node and configure the necessary parameters and settings.
[0075] Step B2: Mark the newly added server as an active server and add the basic usage tag.
[0076] Specifically, Figure 6 As shown in the figure, the Kafka backend marks the newly created Kafka node as an active server, indicating that the node is ready and can be monitored by the monitoring system. At the same time, the Kafka backend adds basic usage tags to the new node, such as "Kafka node" or "in use".
[0077] Furthermore, the Kafka backend pushes the instance information of the new node to the Kafka monitoring template through the interface. After receiving the instance information, the Kafka monitoring template creates the corresponding Kafka monitoring object. In the Kafka monitoring object, configure the preset monitoring indicators and alarm thresholds, which will be used to monitor the performance and status of the Kafka node.
[0078] In practical applications, such as Figure 6 As shown in the figure, the Kafka monitoring object instructs the Agent to start collecting indicator data of the Kafka node and upload it to the background interface. The background interface displays the monitoring status and indicator data graph for users to view and analyze.
[0079] In this embodiment, a tag adding request of an active server is received, and a basic usage tag is added to the active server; a resource type tag is added to the active server according to the resource type of the active server; the active server is associated with a preset monitoring template according to the basic usage tag and the resource type tag; the preset monitoring template includes preset monitoring indicators and preset alarm thresholds for servers of different tag types; the monitoring indicator data of the active server is obtained according to the preset monitoring indicators; if the monitoring indicator data exceeds the preset alarm threshold, an alarm message is sent. The purpose of efficient and automatic monitoring of servers is achieved.
[0080] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0081] Embodiment 2
[0082] Figure 7 The structural block diagram of a tag-based server monitoring device provided in the second embodiment of the present invention may specifically include the following modules:
[0083] The basic label adding module 201 is used to receive a label adding request from an active server and add a basic usage label to the active server;
[0084] A resource tag adding module 202, configured to add a resource type tag to the active server according to the resource type of the active server;
[0085] An association module 203 is used to associate the active server with a preset monitoring template according to the basic usage tag and the resource type tag; the preset monitoring template includes preset monitoring indicators and preset alarm thresholds for servers of different tag types;
[0086] A monitoring indicator data acquisition module 204, configured to acquire the monitoring indicator data of the active server according to the preset monitoring indicator;
[0087] The alarm module 205 is used to send an alarm message if the monitoring indicator data exceeds the preset alarm threshold.
[0088] Preferably, in another embodiment of the present invention, the preset monitoring template further includes a preset indicator collection interface set according to the preset monitoring indicator. The monitoring indicator data acquisition module 204 is also used to:
[0089] According to the preset monitoring indicators, obtain the corresponding preset indicator collection interface;
[0090] The monitoring indicator data of the active server is obtained through the preset indicator collection interface.
[0091] Preferably, in another embodiment of the present invention, the device further comprises:
[0092] A display module is used to display the monitoring indicator data and / or the alarm information on a user interface.
[0093] Preferably, in another embodiment of the present invention, the device further comprises:
[0094] A new request receiving module is added to receive new requests from the server;
[0095] The label adding module is used to mark the newly added server as an active server and add the basic usage label.
[0096] Preferably, in another embodiment of the present invention, the device further comprises:
[0097] The data request receiving module is used to receive the preset monitoring indicator collection request for the active server.
[0098] The tag-based server monitoring device provided in the embodiment of the present invention can execute the tag-based server monitoring method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0099] Embodiment 3
[0100] Figure 8 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 8 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 8 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0101] like Figure 8 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0102] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0103] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0104] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical medium) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0105] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0106] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the computer device 12, and / or may communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0107] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the tag-based server monitoring method provided in the embodiment of the present invention.
[0108] Embodiment 4
[0109] Embodiment 4 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned label-based server monitoring method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0110] Among them, computer-readable storage media may include, for example, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0111] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A tag-based server monitoring method, characterized in that: The method comprises: Receive a tag adding request from an active server, and add a basic usage tag to the active server; According to the resource type of the active server, adding a resource type tag to the active server; According to the basic usage tag and the resource type tag, the active server is associated with a preset monitoring template; the preset monitoring template includes preset monitoring indicators and preset alarm thresholds for servers of different tag types; According to the preset monitoring indicators, obtaining monitoring indicator data of the active server; If the monitoring indicator data exceeds the preset alarm threshold, an alarm message is sent.
2. The method according to claim 1, characterized in that Also includes: The monitoring indicator data and / or the alarm information are displayed on a user interface.
3. The method according to claim 1, characterized in that Also includes: Receive new requests from the server; The newly added server is marked as an active server, and the basic usage tag is added.
4. The method according to claim 1, characterized in that: The preset monitoring template also includes a preset indicator collection interface set according to the preset monitoring indicator.
5. The method according to claim 4, characterized in that Also includes: Receive the preset monitoring indicator collection request for the active server.
6. The method according to claim 5, characterized in that The acquiring the monitoring indicator data of the active server according to the preset monitoring indicator comprises: According to the preset monitoring indicators, obtain the corresponding preset indicator collection interface; The monitoring indicator data of the active server is obtained through the preset indicator collection interface.
7. A tag-based server monitoring device, characterized in that: The device comprises: A basic label adding module is used to receive a label adding request from an active server and add a basic usage label to the active server; A resource tag adding module, used for adding a resource type tag to the active server according to the resource type of the active server; An association module, configured to associate the active server with a preset monitoring template according to the basic usage tag and the resource type tag; the preset monitoring template includes preset monitoring indicators and preset alarm thresholds for servers of different tag types; A monitoring indicator data acquisition module, used to acquire the monitoring indicator data of the active server according to the preset monitoring indicator; The alarm module is used to send an alarm message if the monitoring indicator data exceeds the preset alarm threshold.
8. The device according to claim 7, characterized in that Also includes: A display module is used to display the monitoring indicator data and / or the alarm information on a user interface.
9. A computer device, characterized in that: The computer device comprises: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the tag-based server monitoring method as described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the tag-based server monitoring method according to any one of claims 1 to 6 is implemented.