A method for collecting data, monitored equipment and monitoring server
By triggering the execution of monitoring scripts on the monitored equipment in the financial system and sending data to the monitoring server, the problem in the existing technology of being unable to collect multiple monitoring item data at the same time is solved, and the accuracy of the analysis results and equipment security are achieved.
Patent Information
- Application Number
- CN201910524242.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-18
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2039-06-18
AI Technical Summary
In financial systems, existing technology cannot collect data on multiple monitoring items at the same time, resulting in inaccurate indicator analysis results.
By installing the agent component on the monitored device and triggering the execution of the monitoring script, the data of each monitoring item is collected, and its identification and data are sent to the monitoring server. The capture component is used to obtain the data of each monitoring item according to the corresponding relationship to achieve batch collection. , and define execution parameters in the monitoring script to reduce the pressure on the monitoring server.
It achieves the accuracy of analysis results and load balancing of monitoring servers, while improving the security of monitored devices and avoiding the need for remote login and script control commands.
Smart Images

Figure CN110290190B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of science and technology finance technology, and in particular to a method for collecting data, a monitored device and a monitoring server. Background Art
[0002] With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually transforming to Fintech. However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology. At present, when monitoring the performance indicators of each machine in the financial system and the health status of the service software, the agent component installed on the monitored device is mainly used to directly collect data, and then report the collected data to the monitoring server. Since the agent component cannot be driven to collect data of a batch of monitoring items at the same time in this method, it can only be collected one by one. However, sometimes it is necessary to analyze whether a certain indicator is normal based on the values of multiple monitoring items at the same time, which leads to inaccurate analysis results. Summary of the invention
[0003] When data is collected directly by using an agent component, data of a batch of monitoring items cannot be collected at the same time, which leads to the problem of inaccurate indicator analysis results. The embodiment of the present invention provides a method for collecting data, a monitored device and a monitoring server.
[0004] In one aspect, an embodiment of the present invention provides a method for collecting data, comprising:
[0005] The monitored device receives the proxy component calling instruction sent by the monitoring server, and the proxy component is installed on the monitored device;
[0006] The agent component of the monitored device triggers the execution of the monitoring script to obtain the monitoring data of each monitoring item;
[0007] The monitored device uses a sending script to send the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server, so that the capture component of the monitoring server obtains the monitoring data of each monitoring item according to the correspondence between the identification of each monitoring item and the monitoring data of each monitoring item. The capture component of the monitoring server pre-saves the identification of each monitoring item.
[0008] Optionally, before the monitored device uses a sending script to send the monitoring data of each monitoring item to the monitoring server, the method further includes:
[0009] The monitored device adds a field for indicating successful acquisition in the monitoring data of each monitoring item.
[0010] Optionally, it also includes:
[0011] When an error occurs in the execution of the monitoring script, the monitored device does not add a field for marking successful collection in the monitoring data of each monitoring item;
[0012] The monitored device sends an empty set of monitoring data to the monitoring server by sending a script, so that the monitoring server triggers an alarm.
[0013] Optionally, the monitored device uses a sending script to send the monitoring data of each monitoring item to the monitoring server, including:
[0014] The monitored device uses a sending script to send the identification of each monitoring item and the monitoring data of each monitoring item to the proxy server, so that the proxy server sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server.
[0015] Optionally, the identification of each monitoring item in the capture component of the monitoring server is obtained by using an automatic discovery rule.
[0016] In one aspect, an embodiment of the present invention provides a method for collecting data, comprising:
[0017] The monitoring server sends an agent component calling instruction to the monitored device, on which the agent component is installed, so that the agent component of the monitored device triggers the execution of the monitoring script to obtain monitoring data of each monitoring item;
[0018] The monitoring server receives the identifier of each monitoring item and the monitoring data of each monitoring item sent by the monitored device using a sending script;
[0019] The capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item. The capture component of the monitoring server pre-saves the identifier of each monitoring item.
[0020] In one aspect, an embodiment of the present invention provides a monitored device, including:
[0021] A first receiving module, used for receiving an agent component calling instruction sent by a monitoring server;
[0022] The agent component is used to trigger the execution of monitoring scripts and obtain monitoring data for each monitoring item;
[0023] The first sending module is used to use a sending script to send the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server, so that the capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identification of each monitoring item and the monitoring data of each monitoring item. The capture component of the monitoring server pre-saves the identification of each monitoring item.
[0024] Optionally, it also includes adding modules;
[0025] The adding module is specifically used for:
[0026] Before using the sending script to send the monitoring data of each monitoring item to the monitoring server, a field for marking successful collection is added to the monitoring data of each monitoring item.
[0027] Optionally, the adding module is further used for:
[0028] When an error occurs in the execution of the monitoring script, a field for indicating successful collection is not added to the monitoring data of each monitoring item;
[0029] The first sending module is also used for:
[0030] An empty set of monitoring data is sent to the monitoring server by sending a script, so that the monitoring server triggers an alarm.
[0031] Optionally, the first sending module is specifically configured to:
[0032] The identification of each monitoring item and the monitoring data of each monitoring item are sent to the proxy server by using a sending script, so that the proxy server sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server.
[0033] Optionally, the identification of each monitoring item in the capture component of the monitoring server is obtained by using an automatic discovery rule.
[0034] In one aspect, an embodiment of the present invention provides a monitoring server, comprising:
[0035] A second sending module is used to send an agent component calling instruction to a monitored device, where an agent component is installed, so that the agent component of the monitored device triggers the execution of a monitoring script to obtain monitoring data of each monitoring item;
[0036] A second receiving module is used to receive the identification of each monitoring item and the monitoring data of each monitoring item sent by the monitored device using a sending script;
[0037] The capture component is used to obtain the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item. The capture component pre-saves the identifier of each monitoring item.
[0038] In one aspect, an embodiment of the present invention provides a data acquisition system, comprising:
[0039] Monitored devices and monitoring servers;
[0040] The monitoring server sends an agent component calling instruction to the monitored device;
[0041] The agent component of the monitored device triggers the execution of the monitoring script to obtain monitoring data of each monitoring item, and the agent component is installed on the monitored device;
[0042] The monitored device uses a sending script to send the identifier of each monitoring item and the monitoring data of each monitoring item to the monitoring server;
[0043] The capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item. The capture component of the monitoring server pre-saves the identifier of each monitoring item.
[0044] On the one hand, an embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for collecting data when executing the program.
[0045] On the one hand, an embodiment of the present invention provides a computer-readable storage medium storing a computer program executable by a computer device, which enables the computer device to perform the steps of the method for collecting data when the program is run on the computer device.
[0046] In the embodiment of the present invention, an agent component is installed on the monitored device, and a monitoring script is set at the same time. The monitoring server calls the agent component so that the agent component triggers the execution of the monitoring script to obtain the monitoring data of each monitoring item. The monitored device sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server. Since the monitoring data of each monitoring item is obtained by using the agent component to trigger the execution of the monitoring script instead of using the agent component to collect the monitoring data, the one-time batch collection of monitoring data is realized. When it is necessary to analyze whether a certain indicator is normal based on the values of multiple monitoring items at the same time, the accuracy of the analysis result is guaranteed. Secondly, the monitoring script runs on the monitored device, which does not put pressure on the monitoring server; in addition, by defining the execution parameters in the monitoring script and running it directly on the monitored device, the monitored device does not need to authorize the monitoring server to remotely log in and execute related script control commands, thereby improving the security of the monitored device. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0048] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention;
[0049] Figure 2 A flow chart of a method for collecting data provided by an embodiment of the present invention;
[0050] Figure 3 A flow chart of a method for collecting data provided by an embodiment of the present invention;
[0051] Figure 4 A schematic diagram of the structure of a monitored device provided by an embodiment of the present invention;
[0052] Figure 5 A schematic diagram of the structure of a monitoring server provided by an embodiment of the present invention;
[0053] Figure 6 A structural schematic diagram of a data acquisition system provided by an embodiment of the present invention;
[0054] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and beneficial effects of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0056] For ease of understanding, the terms involved in the embodiments of the present invention are explained below.
[0057] Zabbix: Zabbix is an enterprise-level distributed open source monitoring solution. It is a software that can monitor various network parameters as well as server health and integrity. Zabbix uses a flexible notification mechanism that allows users to configure email-based alerts for almost any event. This allows for quick feedback on server problems. Based on the stored data, Zabbix provides excellent reporting and data visualization capabilities. These features make Zabbix an ideal solution for capacity planning. Zabbix supports active polling and passive capture. All Zabbix reports, statistics, and configuration parameters can be accessed through a web-based front-end page. The web-based front-end page ensures that the network status and server health can be evaluated from any aspect. When properly configured, Zabbix can play an important role in IT infrastructure monitoring.
[0058] The method for collecting data in the embodiment of the present invention can be applied to Figure 1 In the application scenario shown, the scenario includes a monitoring server 101 and a monitored device 102, wherein the monitoring server 101 can be a Zabbix monitoring server, the monitored device 102 can be a business server of a financial institution such as a bank, and the monitored device 102 can be one or more. An agent component is installed in each monitored device 102, and the agent component can be a Zabbix agent component. A monitoring script is set in each monitored device 102, and the execution parameters of the monitoring script are specified when creating each monitoring item. When the monitoring server 101 calls the agent component on the monitored device 102, the agent component triggers the execution of the monitoring script to obtain the monitoring data of each monitoring item. The monitored device 102 sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server 101 in a one-to-one correspondence. The monitoring server 101 includes a capture component, which uses an automatic discovery rule to obtain the identification of each monitoring item in advance. The capture component obtains the monitoring data of each monitoring item according to the one-to-one correspondence between the identification of each monitoring item and the monitoring data of each monitoring item.
[0059] based on Figure 1 As shown in the application scenario diagram, the embodiment of the present invention provides a process of a method for collecting data, and the process of the method can be interactively executed by the monitored device and the monitoring server, such as Figure 2As shown, the following steps are included:
[0060] Step S201: The monitoring server sends an agent component calling instruction to the monitored device.
[0061] Specifically, an agent component is installed on the monitored device.
[0062] Step S202: The agent component of the monitored device triggers the execution of the monitoring script to obtain monitoring data of each monitoring item.
[0063] Specifically, the monitoring data of each monitoring item can be the operation data of the big data platform component, the survival indicator data, the big data resource data, etc. The execution parameters of the monitoring script are specified when creating each monitoring item. The monitoring script generates and executes relevant commands according to the execution parameters.
[0064] Step S203: The monitored device uses a sending script to send the identifier of each monitoring item and the monitoring data of each monitoring item to the monitoring server.
[0065] Specifically, the sending script includes two methods, ZabbixMetric and ZabbixSender. ZabbixMetric encapsulates data into data packets according to the format of the zabbix sender protocol, and the actual data is stored in the json in the third paragraph. ZabbixSender is mainly used to obtain socket communication with the zabbix monitoring server and send data packets to port 10050 listened by the zabbix monitoring server.
[0066] The monitored device sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server in the form of (key-value).
[0067] Step S204: the capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item.
[0068] Specifically, the capture component of the monitoring server pre-saves the identification of each monitoring item, and uses the identification of each monitoring item and the corresponding relationship between the identification of each monitoring item and the monitoring data of each monitoring item to write back the monitoring data to obtain the monitoring data of each monitoring item.
[0069] In the embodiment of the present invention, an agent component is installed on the monitored device, and a monitoring script is set at the same time. The monitoring server calls the agent component so that the agent component triggers the execution of the monitoring script to obtain the monitoring data of each monitoring item. The monitored device sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server. Since the monitoring data of each monitoring item is obtained by using the agent component to trigger the execution of the monitoring script instead of using the agent component to collect the monitoring data, the one-time batch collection of monitoring data is realized. When it is necessary to analyze whether a certain indicator is normal based on the values of multiple monitoring items at the same time, the accuracy of the analysis result is guaranteed. Secondly, the monitoring script runs on the monitored device, which does not put pressure on the monitoring server; in addition, by defining the execution parameters in the monitoring script and running it directly on the monitored device, the monitored device does not need to authorize the monitoring server to remotely log in and execute related script control commands, thereby improving the security of the monitored device.
[0070] Optionally, before the above step S203, the monitored device adds a field for marking successful collection in the monitoring data of each monitoring item. When receiving the monitoring data, the monitoring server monitors the preset fields in the monitoring data. If the monitoring data includes a field marking successful collection, it means that there is no error in the execution of the monitoring script and the data collection is successful.
[0071] Optionally, when an error occurs in the execution of the monitoring script, the monitored device does not add a field for indicating successful collection in the monitoring data of each monitoring item, and the monitored device sends an empty set of monitoring data to the monitoring server by sending a script, so that the monitoring server triggers an alarm. Specifically, after receiving the monitoring data, the monitoring server monitors the preset fields in the monitoring data. If the monitoring data does not include a field indicating successful collection, it means that an error occurred during the execution of the monitoring script and data collection failed, thereby triggering an alarm.
[0072] Whether the monitoring data is successfully collected is marked by adding or not adding a field for indicating successful collection in the monitoring data. Therefore, the monitoring server can promptly discover the failure of data collection when receiving the monitoring data, thereby ensuring the validity of the monitoring data.
[0073] Optionally, in order to reduce the pressure on the monitoring server, a proxy server can be set up between the monitoring server and the monitored device. The monitored device uses a sending script to send the identification of each monitoring item and the monitoring data of each monitoring item to the proxy server, and then the proxy server sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server.
[0074] In the specific implementation, proxy servers can be set up in different areas respectively. The proxy server in each area is used to receive monitoring data sent by the monitored devices in that area, and then the proxy server sends the collected monitoring data to the monitoring server in a unified manner, thereby realizing distributed monitoring and reducing the pressure on the monitoring server.
[0075] Optionally, the capture component of the monitoring server pre-saves the identification of each monitoring item. When there are fewer monitoring items, the identification of each monitoring item can be set manually. However, when there are more monitoring items, the manual setting method is not easy to implement. For this reason, the identification of each monitoring item in the capture component of the monitoring server can be obtained by using automatic discovery rules. Specifically, a monitoring prototype of multiple monitoring items is defined in the monitoring server, and a monitoring item identification discovery script is set in the monitored device. The monitoring server discovers the script execution request to the monitored device, and the script execution request carries the monitoring prototype. The monitored device executes the monitoring item identification discovery script, determines the monitoring item identification corresponding to the monitoring prototype, and then sends the monitoring item identification to the monitoring server. Compared with manual setting, the automatic discovery rule is used to determine the identification of the monitoring item, which greatly improves efficiency.
[0076] Optionally, since the agent component sets a collection timeout for the monitoring item, such as 30 seconds, if the monitoring data of the monitoring item is not collected within 30 seconds, the collection thread will end, but the running of the monitoring script may far exceed 30 seconds, which will cause the collection thread to end before the monitoring script is fully executed. To this end, in the embodiment of the present invention, a multi-threaded execution monitoring script is used to obtain monitoring data, and the monitoring data is sent to the monitoring server in an asynchronous manner, thereby avoiding abnormal interruption of the monitoring script and affecting the collection of monitoring data.
[0077] In order to better explain the embodiment of the present invention, a method for collecting data provided by the embodiment of the present invention is described below in conjunction with a specific implementation scenario. The method is interactively executed by the monitored device, the proxy server, and the monitoring server, such as Figure 3 As shown, the method comprises the following steps:
[0078] Step S301: the monitoring server sends an agent component calling instruction to the agent server.
[0079] Step S302: the proxy server sends a proxy component calling instruction to the monitored device.
[0080] One proxy server corresponds to multiple monitored devices in one area.
[0081] Step S303: the agent component of the monitored device triggers the execution of the monitoring script to obtain monitoring data of each monitoring item.
[0082] Step S304: The monitored device adds a field for indicating successful collection in the monitoring data of each monitoring item.
[0083] Step S305: The monitored device uses a sending script to send the identifier of each monitoring item and the monitoring data of each monitoring item to the proxy server.
[0084] Step S306: The proxy server sends the identifier of each monitoring item and the monitoring data of each monitoring item to the monitoring server.
[0085] Step S307: the monitoring server monitors the preset fields in the monitoring data and determines that the monitoring data includes a field for identifying successful collection.
[0086] Step S308: The capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item.
[0087] The monitoring server uses automatic discovery rules to obtain the identification of each monitoring item. The capture component uses the identification of each monitoring item and the corresponding relationship between the identification of each monitoring item and the monitoring data of each monitoring item to write back the monitoring data to obtain the monitoring data of each monitoring item.
[0088] Since the monitoring data of each monitoring item is obtained by triggering the execution of the monitoring script by the proxy component instead of collecting monitoring data by the proxy component, the monitoring data can be collected in batches at one time. When it is necessary to analyze whether a certain indicator is normal based on the values of multiple monitoring items at the same time, the accuracy of the analysis results is guaranteed. Secondly, the monitoring script runs on the monitored device, which does not put pressure on the monitoring server. In addition, by defining the execution parameters in the monitoring script and running it directly on the monitored device, the monitored device does not need to authorize the monitoring server to log in remotely and execute related script control commands, which improves the security of the monitored device.
[0089] Based on the same technical concept, an embodiment of the present invention provides a monitored device, such as Figure 4 As shown, the monitored device 400 includes:
[0090] The first receiving module 401 is used to receive the proxy component calling instruction sent by the monitoring server;
[0091] Agent component 402, used to trigger the execution of monitoring scripts and obtain monitoring data of each monitoring item;
[0092] The first sending module 403 is used to use a sending script to send the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server, so that the capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identification of each monitoring item and the monitoring data of each monitoring item. The capture component of the monitoring server pre-saves the identification of each monitoring item.
[0093] Optionally, it also includes an adding module 404;
[0094] The adding module 404 is specifically used for:
[0095] Before using the sending script to send the monitoring data of each monitoring item to the monitoring server, a field for marking successful collection is added to the monitoring data of each monitoring item.
[0096] Optionally, the adding module 404 is further used for:
[0097] When an error occurs in the execution of the monitoring script, a field for indicating successful collection is not added to the monitoring data of each monitoring item;
[0098] The first sending module 403 is further used for:
[0099] An empty set of monitoring data is sent to the monitoring server by sending a script, so that the monitoring server triggers an alarm.
[0100] Optionally, the first sending module 403 is specifically configured to:
[0101] The identification of each monitoring item and the monitoring data of each monitoring item are sent to the proxy server by using a sending script, so that the proxy server sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server.
[0102] Optionally, the identification of each monitoring item in the capture component of the monitoring server is obtained by using an automatic discovery rule.
[0103] Based on the same technical concept, the embodiment of the present invention provides a monitoring server, such as Figure 5 As shown, the monitoring server 500 includes:
[0104] The second sending module 501 is used to send an agent component calling instruction to a monitored device, on which an agent component is installed, so that the agent component of the monitored device triggers the execution of a monitoring script to obtain monitoring data of each monitoring item;
[0105] The second receiving module 502 is used to receive the identification of each monitoring item and the monitoring data of each monitoring item sent by the monitored device using the sending script;
[0106] The capture component 503 is used to obtain the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item. The capture component saves the identifier of each monitoring item in advance.
[0107] Based on the same technical concept, the embodiment of the present invention provides a data acquisition system, such as Figure 6 As shown, the system 600 includes:
[0108] Monitored device 601, monitoring server 602;
[0109] The monitoring server 602 sends an agent component calling instruction to the monitored device;
[0110] The agent component of the monitored device 601 triggers the execution of the monitoring script to obtain the monitoring data of each monitoring item, and the agent component is installed on the monitored device;
[0111] The monitored device 601 uses a sending script to send the identifier of each monitoring item and the monitoring data of each monitoring item to the monitoring server;
[0112] The capture component of the monitoring server 602 obtains the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item. The capture component of the monitoring server pre-saves the identifier of each monitoring item.
[0113] Based on the same technical concept, an embodiment of the present invention provides a computer device, such as Figure 7 As shown, it includes at least one processor 701 and a memory 702 connected to the at least one processor. The specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present invention. Figure 7 For example, the processor 701 and the memory 702 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0114] In the embodiment of the present invention, the memory 702 stores instructions that can be executed by at least one processor 701 , and the at least one processor 701 can execute the steps included in the aforementioned method for collecting data by executing the instructions stored in the memory 702 .
[0115] Among them, the processor 701 is the control center of the computer device, which can use various interfaces and lines to connect various parts of the computer device, and collect data by running or executing instructions stored in the memory 702 and calling data stored in the memory 702. Optionally, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0116] The processor 701 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0117] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 702 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 702 is any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiment of the present invention can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0118] Based on the same technical concept, an embodiment of the present invention provides a computer-readable storage medium storing a computer program executable by a computer device. When the program runs on the computer device, the computer device executes the steps of the method for collecting data.
[0119] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0121] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0123] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0124] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for collecting data, characterized in that: include: The monitored device receives the proxy component calling instruction sent by the monitoring server, and the proxy component is installed on the monitored device; The agent component of the monitored device triggers the multi-threaded execution of the monitoring script to obtain the monitoring data of each monitoring item at the same time, wherein the execution parameters are defined in the monitoring script and run directly on the monitored device, and the execution parameters of the monitoring script are specified when creating each monitoring item; The monitored device uses a sending script to send the identifier of each monitoring item and the monitoring data of each monitoring item to the proxy server in an asynchronous manner, so that the proxy server sends the identifier of each monitoring item and the monitoring data of each monitoring item to the monitoring server, and the capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item, and the capture component of the monitoring server pre-saves the identifier of each monitoring item; Proxy servers are set up in different areas. The proxy server in each area is used to receive monitoring data sent by the monitored devices in the corresponding area, and the proxy server sends the collected monitoring data to the monitoring server in a unified manner; A monitoring prototype of multiple monitoring items is defined in a monitoring server, and a monitoring item identifier discovery script is set in the monitored device; the monitored device receives a script execution request sent by the monitoring server, and the script execution request carries the monitoring prototype; the monitoring item identifier discovery script is executed to determine the monitoring item identifier corresponding to the monitoring prototype, and the monitoring item identifier is sent to the monitoring server.
2. The method according to claim 1, characterized in that Before the monitored device uses the sending script to send the monitoring data of each monitoring item to the proxy server in an asynchronous manner, the method further includes: The monitored device adds a field for indicating successful acquisition in the monitoring data of each monitoring item.
3. The method according to claim 2, characterized in that Also includes: When an error occurs in the execution of the monitoring script, the monitored device does not add a field for marking successful collection in the monitoring data of each monitoring item; The monitored device sends an empty set of monitoring data to the monitoring server by sending a script, so that the monitoring server triggers an alarm.
4. A method for collecting data, characterized in that: include: The monitoring server sends an agent component call instruction to the monitored device, on which the agent component is installed, so that the agent component of the monitored device triggers the execution of a monitoring script to obtain monitoring data of each monitoring item at the same time, wherein execution parameters are defined in the monitoring script and directly run on the monitored device, and the execution parameters of the monitoring script are specified when creating each monitoring item; The monitoring server receives the identifiers of each monitoring item and the monitoring data of each monitoring item sent by the proxy server, wherein the identifiers of each monitoring item and the monitoring data of each monitoring item are sent to the proxy server by the monitored device in an asynchronous manner using a sending script; proxy servers are respectively set in different areas, and the proxy server in each area is used to receive the monitoring data sent by the monitored device in the corresponding area, and the proxy server uniformly sends the collected monitoring data to the monitoring server; The capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item, and the capture component of the monitoring server pre-saves the identifier of each monitoring item; A monitoring prototype of multiple monitoring items is defined in a monitoring server, and a monitoring item identifier discovery script is set in the monitored device; the monitoring server sends a script execution request to the monitored device, and the script execution request carries the monitoring prototype, so that the monitored device executes the monitoring item identifier discovery script, determines the monitoring item identifier corresponding to the monitoring prototype, and sends the monitoring item identifier to the monitoring server.
5. A monitored device, characterized in that: include: A first receiving module, used for receiving an agent component calling instruction sent by a monitoring server; An agent component is used to trigger the multi-threaded execution of a monitoring script to obtain monitoring data of each monitoring item at the same time, wherein execution parameters are defined in the monitoring script and run directly on the monitored device, and the execution parameters of the monitoring script are specified when creating each monitoring item; The first sending module is used to use a sending script to send the identification of each monitoring item and the monitoring data of each monitoring item to the proxy server in an asynchronous manner, so that the proxy server sends the identification of each monitoring item and the monitoring data of each monitoring item to the monitoring server, and the capture component of the monitoring server obtains the monitoring data of each monitoring item according to the corresponding relationship between the identification of each monitoring item and the monitoring data of each monitoring item, and the capture component of the monitoring server pre-saves the identification of each monitoring item; proxy servers are set up in different areas respectively, and the proxy server in each area is used to receive the monitoring data sent by the monitored equipment in the corresponding area, and the proxy server uniformly sends the collected monitoring data to the monitoring server; The first receiving module is further used to define monitoring prototypes of multiple monitoring items in the monitoring server, and set a monitoring item identifier discovery script in the monitored device; the monitored device receives a script execution request sent by the monitoring server, and the script execution request carries the monitoring prototype; executes the monitoring item identifier discovery script to determine the monitoring item identifier corresponding to the monitoring prototype; The first sending module is further used to send the monitoring item identifier to the monitoring server.
6. A monitoring server, characterized in that: include: A second sending module is used to send an agent component call instruction to a monitored device, on which an agent component is installed, so that the agent component of the monitored device triggers the multi-threaded execution of a monitoring script to obtain monitoring data of each monitoring item at the same time, wherein execution parameters are defined in the monitoring script and run directly on the monitored device, and the execution parameters of the monitoring script are specified when creating each monitoring item; A second receiving module is used to receive the identification of each monitoring item and the monitoring data of each monitoring item sent by the proxy server, wherein the identification of each monitoring item and the monitoring data of each monitoring item are sent to the proxy server by the monitored device in an asynchronous manner using a sending script; proxy servers are respectively set in different areas, and the proxy server in each area is used to receive the monitoring data sent by the monitored device in the corresponding area, and the proxy server uniformly sends the collected monitoring data to the monitoring server; A capture component, used to obtain the monitoring data of each monitoring item according to the corresponding relationship between the identifier of each monitoring item and the monitoring data of each monitoring item, and the capture component pre-saves the identifier of each monitoring item; The second sending module is further used to send a script execution request to the monitored device, wherein the script execution request carries a monitoring prototype, so that the monitored device executes a monitoring item identifier discovery script to determine a monitoring item identifier corresponding to the monitoring prototype; The second receiving module is further used to receive the monitoring item identifier sent by the monitored device.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method described in any one of claims 1 to 3 or claim 4 are implemented.
8. A computer-readable storage medium, characterized in that: It stores a computer program executable by a computer device. When the program is run on the computer device, the computer device executes the steps of the method described in any one of claims 1 to 3 or claim 4.
