Method, device and equipment for monitoring system data acquisition and storage medium
By obtaining switch performance information and determining data item type information, multiple OID indicators are collected through one snmp request, solving the problem of large system resource overhead and long collection time caused by excessive snmp requests, and improving the efficiency of the switch monitoring data acquisition.
Patent Information
- Application Number
- CN202411708526.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2044-11-26
AI Technical Summary
In the prior art, excessive snmp requests lead to large system resource overhead and long collection time, which affects the switch data acquisition efficiency.
By obtaining switch performance information, determining data item type information, and collecting multiple OID indicators through a snmp request, reducing system resource overhead and collection time.
It improves the efficiency of the switch monitoring data acquisition, reduces the overhead and acquisition time of system resources.
Smart Images

Figure CN119835192A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of monitoring technology, and in particular to a method, a device, a equipment and a storage medium for collecting data of a monitoring system. Background Art
[0002] The monitoring and alarm system (Prometheus) has good data storage characteristics and is widely used in the monitoring field. The switch data collection component (snmp-exporter) is adapted to Prometheus. The snmp-exporter uses the Simple Network Management Protocol (snmp) protocol to obtain switch data and provides the obtained switch data to Prometheus.
[0003] In the related technology, the snmp-exporter only supports the collection of one object identifier (OID) per snmp request. OID is used to locate a data item. In large-scale data collection scenarios, when collecting OID indicators of many types of switches, it is necessary to send snmp requests one by one. Each request contains an OID indicator for this query, and the next request is sent after the switch completes the previous snmp request. Too many snmp requests increase the system resource overhead on the one hand, and greatly increase the collection time on the other hand, affecting the efficiency of switch data collection. Summary of the invention
[0004] In view of this, the present invention provides a method, apparatus, device and storage medium for monitoring system data collection to solve the problem that too many SNMP requests cause excessive system resource overhead, require a long collection time, and affect the switch data collection efficiency.
[0005] In a first aspect, the present invention provides a method for data collection in a monitoring system, the method comprising: obtaining a data collection task; obtaining switch performance information, and obtaining target switch performance information based on the data collection task and the switch performance information; determining data item type information for data collection based on the target switch performance information, writing the data item type information into a simple network management protocol, obtaining a simple network management protocol request, sending the simple network management protocol request to a corresponding switch, and collecting switch monitoring data.
[0006] In an optional implementation, obtaining the target switch performance information based on the data collection task and the switch performance information includes: querying from the switch performance information based on the switch Internet Protocol address to obtain the target switch performance information corresponding to the switch Internet Protocol address; wherein the target switch performance information includes a target switch central processing unit utilization rate and a target switch memory utilization rate; and the data collection task includes the switch Internet Protocol address.
[0007] In an optional implementation, the determining the data item type information for data collection based on the target switch performance information includes: determining a first number of data items corresponding to the target switch central processor usage based on the target switch central processor usage, and determining the first number based on the product of the first number of data items and a first preset threshold; determining a second number of data items corresponding to the target switch memory usage based on the target switch memory usage, and determining a second number based on the product of the second number of data items and a second preset threshold, wherein the sum of the first preset threshold and the second preset threshold is one; determining the number of data item types based on the sum of the first number and the second number, and determining the data item type information based on the number of data item types.
[0008] In an optional embodiment, the aforementioned method for monitoring system data collection also includes: dividing the CPU usage into multiple CPU usage levels, each of the CPU usage levels corresponding to a different number of data items; dividing the switch memory usage into multiple memory usage levels, each of the memory usage levels corresponding to a different number of data items.
[0009] In an optional embodiment, the aforementioned method for monitoring system data collection also includes: determining the target data item type information for the next remaining data collection based on the data item type information; and collecting the remaining switch monitoring data based on the target data item type information until the data collection task is completed.
[0010] In an optional embodiment, the aforementioned method for monitoring system data collection also includes: if the monitoring data representation of the first data item type in the switch monitoring data, this simple network management protocol request has traversed all nodes under the first data item type, and a subsequent simple network management protocol request is performed to collect monitoring data of other data item types in the remaining data.
[0011] In an optional embodiment, the aforementioned method for monitoring system data collection also includes: if the monitoring data representation of the second data item type in the switch monitoring data contains nodes under the second data item type that have not been traversed by this simple network management protocol request, obtaining the last node of the monitoring data of the second data item type in the switch monitoring data; using the last node as the starting node of the second data item type for the next remaining data collection until all nodes under the second data item type are traversed.
[0012] In a second aspect, the present invention provides a device for monitoring system data collection, comprising a monitoring module, a switch data collection module and a switch performance detection module; the monitoring module is used to send a data collection task to the switch data collection module; the switch data collection module is used to obtain the data collection task and send the data collection task to the switch performance detection module; the switch performance detection module is used to obtain switch performance information, obtain the data collection task, obtain target switch performance information based on the data collection task and the switch performance information, and send the target switch performance information to the switch data collection module; the switch data collection module is also used to obtain the target switch performance information from the switch performance detection module based on the data collection task, determine data item type information for data collection based on the target switch performance information, write the data item type information into a simple network management protocol, obtain a simple network management protocol request, send the simple network management protocol request to the corresponding switch, collect switch data, and send the obtained switch data to the monitoring module; the monitoring module is also used to obtain the switch data from the switch data collection module obtained based on the data collection task.
[0013] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for monitoring system data collection of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0014] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for data acquisition for a monitoring system according to the first aspect or any corresponding embodiment thereof.
[0015] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for data collection of a monitoring system according to the first aspect or any corresponding embodiment thereof.
[0016] Obtain the performance information of the target switch, and determine the number of data item (OID) types collected by the enhanced SNMP collector in this snmp request based on the performance of the target switch. Collect multiple OID indicators through a single snmp request, which reduces the overhead of system resources, reduces the collection time of monitoring data, and improves the collection efficiency of switch monitoring data. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0018] Figure 1 A schematic diagram of a process for monitoring system data collection provided by an embodiment of the present invention is shown;
[0019] Figure 2 A schematic diagram of an application scenario of a switch performance detection component is shown;
[0020] Figure 3 The following is a schematic diagram showing the application scenarios of the enhanced SNMP collector;
[0021] Figure 4 A schematic flow chart showing another method for collecting data in a monitoring system according to an embodiment of the present invention;
[0022] Figure 5 The schematic diagram shows the structure of the device for monitoring system data collection in the embodiment of the present invention. Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0024] The switch data collection process in the related technology includes: prometheus sends the collection task to snmp-exporter, snmp-exporter sends a snmp request of GET or WALK to the switch, and the switch queries the corresponding switch data according to the OID carried in the snmp request, such as traffic or central processing unit (CPU) data, and returns it.
[0025] In large-scale data collection scenarios, when collecting OID indicators of many types of switches, it is necessary to send snmp requests one by one. Each request contains an OID indicator for this query, and waits for the switch to complete the previous snmp request before sending the next request. Too many snmp requests increase the overhead of system resources on the one hand, and greatly increase the collection time on the other hand, affecting the efficiency of switch data collection.
[0026] According to an embodiment of the present invention, an embodiment of a method for monitoring system data collection is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0027] In this embodiment, a method for monitoring system data collection is provided, which can be used in terminals such as mobile phones, tablet computers, desktop computers or servers, etc. Figure 1 The flowchart of the method for collecting data of a monitoring system provided by an embodiment of the present invention is shown as follows: Figure 1 As shown, the process includes the following steps:
[0028] Step S101, obtaining a data collection task.
[0029] In this step, the monitoring system in the present invention can be an open source native service monitoring system Prometheus, which can collect and process data item indicators from various targets. In the Prometheus architecture, a single Prometheus node sends M switch data collection tasks to the enhanced SNMP collector to collect M switch monitoring data. One data collection task represents one switch data collection.
[0030] The data collection task may be a Hyper Text Transfer Protocol (HTTP) request. The data collection task includes the switch address for this collection. The data collection task may be: http: / / improved SNMP collector ip:port?target=switch IP address.
[0031] Step S102, acquiring switch performance information, and obtaining target switch performance information based on the data collection task and the switch performance information.
[0032] In this step, the switch performance information can be obtained through the switch performance detection component. Figure 2 The following is a schematic diagram showing the application scenario of the switch performance detection component. Figure 2 As shown, the switch performance detection component 21 can send an SNMP request to query the performance data items of the switch within the second preset time period based on the first preset time period to each switch, and the switches include: switch 1, switch 2, switch 3, ..., and switch M, obtain the performance data items of the second preset time period of each switch, and write the obtained performance data items into the switch performance information table, which can be updated regularly. The first preset time period can be set to 1 minute, and the second preset time period can also be set to 1 minute.
[0033] The performance data items of each switch may include the average CPU usage and the average memory usage. The switch performance information table is shown in Table 1:
[0034] Table 1 Switch performance information table
[0035]
[0036] According to the switch IP address contained in the data collection task, the performance information of the target switch in the second preset time period is obtained from the switch performance information table of the switch performance detection component.
[0037] Step S103, based on the target switch performance information, determine the data item type information for data collection, write the data item type information into the simple network management protocol, obtain the simple network management protocol request, send the simple network management protocol request to the corresponding switch, and collect the switch monitoring data.
[0038] In this step, the target switch performance information may include the switch CPU usage information and memory usage information. If the current CPU usage is high, a smaller number of data items for data collection may be determined; if the current CPU usage is low, a larger number of data items for data collection may be determined. Similarly, if the current switch memory usage is high, a smaller number of data items for data collection may be determined; if the current switch memory usage is low, a larger number of data items for data collection may be determined. As the available resources of the switch increase, the number of data items for data collection increases.
[0039] After determining the data item type information, the enhanced SNMP collector can fill in the OID start node corresponding to the data item type information in the snmp request message, and send the request to the target switch through the snmp protocol. After receiving the snmp request, the target switch queries the N types of switch data tables according to the OID data in the snmp message, and returns the switch monitoring data. The maximum number of switch data returned for each type can be set to 50, which can meet the requirements of the network maximum transmission unit (Maximum Transmission Unit, referred to as MTU).
[0040] The method for monitoring system data collection provided in this embodiment obtains the performance information of the target switch, determines the number of data item (OID) types collected by the enhanced SNMP collector in this snmp request according to the performance of the target switch, and collects multiple OID indicators through a single snmp request, thereby reducing the overhead of system resources, reducing the collection time of monitoring data, and improving the collection efficiency of switch monitoring data.
[0041] In an optional implementation, based on the data collection task and the switch performance information, the target switch performance information is obtained, including: based on the switch Internet Protocol address, querying from the switch performance information to obtain the target switch performance information corresponding to the switch Internet Protocol address; wherein the target switch performance information includes the target switch central processing unit usage and the target switch memory usage; the data collection task includes the switch Internet Protocol address.
[0042] Figure 3 The following is a schematic diagram showing the application scenarios of the enhanced SNMP collector. Figure 3As shown, in this embodiment, after the enhanced SNMP collector 31 obtains the data collection task from the prometheus node 32, it sends the data collection task to the switch performance detection component 21. The switch performance detection component 21 searches for the target switch performance information based on the target switch IP address contained in the data collection task, and feeds back the target switch performance information including CPU usage and memory usage to the enhanced SNMP collector.
[0043] In this way, the data item information for data collection is determined according to the current performance of the switch, the resource allocation in the system is reasonably planned, and the data collection efficiency of the switch is improved.
[0044] In this embodiment, a method for monitoring system data collection is also provided, which can be used in the above-mentioned terminals, such as mobile phones, tablet computers, desktop computers or servers, etc. Figure 4 FIG. 1 is a flow chart showing another method for collecting data in a monitoring system according to an embodiment of the present invention. Figure 4 As shown, the process includes the following steps:
[0045] Step S401, obtain data collection tasks. For details, see Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0046] Step S402: Obtain switch performance information. Based on the data collection task and the switch performance information, obtain the target switch performance information. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0047] Step S403, based on the target switch performance information, determine the data item type information for data collection, write the data item type information into the simple network management protocol, obtain the simple network management protocol request, send the simple network management protocol request to the corresponding switch, and collect the switch monitoring data.
[0048] Specifically, the above step S403 includes:
[0049] Step S4031, based on the target switch central processor usage rate, determine the first number of data items corresponding to the target switch central processor usage rate, and determine the first number based on the product of the first number of data items and a first preset threshold.
[0050] In this step, as the CPU usage of the target switch increases, the first number of data items decreases, and a gradient interval can be set for the CPU usage of the target switch, and different gradient intervals correspond to different first numbers of data items. The first preset threshold can be a proportional factor, a fixed value, or a dynamically adjusted parameter. The gradient interval or the first preset threshold can be adjusted according to actual conditions, such as network load or switch performance.
[0051] Step S4032: based on the target switch memory usage, determine the second number of data items corresponding to the target switch memory usage; based on the product of the second number of data items and the second preset threshold, determine the second number; the sum of the first preset threshold and the second preset threshold is one.
[0052] In this step, as the target switch memory usage rate increases, the second number of data items decreases, and a gradient interval can be set for the target switch memory usage rate, and different gradient intervals correspond to different second numbers of data items. The second preset threshold can be a proportional factor, a fixed value, or a dynamically adjusted parameter. The gradient interval or the second preset threshold can be adjusted according to actual conditions, such as network load or switch performance.
[0053] Step S4033: determine the number of data item types based on the sum of the first number and the second number, and determine the data item type information based on the number of data item types.
[0054] In this step, the CPU usage and memory usage of the target switch are comprehensively considered, the data item type is dynamically adjusted, and the data item type information is determined. In enterprise-level monitoring, it can effectively reduce switch resource overhead, shorten switch collection time, and improve switch collection efficiency.
[0055] In some optional embodiments, the aforementioned method for monitoring system data collection also includes: dividing the CPU usage into multiple CPU usage levels, each CPU usage level corresponding to a different number of data items; dividing the switch memory usage into multiple memory usage levels, each memory usage level corresponding to a different number of data items.
[0056] In this embodiment, the CPU usage rate can be divided into four levels, for example, the CPU usage rate can be divided into the first level: 60%-100%, the number of OIDs corresponding to the CPU usage rate of the first level can be 1; the second level: 40%-60%, the number of OIDs corresponding to the CPU usage rate of the second level can be 3; the third level: 20%-40%, the number of OIDs corresponding to the CPU usage rate of the third level can be 5; the fourth level: 0%-20%, the number of OIDs corresponding to the CPU usage rate of the fourth level can be 7. The specific setting of the number of OIDs can be determined by those skilled in the art according to the actual application scenario.
[0057] In this embodiment, the memory usage rate can be divided into four levels, for example, the memory usage rate can be divided into the first level: 60%-100%, the number of OIDs corresponding to the memory usage rate of the first level can be 1; the second level: 40%-60%, the number of OIDs corresponding to the memory usage rate of the second level can be 3; the third level: 20%-40%, the number of OIDs corresponding to the memory usage rate of the third level can be 5; the fourth level: 0%-20%, the number of OIDs corresponding to the memory usage rate of the fourth level can be 7. The specific setting of the number of OIDs can be determined by those skilled in the art according to the actual application scenario.
[0058] In this embodiment, taking the CPU usage and memory usage as the same level as an example, the determination of the data item type information for data collection is exemplified. The CPU usage and memory usage can also be divided into different levels. Those skilled in the art can also further divide and limit the aforementioned levels according to actual application scenarios.
[0059] The corresponding relationship between the number of data item types and the CPU and memory usage is shown in Table 2.
[0060] Table 2 Correspondence between the number of data item types and CPU and memory usage
[0061] Utilization rate (%) The number of OIDs corresponding to CPU usage The number of OIDs corresponding to the memory usage 60-100 1 1 40-60 3 3 20-40 5 5 0-20 7 7
[0062] In some optional implementations, the aforementioned method for monitoring system data collection further includes: determining target data item type information for the next remaining data collection based on the data item type information; and collecting the remaining switch monitoring data based on the target data item type information until the data collection task is completed.
[0063] In this embodiment, after the number of data item types is determined, the remaining data collection tasks also collect data according to the determined number of data item types. For example, according to the CPU usage and memory usage of the switch, after the number of data item types is determined to be 3, the maximum number of OIDs included in the subsequent SNMP request is 3.
[0064] In this way, a single Prometheus node can simultaneously obtain multiple types of switch data in one data collection task. Using the enhanced SNMP collector and feedback control mechanism to dynamically adjust the number of switch collection OIDs can effectively reduce switch resource overhead, shorten switch collection time, and improve switch collection efficiency in enterprise-level monitoring.
[0065] In some optional embodiments, the aforementioned method for monitoring system data collection also includes: if the monitoring data representation of the first data item type in the switch monitoring data indicates that the current Simple Network Management Protocol request has traversed all nodes under the first data item type, subsequent Simple Network Management Protocol requests are made to perform monitoring data of other data item types in the remaining data collection.
[0066] In this embodiment, after receiving the data from the switch, the enhanced SNMP collector judges the returned data of N types of OIDs. If the returned data of a certain type of OID has completely traversed its nodes, it means that the data of this type of OID has been completely queried. In the next snmp request, this type of OID is removed and the next type of OID is queried.
[0067] In this way, the nodes that have been traversed will no longer be queried, which can reduce unnecessary resource consumption, speed up the entire data collection process, and avoid repeated queries to save memory and processor resources.
[0068] In some optional embodiments, the aforementioned method for monitoring system data collection also includes: if the monitoring data representation of the second data item type in the switch monitoring data contains nodes under the second data item type that have not been traversed by this simple network management protocol request, obtaining the last node of the monitoring data of the second data item type in the switch monitoring data; using the last node as the starting node of the second data item type for the next remaining data collection until all nodes under the second data item type are traversed.
[0069] In this embodiment, if the returned data of a certain type of OID does not completely traverse its nodes, the last node of the returned data of this type of OID is taken and regarded as the starting node for the next request for this type of OID, and the snmp request process is repeated until the nodes of this type of OID are completely traversed.
[0070] Visiting the traversed nodes again will cause unnecessary waste of computing resources. Starting the query from the nodes that have not been traversed can avoid repeated queries, significantly reduce the time complexity of the algorithm, and optimize program performance.
[0071] The present invention is exemplarily described below in conjunction with specific application scenarios. The components for implementing the present method include: a Prometheus server P1, an enhanced SNMP collector S1, and a switch performance detection component D1.
[0072] The switch performance detection component D1 sends an SNMP request to each switch every minute to query the switch's CPU and memory average usage OID of the previous minute, obtains the CPU and memory average usage of each switch in the previous minute, and writes the above information into its own switch performance table and updates it regularly.
[0073] Prometheus server P1 sends 1,000 collection tasks to the load balancing server every 5 minutes. Each collection task carries a different switch IP address, with the goal of collecting data from 1,000 different switches.
[0074] After receiving the collection task, the enhanced SNMP collector S1 first sends a request to the switch performance collection component, and obtains the average CPU and memory usage of the switch in the previous minute based on the switch IP address contained in the collection task. After obtaining the average CPU and memory usage of the switch in the previous minute, S1 calculates the number of OIDs collected in this collection task based on the information obtained. For example, the average CPU and memory usage of the switch in the previous minute were 45% and 27% respectively. Referring to Table 2, according to the formula N = the number of OIDs corresponding to the CPU usage * 0.8 + the number of OIDs corresponding to the memory usage * 0.2, the obtained N = 3 * 0.8 + 5 * 0.2 ≈ 3 (rounded down).
[0075] The SNMP request message is filled with the starting node of the three types of OID data (A, B, C), and the request is sent to the switch through the SNMP protocol. After the switch receives the snmp request, it queries the three types of switch data at the same time according to the three types of OID data in the snmp message and returns the data. The maximum number of switch data returned for each type is set to 50.
[0076] After receiving the data from the switch, the enhanced SNMP collector judges the return data of the three types of OIDs. If the return data of type A OID has completely traversed its nodes, the next snmp request will no longer query this type of OID, and the starting node of type D OID will be added; if the return data of types B and C OIDs have not completely traversed their nodes, the last node of the return data of the two types of OIDs will be taken as the starting node of the next snmp request for the two types of OIDs, and the snmp request process will be repeated until all types of OID nodes are completely traversed.
[0077] Compared with snmp-exporter, the enhanced SNMP collector supports collecting multiple OID data in one snmp request, which can effectively reduce the switch collection time. The OID quantity feedback control mechanism dynamically adjusts the current collection setting OID quantity according to the performance information of the switch in the previous period during the switch collection process, thus reducing the switch time and ensuring the switch performance.
[0078] In this embodiment, a device for monitoring system data acquisition is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0079] This embodiment provides a device for monitoring system data collection. Figure 5 FIG. 4 shows a schematic diagram of a device for collecting data in a monitoring system according to an embodiment of the present invention. Figure 5 As shown, including:
[0080] The monitoring module 501 is used to send a data collection task to the switch data collection module 502, and obtain switch data from the switch data collection module 502 based on the data collection task.
[0081] The switch data collection module 502 is used to obtain a data collection task, send the data collection task to the switch performance detection module 503, obtain the target switch performance information from the switch performance detection module 503 based on the data collection task, determine the data item type information for data collection based on the target switch performance information, write the data item type information into the simple network management protocol, obtain a simple network management protocol request, send the simple network management protocol request to the corresponding switch, collect switch data, and send the obtained switch data to the monitoring module 501.
[0082] The enhanced SNMP collector, an enhanced version of the switch data collection component snmp-exporter, can support collecting multiple switch OID indicators in one snmp request. It is responsible for calculating the number of OIDs collected in this task based on the performance information fed back by the switch performance detection module 503, and using the SNMP protocol to collect switch data.
[0083] The switch performance detection module 503 is used to obtain switch performance information, obtain data collection tasks, obtain target switch performance information based on the data collection tasks and switch performance information, and send the target switch performance information to the switch data collection module 502.
[0084] The switch performance detection module 503 is responsible for regularly detecting the CPU and memory consumption of the switch and updating its own switch performance table. When the enhanced SNMP collector sends a switch performance query request, the switch performance information of the previous period is fed back to the enhanced SNMP collector.
[0085] In some optional implementations, the switch performance detection module 503 includes:
[0086] The switch performance detection unit is used to query and obtain the target switch performance information corresponding to the switch Internet Protocol address from the switch performance information based on the switch Internet Protocol address; wherein the target switch performance information includes the target switch central processing unit utilization rate and the target switch memory utilization rate; the data collection task includes the switch Internet Protocol address.
[0087] In some optional implementations, the switch data collection module 502 includes:
[0088] The first switch data collection unit is used to determine a first number of data items corresponding to the target switch central processor usage rate based on the target switch central processor usage rate, and determine the first number based on the product of the first number of data items and a first preset threshold.
[0089] The second switch data collection unit is used to determine a second number of data items corresponding to the target switch memory usage based on the target switch memory usage, and determine the second number based on the product of the second number of data items and a second preset threshold, and the sum of the first preset threshold and the second preset threshold is one.
[0090] The third switch data collection unit is used to determine the number of data item types based on the sum of the first number and the second number, and determine the data item type information based on the number of data item types.
[0091] In some optional implementations, the switch data collection module 502 further includes:
[0092] The fourth switch data collection unit is used to divide the CPU usage into multiple CPU usage levels, each CPU usage level corresponds to a different number of data items; divide the switch memory usage into multiple memory usage levels, each memory usage level corresponds to a different number of data items.
[0093] In some optional implementations, the aforementioned device for monitoring system data collection further includes:
[0094] The remaining data collection module is used to determine the target data item type information for the next remaining data collection based on the data item type information; based on the target data item type information, collect the remaining switch monitoring data until the data collection task is completed.
[0095] In some optional implementations, the aforementioned device for monitoring system data collection further includes:
[0096] The first data collection unit is used to collect monitoring data of other data item types in the remaining data if the monitoring data representation of the first data item type in the switch monitoring data indicates that the current simple network management protocol request has traversed all nodes under the first data item type, and the subsequent simple network management protocol request performs monitoring data of other data item types in the remaining data collection.
[0097] In some optional implementations, the aforementioned device for monitoring system data collection further includes:
[0098] The second data acquisition unit is used to obtain the last node of the monitoring data of the second data item type in the switch monitoring data if the monitoring data representation of the second data item type in the switch monitoring data has nodes under the second data item type that have not been traversed by this simple network management protocol request; and use the last node as the starting node of the second data item type for the next remaining data collection until all nodes under the second data item type are traversed.
[0099] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0100] The device for monitoring system data acquisition in this embodiment is presented in the form of a functional unit, where the unit refers to an application specific integrated circuit (ASIC) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0101] The device for monitoring system data collection provided by the embodiment of the present invention obtains the performance information of the target switch, determines the number of data item (OID) types collected by the enhanced SNMP collector in this snmp request according to the performance of the target switch, collects multiple OID indicators through a single snmp request, reduces the overhead of system resources, reduces the collection time of monitoring data, and improves the collection efficiency of switch monitoring data.
[0102] The embodiment of the present invention also provides a computer device having the above Figure 5 The device shown is used for monitoring system data collection.
[0103] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of a graphical user interface on an external input / output device (such as a display device coupled to an interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0104] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0105] The aforementioned memory 20 stores instructions executable by at least one processor 10, so that the aforementioned at least one processor 10 executes the method shown in the above embodiment.
[0106] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0107] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0108] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0109] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (such as a light emitting diode) and a tactile feedback device (such as a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0110] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0111] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0112] Although the embodiments of the present invention have been 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 are all within the scope defined by the appended claims.
Claims
1. A method for monitoring system data collection, characterized in that: The method comprises: Get data collection tasks; Acquire switch performance information, and obtain target switch performance information based on the data collection task and the switch performance information; Based on the target switch performance information, determine the data item type information for data collection, write the data item type information into a simple network management protocol, obtain a simple network management protocol request, send the simple network management protocol request to the corresponding switch, and collect switch monitoring data.
2. The method according to claim 1, characterized in that The obtaining target switch performance information based on the data collection task and the switch performance information includes: Based on the switch Internet Protocol address, query and obtain the target switch performance information corresponding to the switch Internet Protocol address from the switch performance information; The target switch performance information includes the target switch central processing unit utilization rate and the target switch memory utilization rate; the data collection task includes the switch Internet Protocol address.
3. The method according to claim 2, characterized in that The step of determining the data item type information for data collection based on the target switch performance information includes: Based on the target switch central processor usage rate, determine a first number of data items corresponding to the target switch central processor usage rate, and determine the first number based on the product of the first number of data items and a first preset threshold value; Determine, based on the target switch memory usage, a second number of data items corresponding to the target switch memory usage, and determine a second number based on a product of the second number of data items and a second preset threshold, wherein a sum of the first preset threshold and the second preset threshold is one; The number of data item types is determined based on the sum of the first number and the second number, and the data item type information is determined based on the number of data item types.
4. The method according to claim 3, characterized in that The method further comprises: Dividing the CPU usage into a plurality of CPU usage levels, each of the CPU usage levels corresponding to a different number of data items; The memory usage of the switch is divided into a plurality of memory usage levels, each of which corresponds to a different number of data items.
5. The method according to claim 1, characterized in that The method further comprises: Based on the data item type information, determining target data item type information for the next remaining data collection; Based on the target data item type information, the remaining switch monitoring data is collected until the data collection task is completed.
6. The method according to claim 1, characterized in that The method further comprises: If the monitoring data of the first data item type in the switch monitoring data indicates that the current SNMP request has traversed all nodes under the first data item type, a subsequent SNMP request is made to collect monitoring data of other data item types in the remaining data.
7. The method according to claim 1, characterized in that The method further comprises: If the monitoring data representation of the second data item type in the switch monitoring data contains nodes under the second data item type that are not traversed by the current SNMP request, obtaining the last node of the monitoring data of the second data item type in the switch monitoring data; The last node is used as the starting node of the second data item type for the next remaining data collection, until all nodes under the second data item type are traversed.
8. A device for monitoring system data collection, characterized in that: The device includes a monitoring module, a switch data acquisition module and a switch performance detection module; The monitoring module is used to send data collection tasks to the switch data collection module; The switch data acquisition module is used to obtain the data acquisition task and send the data acquisition task to the switch performance detection module; The switch performance detection module is used to obtain switch performance information, obtain the data collection task, obtain target switch performance information based on the data collection task and the switch performance information, and send the target switch performance information to the switch data collection module; The switch data collection module is further configured to obtain the target switch performance information from the switch performance detection module based on the data collection task, determine the data item type information for data collection based on the target switch performance information, write the data item type information into a simple network management protocol, obtain a simple network management protocol request, send the simple network management protocol request to the corresponding switch, collect switch data, and send the obtained switch data to the monitoring module; The monitoring module is further used to obtain the switch data from the switch data acquisition module based on the data acquisition task.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for monitoring system data acquisition according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for monitoring system data collection according to any one of claims 1 to 7.
Citation Information
Patent Citations
A pressure test method for an SNMP management process and an apparatus
CN103634158A
SNMP request monitoring system, method and device and computer readable storage medium
CN111224811A
Equipment monitoring method applied to complex network environment
CN111769996A
System and method for managing performance of communication lines of a communication
US20070223568A1
Server load management for data migration
US20160308726A1