Monitoring collection object management method and device
By configuring the agent registration module, indicator collection module, object configuration module and object delivery module at the center, the complexity of monitoring and collection object management caused by the increase in the number of agents in the distributed resource pool is solved, and unified management and automatic updates are achieved. Improved operation and maintenance efficiency.
Patent Information
- Application Number
- CN202410836499.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-08-27
AI Technical Summary
In a distributed resource pool, as the number of agents increases, operation and maintenance personnel need to manually configure monitoring and collection objects one by one, resulting in an increase in repetitive work, a waste of manpower and time, and the difficulty of configuration operations due to network conditions or security restrictions.
A monitoring and collection object management method is designed, including an agent registration module, an indicator collection module, an object configuration module and an object delivery module. Users configure it at the center, which can uniformly manage the collection objects of agents distributed in various resource pools without the need for Enter each resource pool to modify manually, and achieve automatic updates through network connectivity detection, hash value verification and push/pull methods.
It reduces the difficulty of configuration, significantly saves manpower and time, and improves the efficiency and convenience of monitoring and collection object management.
Smart Images

Figure CN118555201A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of monitoring technology, and in particular relates to a monitoring collection object management method and device. Background Art
[0002] With the rapid development of cloud computing technology, using edge resource pools to extend storage and computing resources to locations close to users and to uniformly manage the edge through the center has become one of the hottest technical directions. In this scenario, the commonly used monitoring framework is to deploy agents on the edge. The agents are responsible for collecting monitoring indicators of edge hardware and software and providing interfaces for exposing indicators. The central server can collect monitoring indicators of all edge terminals by calling the interfaces of all agents. However, this approach has a flaw: as the number of resource pools increases, the number of agents also gradually increases. At this time, when a new application is deployed in a resource pool, the operation and maintenance personnel need to enter each resource pool and manually add the corresponding monitoring collection objects to each agent. This involves a lot of repetitive work, which undoubtedly wastes operation and maintenance manpower and time. In addition, due to network conditions or security requirements, it is also difficult to enter each resource pool to configure the agent. Summary of the invention
[0003] In view of the above deficiencies in the prior art, the purpose of the invention is to provide a monitoring and collection object management method, device, electronic device and storage medium, which consists of an agent registration module, an indicator collection module, an object configuration module and an object distribution module. The framework, the user only needs to configure at the central end, can uniformly manage the collection objects of the agents distributed in each resource pool, no longer need to enter the resource pool to manually modify the monitoring configuration of the agent one by one, which reduces the difficulty of configuration and greatly saves manpower and time.
[0004] The first aspect of the present invention provides a monitoring collection object management method, which is applied to a distributed scenario and includes:
[0005] The agent registration module receives the service address of the user-registered agent and performs a network connectivity detection on the service address. If the network is connected, the registration is successful, and an agentId is generated for the successfully registered agent.
[0006] The indicator collection module reads the agentId and the service address corresponding to the agentId, calls the agent's service to collect indicators according to the service address corresponding to the agentId, and sends the agentId to the agent;
[0007] After receiving the user's add, delete, modify and query operations, the object configuration module performs add, delete, modify and query processing on the monitoring address of the monitoring collection object, and performs duplication verification on the monitoring collection objects under the same agent;
[0008] The object delivery module delivers the monitoring collection objects of the agent to the agent through push or pull mode;
[0009] The agent automatically updates based on the monitoring collection objects received.
[0010] Furthermore, in the above-mentioned monitoring collection object management method, performing network connectivity detection on the service address also includes:
[0011] If the network is not connected, the registration fails and the return code and return information are displayed.
[0012] Furthermore, in the above-mentioned monitoring collection object management method, performing duplication check on the monitoring collection objects under the same agent includes:
[0013] Get the monitoring address of the monitoring collection object and its associated agentId, obtain a hash value through the hash algorithm, and associate it with the monitoring collection object;
[0014] When adding a new monitoring collection object, check whether the hash value of the newly added monitoring collection object already exists;
[0015] If the verification result is that the hash value of the newly added monitoring collection object already exists, the newly added monitoring collection object fails.
[0016] Furthermore, in the above-mentioned monitoring collection object management method, the object sending module sends the monitoring collection object of the agent to the agent by push mode, including:
[0017] The object delivery module reads the service address corresponding to the agentId;
[0018] Check whether the monitoring collection object under the first agentId is updated;
[0019] If the detection result is that the monitoring collection object under the first agentId is updated, the latest monitoring collection object is pushed to the agent through the service address corresponding to the agentId.
[0020] Furthermore, in the above-mentioned monitoring collection object management method, the object sending module sends the monitoring collection object of the agent to the agent in a pull mode, including:
[0021] The agent needs to send agentId when accessing the object delivery service in the object delivery module;
[0022] The object delivery service returns the corresponding monitoring collection object to the agent according to the agentId.
[0023] Furthermore, in the above-mentioned monitoring and collection object management method, the agentId generated for the successfully registered agent is generated by a snowflake algorithm.
[0024] Furthermore, in the above-mentioned monitoring collection object management method, detecting whether the monitoring collection object under agentId is updated includes:
[0025] Periodically query all monitoring collection objects under the first agentId from the database, convert them into text, and use the MD5 algorithm to calculate a hash value;
[0026] Compare the hash values calculated twice before and after;
[0027] If the comparison result is that the hash values calculated twice are the same, the monitoring collection object is not updated; if the hash values calculated twice are different, the monitoring collection object is updated.
[0028] The second aspect of the present invention further provides a monitoring collection object management device, which is applied to a distributed scenario and includes:
[0029] Agent registration module: used to receive the service address of the user-registered agent, perform network connectivity detection on the service address, if the network is connected, the registration is successful, and generate agentId for the successfully registered agent;
[0030] Indicator collection module: used to read agentId and the service address corresponding to agentId, call the agent's service to collect indicators according to the service address corresponding to agentId, and send agentId to the agent;
[0031] Object configuration module: After receiving the user's add, delete, modify and query operations, it is used to add, delete, modify and query the monitoring address of the monitoring collection object, and perform duplication verification on the monitoring collection objects under the same agent;
[0032] Object delivery module: used to deliver the monitoring collection objects of the agent to the agent through push or pull mode;
[0033] Update module: used for the agent to automatically update according to the received monitoring collection objects.
[0034] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;
[0035] The processor is used to execute any one of the monitoring and acquisition object management methods described above by calling the program or instruction stored in the memory.
[0036] In a fourth aspect of the present invention, a computer-readable storage medium is further proposed, wherein the computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a monitoring and acquisition object management method as described in any one of the above items.
[0037] The beneficial effects of the present invention are as follows: the service address of the user-registered agent is received through the agent registration module, and the network connectivity detection is performed on the service address. If the network is connected, the registration is successful, and the agentId is generated for the successfully registered agent; the indicator collection module reads the agentId and the service address corresponding to the agentId, calls the agent's service according to the service address corresponding to the agentId to collect indicators, and sends the agentId to the agent; after the object configuration module receives the user's addition, deletion, modification and query operation, it adds, deletes, modifies and processes the monitoring address of the monitoring collection object, and performs a repeatability check on the monitoring collection object under the same agent; the object delivery module delivers the monitoring collection object of the agent to the agent through a push method or a pull method; the agent automatically updates according to the received monitoring collection object. The present invention is composed of an agent registration module, an indicator collection module, an object configuration module and an object delivery module to form a framework. The user only needs to configure at the central end to uniformly manage the collection objects of the agents distributed in each resource pool, and there is no need to enter the resource pool to manually modify the monitoring configuration of the agent one by one, which reduces the difficulty of configuration and greatly saves manpower and time. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0039] Figure 1 A diagram of a monitoring collection object management method provided by an embodiment of the present invention;
[0040] Figure 2 A method diagram for performing repeatability verification on monitoring and collection objects under the same agent provided by an embodiment of the present invention;
[0041] Figure 3 A method diagram of an object sending module sending monitoring collection objects of an agent to an agent by push mode provided in an embodiment of the present invention;
[0042] Figure 4 A method diagram of an object sending module sending monitoring collection objects of an agent to an agent in a pull mode provided by an embodiment of the present invention;
[0043] Figure 5 A method diagram of an object sending module detecting whether a monitoring collection object under agentId is updated provided in an embodiment of the present invention;
[0044] Figure 6 A diagram of a monitoring and collection object management device provided by an embodiment of the present invention;
[0045] Figure 7 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0047] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0048] In the description of the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be internal communication between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0049] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0050] The present invention proposes a monitoring and collection object management method, device, electronic device and storage medium, which are composed of an agent registration module, an indicator collection module, an object configuration module and an object distribution module to form a framework. Users only need to configure at the central end to uniformly manage the collection objects of agents distributed in various resource pools, and there is no need to enter the resource pool to manually modify the monitoring configuration of the agent one by one, which reduces the difficulty of configuration and greatly saves manpower and time.
[0051] Method Embodiment
[0052] Figure 1 A diagram of a monitoring and collection object management method provided in an embodiment of the present invention.
[0053] The first aspect of the present invention proposes a monitoring collection object management method, which is applied to distributed scenarios and combines Figure 1 , including five steps from S1 to S5:
[0054] S1: The agent registration module receives the service address of the user-registered agent and performs a network connectivity detection on the service address. If the network is connected, the registration is successful and an agentId is generated for the successfully registered agent.
[0055] Specifically, in the embodiment of the present invention, the agent registration module receives the service address of the user-registered agent and immediately performs a network connectivity detection on the service address of the user-registered agent. If the network is connected, the registration is successful. The agent registration module generates a globally unique agentId for the successfully registered agent using the snowflake algorithm.
[0056] S2: The indicator collection module reads the agentId and the service address corresponding to the agentId, calls the agent's service to collect indicators according to the service address corresponding to the agentId, and sends the agentId to the agent.
[0057] Specifically, in the embodiment of the present invention, the indicator collection module reads the agentId in the agent registration module and the service address corresponding to the agentId, calls the agent's service to collect indicators, and passes the agentId to the agent.
[0058] S3: After receiving the user's add, delete, modify and query operations, the object configuration module performs add, delete, modify and query processing on the monitoring address of the monitoring collection object, and performs duplication verification on the monitoring collection objects under the same agent.
[0059] Specifically, in the embodiment of the present invention, the user manages the monitoring and collection objects of the agent in the object configuration module, that is, adds, deletes, modifies and checks the monitoring addresses of the monitoring and collection objects. In order to prevent duplicate collection objects from being configured under the same agent, causing the agent to repeatedly pull a certain object and waste resources, the object configuration module will perform duplication verification on the collection objects under the same agent. The specific verification method is described in detail below.
[0060] S4: The object delivery module delivers the monitoring collection object of the agent to the agent through push or pull.
[0061] Specifically, in the embodiment of the present invention, the method in which the object sending module sends the monitoring collection object of the agent to the agent in a push manner or a pull manner is described in detail below.
[0062] S5: The agent automatically updates according to the received monitoring collection objects.
[0063] It should be understood that the framework is composed of the agent registration module, indicator collection module, object configuration module and object distribution module. Users only need to configure it at the center to uniformly manage the collection objects of the agents distributed in various resource pools. There is no need to enter the resource pool to manually modify the monitoring configuration of the agent one by one, which reduces the difficulty of configuration and greatly saves manpower and time.
[0064] Furthermore, in the above-mentioned monitoring collection object management method, performing network connectivity detection on the service address also includes:
[0065] If the network is not connected, the registration fails and the return code and return information are displayed.
[0066] Specifically, in the embodiment of the present invention, after the agent registration module receives the service address of the user registration agent, it will immediately perform a network connectivity detection on the service address of the user registration agent. If the network is not connected, the registration is unsuccessful. If the registration is unsuccessful, the return code and return information are displayed to help the user to troubleshoot network problems.
[0067] Figure 2 A method diagram for performing repeatability verification on monitoring and collection objects under the same agent provided by an embodiment of the present invention.
[0068] Furthermore, in the above-mentioned monitoring collection object management method, the monitoring collection objects under the same agent are checked for duplication. Figure 2 , including three steps from S21 to S23:
[0069] S21: Obtain the monitoring address of the monitoring collection object and its associated agentId, obtain a hash value through a hash algorithm, and associate it with the monitoring collection object;
[0070] S22: When adding a new monitoring and collection object, check whether the hash value of the newly added monitoring and collection object already exists;
[0071] S23: If the verification result is that the hash value of the newly added monitoring and collection object already exists, the newly added monitoring and collection object fails.
[0072] Specifically, in an embodiment of the present invention, the monitoring address of the monitoring and acquisition object and its associated agentId are obtained, a hash value is obtained through a hash algorithm, and the monitoring and acquisition object is associated; when a new monitoring and acquisition object is added, its hash value will be checked. If it is found that the hash value already exists, it means that the monitoring and acquisition object already exists, and the addition is unsuccessful.
[0073] Figure 3 A method diagram of an object sending module sending monitoring collection objects of an agent to an agent in a push manner is provided in an embodiment of the present invention.
[0074] Furthermore, in the above-mentioned monitoring collection object management method, the object sending module sends the monitoring collection object of the agent to the agent by push mode, combined with Figure 3 , including three steps from S31 to S33:
[0075] S31: The object delivery module reads the service address corresponding to the agentId;
[0076] S32: Detect whether the monitoring collection object under the first agentId is updated;
[0077] S33: If the detection result is that the monitoring collection object under the first agentId is updated, the latest monitoring collection object is pushed to the agent through the service address corresponding to the agentId.
[0078] Specifically, in the embodiment of the present invention, the first agentId can be any agentId. When the object sending module detects that the monitoring and collection object under a certain agentId is updated, it pushes the latest monitoring and collection object to the agent through the registration address corresponding to the agentId. The method by which the object sending module detects whether the monitoring and collection object under the first agentId is updated is described in detail below.
[0079] Figure 4 A method diagram of an object sending module sending monitoring collection objects of an agent to an agent in a pull mode is provided in an embodiment of the present invention.
[0080] Furthermore, in the above-mentioned monitoring collection object management method, the object sending module sends the monitoring collection object of the agent to the agent in a pull mode, combined with Figure 4 , including two steps from S41 to S42:
[0081] S41: the agent needs to send agentId when accessing the object delivery service in the object delivery module;
[0082] S42: The object delivery service returns the corresponding monitoring collection object to the agent according to the agentId.
[0083] Specifically, in the embodiment of the present invention, the object delivery module provides an object delivery service. When the agent accesses the service, it needs to pass the agentId parameter. The service returns the corresponding monitoring collection object according to the agentId, wherein the agentId is passed to the agent by the indicator collection module when calling the agent service.
[0084] Furthermore, in the above-mentioned monitoring and collection object management method, the agentId generated for the successfully registered agent is generated by a snowflake algorithm.
[0085] Figure 5 A method diagram of an object sending module detecting whether a monitoring collection object under an agentId is updated is provided in an embodiment of the present invention.
[0086] Furthermore, in the above-mentioned monitoring collection object management method, the object delivery module detects whether the monitoring collection object under agentId is updated, and combines Figure 5 , including three steps from S51 to S53:
[0087] S51: all monitoring collection objects under the first agentId are periodically queried from the database, converted into text, and a hash value is calculated using the MD5 algorithm;
[0088] S52: Compare the hash values calculated twice before and after;
[0089] S53: If the comparison result is that the hash values calculated twice are the same, the monitoring collection object is not updated; if the hash values calculated twice are different, the monitoring collection object is updated.
[0090] Specifically, in the embodiment of the present invention, the first agentId can be any agentId. A timer is set inside the object sending module, which will periodically query all monitoring and collection objects under a certain agentId from the database, convert them into text, and calculate a hash value using the MD5 algorithm. The timer compares the hash values calculated twice before and after. If they are the same, the monitored object has not been updated; otherwise, the monitored object has been updated, which triggers the push service.
[0091] Device Embodiment
[0092] Figure 6 A diagram of a monitoring and collection object management device provided in an embodiment of the present invention.
[0093] In a second aspect of the present invention, a monitoring collection object management device is also proposed, which is applied to a distributed scenario and combines Figure 7 ,include:
[0094] The agent registration module 61 is used to receive the service address of the user-registered agent, perform network connectivity detection on the service address, and if the network is connected, the registration is successful, and an agentId is generated for the successfully registered agent.
[0095] Specifically, in the embodiment of the present invention, the agent registration module 61 receives the service address of the user-registered agent and immediately performs a network connectivity detection on the service address of the user-registered agent. If the network is connected, the registration is successful. The agent registration module generates a globally unique agentId for the successfully registered agent using the snowflake algorithm.
[0096] The indicator collection module 62 is used to read the agentId and the service address corresponding to the agentId, call the agent's service to collect indicators according to the service address corresponding to the agentId, and send the agentId to the agent.
[0097] Specifically, in the embodiment of the present invention, the indicator collection module 62 reads the agentId in the agent registration module and the service address corresponding to the agentId, calls the agent's service to collect indicators, and passes the agentId to the agent.
[0098] Object configuration module 63: after receiving the user's add, delete, modify and query operation, it is used to add, delete, modify and query the monitoring address of the monitoring collection object, and perform duplication verification on the monitoring collection objects under the same agent.
[0099] Specifically, in the embodiment of the present invention, the user manages the monitoring and collection objects of the agent in the object configuration module 63, that is, adds, deletes, modifies and checks the monitoring addresses of the monitoring and collection objects. In order to prevent duplicate collection objects from being configured under the same agent, causing the agent to repeatedly pull a certain object and cause a waste of resources, the object configuration module will perform a duplication check on the collection objects under the same agent.
[0100] The object sending module 64 is used to send the monitoring collection object of the agent to the agent through the push mode or the pull mode.
[0101] Specifically, in the embodiment of the present invention, the object sending module 64 sends the monitoring collection object of the agent to the agent by push mode or pull mode, and the specific mode is the same as the method class.
[0102] Update module 65: used for the agent to automatically update according to the received monitoring collection objects.
[0103] It should be understood that the framework is composed of the agent registration module, indicator collection module, object configuration module and object distribution module. Users only need to configure it at the center to uniformly manage the collection objects of the agents distributed in various resource pools. There is no need to enter the resource pool to manually modify the monitoring configuration of the agent one by one, which reduces the difficulty of configuration and greatly saves manpower and time.
[0104] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;
[0105] The processor is used to execute any of the monitoring and acquisition object management methods described above by calling the program or instruction stored in the memory.
[0106] In a fourth aspect of the present invention, a computer-readable storage medium is further proposed, wherein the computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a monitoring and acquisition object management method as described in any one of the above items.
[0107] Figure 7 It is a schematic block diagram of an electronic device provided by an embodiment of the present invention.
[0108] like Figure 7As shown, the electronic device includes: at least one processor 701, at least one memory 702 and at least one communication interface 703. The various components in the electronic device are coupled together through a bus system 704. The communication interface 703 is used to transmit information between external devices. It can be understood that the bus system 704 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 704 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus system 704 .
[0109] It can be understood that the memory 702 in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.
[0110] In some implementations, the memory 702 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system and application programs.
[0111] The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. A program that implements any method in a monitoring acquisition object management method provided in an embodiment of the present invention can be included in the application.
[0112] In an embodiment of the present invention, the processor 701 calls a program or instruction stored in the memory 702, specifically, a program or instruction stored in an application, and the processor 701 is used to execute the steps of each embodiment of a monitoring and acquisition object management method provided in an embodiment of the present invention.
[0113] The agent registration module receives the service address of the user-registered agent and performs a network connectivity detection on the service address. If the network is connected, the registration is successful, and an agentId is generated for the successfully registered agent.
[0114] The indicator collection module reads the agentId and the service address corresponding to the agentId, calls the agent's service to collect indicators according to the service address corresponding to the agentId, and sends the agentId to the agent;
[0115] After receiving the user's add, delete, modify and query operations, the object configuration module performs add, delete, modify and query processing on the monitoring address of the monitoring collection object, and performs duplication verification on the monitoring collection objects under the same agent;
[0116] The object delivery module delivers the monitoring collection objects of the agent to the agent through push or pull mode;
[0117] The agent automatically updates based on the monitoring collection objects received.
[0118] Any method in a monitoring collection object management method provided in an embodiment of the present invention can be applied to the processor 701, or implemented by the processor 701. The processor 701 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 701 or an instruction in the form of software. The above processor 701 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.
[0119] The steps of any method in the monitoring collection object management method provided by the embodiment of the present invention can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software units in the decoding processor. The software unit can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 702, and the processor 701 reads the information in the memory 702 and completes the steps of the method in combination with its hardware.
[0120] Those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.
[0121] Those skilled in the art will appreciate that the description of each embodiment has its own emphasis, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0122] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
[0123] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A monitoring collection object management method, applied to distributed scenarios, characterized in that: include: The agent registration module receives the service address of the user-registered agent and performs a network connectivity detection on the service address. If the network is connected, the registration is successful, and an agentId is generated for the successfully registered agent. The indicator collection module reads the agentId and the service address corresponding to the agentId, calls the agent's service to collect indicators according to the service address corresponding to the agentId, and sends the agentId to the agent; After receiving the user's add, delete, modify and query operations, the object configuration module performs add, delete, modify and query processing on the monitoring address of the monitoring collection object, and performs duplication verification on the monitoring collection objects under the same agent; The object delivery module delivers the monitoring collection objects of the agent to the agent through push or pull mode; The agent automatically updates based on the monitoring collection objects received.
2. A monitoring collection object management method according to claim 1, characterized in that: The performing network connectivity detection on the service address further includes: If the network is not connected, the registration fails and the return code and return information are displayed.
3. A monitoring collection object management method according to claim 1, characterized in that: The repeatability check of the monitoring collection objects under the same agent includes: Get the monitoring address of the monitoring collection object and its associated agentId, obtain a hash value through the hash algorithm, and associate it with the monitoring collection object; When adding a new monitoring collection object, check whether the hash value of the newly added monitoring collection object already exists; If the verification result is that the hash value of the newly added monitoring collection object already exists, the newly added monitoring collection object fails.
4. A monitoring collection object management method according to claim 1, characterized in that: The object delivery module delivers the monitoring collection objects of the agent to the agent by push mode, including: The object delivery module reads the service address corresponding to the agentId; Check whether the monitoring collection object under the first agentId is updated; If the detection result is that the monitoring collection object under the first agentId is updated, the latest monitoring collection object is pushed to the agent through the service address corresponding to the agentId.
5. A monitoring collection object management method according to claim 1, characterized in that: The object delivery module delivers the monitoring collection objects of the agent to the agent in a pull mode, including: The agent needs to send agentId when accessing the object delivery service in the object delivery module; The object delivery service returns the corresponding monitoring collection object to the agent according to the agentId.
6. A monitoring collection object management method according to claim 1, characterized in that: The agentId generated for the successfully registered agent is generated by a snowflake algorithm.
7. A monitoring collection object management method according to claim 4, characterized in that: The step of detecting whether the monitoring collection object under agentId is updated includes: Periodically query all monitoring collection objects under the first agentId from the database, convert them into text, and use the MD5 algorithm to calculate a hash value; Compare the hash values calculated twice; If the comparison result is that the hash values calculated twice are the same, the monitoring collection object is not updated; if the hash values calculated twice are different, the monitoring collection object is updated.
8. A monitoring collection object management device, applied to distributed scenarios, characterized in that: include: Agent registration module: used to receive the service address of the user-registered agent, perform network connectivity detection on the service address, if the network is connected, the registration is successful, and generate agentId for the successfully registered agent; Indicator collection module: used to read agentId and the service address corresponding to agentId, call the agent's service to collect indicators according to the service address corresponding to agentId, and send agentId to the agent; Object configuration module: After receiving the user's add, delete, modify and query operations, it is used to add, delete, modify and query the monitoring address of the monitoring collection object, and perform duplication verification on the monitoring collection objects under the same agent; Object delivery module: used to deliver the monitoring collection objects of the agent to the agent through push or pull mode; Update module: used for the agent to automatically update according to the received monitoring collection objects.
9. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute a monitoring and acquisition object management method as described in any one of claims 1 to 7 by calling the program or instruction stored in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a monitoring and acquisition object management method as described in any one of claims 1 to 7.
