Method, apparatus, and storage medium for monitoring system data collection

By acquiring switch performance information and utilizing an enhanced SNMP collector to collect multiple OID metrics in a single SNMP request, the problems of high resource overhead and long collection time in existing technologies are solved, achieving more efficient switch data collection.

CN119835192BActive Publication Date: 2025-11-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411708526.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-11-04
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

In existing technologies, excessive SNMP requests in large-scale data acquisition scenarios lead to high system resource consumption and increased acquisition time, affecting the data acquisition efficiency of switches.

Method used

By acquiring switch performance information, determining the data item type based on the performance information, and using an enhanced SNMP collector to collect multiple OID metrics in a single SNMP request, the number of data items can be dynamically adjusted to optimize resource allocation.

Benefits of technology

It reduced system resource consumption, shortened the time for collecting monitoring data, and improved the efficiency of collecting monitoring data from the switch.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835192B_ABST
    Figure CN119835192B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of monitoring, and discloses a method, a device, equipment and a storage medium for monitoring system data collection, the method comprising the following steps: acquiring a data collection task; acquiring switch performance information; 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 to obtain a simple network management protocol request; sending the simple network management protocol request to a corresponding switch; and collecting switch monitoring data. The target switch performance information is obtained, the number of data item types collected by the present snmp request is determined according to the target switch performance, a plurality of data item indexes are collected through one snmp request, the system resource consumption is reduced, the monitoring data collection time length is reduced, and the switch monitoring data collection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of monitoring, in particular to a method and device for monitoring system data collection, equipment and storage medium. BACKGROUND

[0002] Prometheus has good data storage characteristics and is widely used in the field of monitoring. The snmp-exporter is adapted to Prometheus, and the snmp-exporter uses the Simple Network Management Protocol (SNMP) to obtain switch data and provides the obtained switch data to Prometheus for use.

[0003] In the related art, the snmp-exporter supports only one Object Identifier (OID) in one snmp request, and the OID is used to locate a data item. In a large-scale data collection scenario, when a large number of switch OID indicators are collected, snmp requests need to be sent one by one, each request containing an OID indicator for this query, and the next request is sent after the switch executes 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

[0004] Therefore, the present application provides a method and device for monitoring system data collection, equipment and storage medium to solve the problem of too many snmp requests causing large system resource overhead, long collection time and affecting the efficiency of switch data collection.

[0005] In a first aspect, the present application provides a method for monitoring system data collection, 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 (SNMP) to obtain an SNMP request, sending the SNMP request to a corresponding switch, and collecting switch monitoring data.

[0006] In an optional implementation, the obtaining the target switch performance information based on the data collection task and the switch performance information comprises: querying 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 comprises a target switch central processing unit usage rate and a target switch memory usage rate; and the data collection task comprises the switch Internet protocol address.

[0007] In an optional implementation, the determining the data item type information based on the target switch performance information comprises: determining a first number of data items corresponding to the target switch central processing unit usage rate based on the target switch central processing unit usage rate, determining a first number based on a product of the first number of data items and a first preset threshold value, determining a second number of data items corresponding to the target switch memory usage rate based on the target switch memory usage rate, determining a second number based on a product of the second number of data items and a second preset threshold value, and the sum of the first preset threshold value and the second preset threshold value being one; determining a data item category number based on the sum of the first number and the second number, and determining the data item type information based on the data item category number.

[0008] In an optional implementation, the foregoing method for collecting data of a monitoring system further comprises: dividing the central processing unit usage rate into a plurality of central processing unit usage rate levels, each of the central processing unit usage rate levels corresponding to a different number of data items; and dividing the switch memory usage rate into a plurality of memory usage rate levels, each of the memory usage rate levels corresponding to a different number of data items.

[0009] In an optional implementation, the foregoing method for collecting data of a monitoring system further comprises: determining target data item type information for next remaining data collection based on the data item type information; and collecting remaining switch monitoring data based on the target data item type information until the data collection task is completed.

[0010] In an optional implementation, the foregoing method for collecting data of a monitoring system further comprises: if monitoring data of a first data item type in the switch monitoring data indicates that a Simple Network Management Protocol request has traversed all nodes under the first data item type this time, subsequent Simple Network Management Protocol requests collect monitoring data of other data item types in remaining data collection.

[0011] In an alternative embodiment, the method for monitoring system data collection further comprises: if the second data item type in the switch monitoring data is not traversed by the current SNMP request, obtaining the last node of the second data item type in the switch monitoring data; and taking the last node as the starting node of the second data item type for the next data collection until all nodes of the second data item type are traversed.

[0012] In a second aspect, the present application 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 configured to send a data collection task to the switch data collection module; the switch data collection module is configured to obtain the data collection task and send the data collection task to the switch performance detection module; the switch performance detection module is configured 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 data item type information based on the target switch performance information, write the data item type information into an SNMP, obtain an SNMP request, send the SNMP request to a corresponding switch, collect switch data, and send the obtained switch data to the monitoring module; and the monitoring module is further configured to obtain the switch data from the switch data collection module based on the data collection task.

[0013] In a third aspect, the present application provides a computer device, comprising a memory and a processor, which are communicatively connected, and the memory stores computer instructions; the processor executes the computer instructions to perform the method for monitoring system data collection according to the first aspect or any of the corresponding embodiments.

[0014] In a fourth aspect, the present application provides a computer readable storage medium, which stores computer instructions for making a computer perform the method for monitoring system data collection according to the first aspect or any of the corresponding embodiments.

[0015] In a fifth aspect, the present application provides a computer program product, which comprises computer instructions for making a computer perform the method for monitoring system data collection according to the first aspect or any of the corresponding embodiments.

[0016] The target switch performance information is acquired, the number of data item (OID) types of the enhanced SNMP collector for this time snmp request collection is determined according to the target switch performance condition, the collection of multiple OID indexes is realized through one snmp request, the system resource consumption is reduced, the monitoring data collection time length is reduced, and the switch monitoring data collection efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the specific embodiments or related art, the drawings needed to be used in the specific embodiments or related art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0018] Figure 1 A flowchart of a method for monitoring system data collection provided by the embodiment of the present application is shown;

[0019] Figure 2 An application scenario diagram of the switch performance detection component is shown;

[0020] Figure 3 An application scenario diagram of the enhanced SNMP collector is shown;

[0021] Figure 4 A flowchart of another method for monitoring system data collection provided by the embodiment of the present application is shown;

[0022] Figure 5 A structure diagram of the device for monitoring system data collection in the embodiment of the present application is shown

[0023] Figure 6 The hardware structure diagram of the computer device in the embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

[0025] The exchange data collection process in the related art includes that prometheus issues a collection task to snmp-exporter, snmp-exporter sends an snmp request of GET or WALK to the exchange, the exchange queries corresponding exchange data such as traffic or central processing unit (CPU) data according to an OID carried in the snmp request, and returns.

[0026] In a large-scale data collection scenario, when a plurality of types of exchange OID indexes are collected, snmp requests need to be sent one by one, each request contains an OID index queried this time, and the next request is sent after the exchange executes 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 exchange data collection.

[0027] According to the embodiment of the present application, 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 the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from here.

[0028] In the present 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 monitoring system data collection provided by the embodiment of the present application is shown in FIG. 1, which includes the following steps: Figure 1 The flowchart of the method for monitoring system data collection provided by the embodiment of the present application is shown in FIG. 1, which includes the following steps:

[0029] In step S101, a data collection task is acquired.

[0030] In this step, the monitoring system in the present application can be an open source native service monitoring system Prometheus, which can collect and process data item indexes from various targets. In the Prometheus architecture, a single Prometheus node issues M exchange data collection tasks to an enhanced SNMP collector to collect M exchange monitoring data. One data collection task represents one exchange data collection.

[0031] The data collection task can be a Hyper Text Transfer Protocol (HTTP) request. The data collection task includes the switch address for this collection. The data collection task can be: http: / / improved SNMP collector IP:port?target=switch IP address.

[0032] In step S102, switch performance information is obtained, and target switch performance information is obtained based on the data collection task and the switch performance information.

[0033] In this step, the switch performance information can be obtained by the switch performance detection component. Figure 2 An application scenario of the switch performance detection component is shown. As shown in Figure 2 The switch performance detection component 21 can send snmp requests to query the performance data items of each switch in a second preset time period based on a first preset time period, the switches include switch 1, switch 2, switch 3, …, and switch M, the performance data items of each switch in the second preset time period are obtained, and the obtained performance data items are written into a 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.

[0034] The performance data items of each switch can include CPU average usage and memory average usage. The switch performance information table is shown in Table 1.

[0035] Table 1: Switch performance information table

[0036]

[0037] 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.

[0038] In step S103, based on the target switch performance information, the data item type information for data collection is determined, the data item type information is written into a simple network management protocol, a simple network management protocol request is obtained, the simple network management protocol request is sent to the corresponding switch, and switch monitoring data is collected.

[0039] In the step, the target switch performance information can include switch CPU usage information and memory usage information. If the current CPU usage is high, a smaller number of data items for data collection can be determined, and if the current CPU usage is low, a larger number of data items for data collection can be determined. Similarly, if the current switch memory usage is high, a smaller number of data items for data collection can be determined, and if the current switch memory usage is low, a larger number of data items for data collection can be determined. As the available resources of the switch increase, the number of data items for data collection increases.

[0040] After determining the data item type information, the enhanced SNMP collector can fill the OID starting node corresponding to the number (N) of data item type information in the snmp request message, and send a request to the target switch through the snmp protocol. After receiving the snmp request, the target switch queries N kinds of switch data tables according to the OID data in the snmp message, and returns the switch monitoring data. The maximum return quantity of each kind of switch data can be set to 50, which can meet the requirements of the network maximum transmission unit (MTU).

[0041] The method for monitoring system data collection provided in the embodiment acquires target switch performance information, determines the number of data item (OID) types collected by the enhanced SNMP collector in this snmp request according to the target switch performance, collects multiple OID indicators through one snmp request, reduces the system resource overhead, reduces the monitoring data collection time, and improves the switch monitoring data collection efficiency.

[0042] In an optional implementation, the target switch performance information is obtained based on the data collection task and the switch performance information, including: based on the switch Internet protocol address, the target switch performance information corresponding to the switch Internet protocol address is queried from the switch performance information; wherein the target switch performance information includes target switch central processing unit usage and target switch memory usage; the data collection task includes the switch Internet protocol address.

[0043] Figure 3 The application scenario of the enhanced SNMP collector is shown. As shown in FIG. 1, the enhanced SNMP collector is applied to a network monitoring system. The network monitoring system includes a network management system and a plurality of switches. Figure 3As shown, in the embodiment, after the enhanced SNMP collector 31 obtains the data collection task from the prometheus node 32, the data collection task is sent to the switch performance detection component 21, the switch performance detection component 21 searches for 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.

[0044] 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 switch data collection efficiency is improved.

[0045] The embodiment also provides a method for monitoring system data collection, which can be used for the terminal such as a mobile phone, a tablet computer, a desktop computer or a server. Figure 4 The embodiment also provides a method for monitoring system data collection, which can be used for the terminal such as a mobile phone, a tablet computer, a desktop computer or a server. Figure 4 As shown, the flow includes the following steps:

[0046] In step S401, a data collection task is obtained. For details, refer to step S101 of the embodiment shown in the foregoing. Figure 1 In step S101 of the embodiment shown in the foregoing, details are not repeated here.

[0047] In step S402, switch performance information is obtained, and target switch performance information is obtained based on the data collection task and the switch performance information. For details, refer to step S102 of the embodiment shown in the foregoing. Figure 1 In step S102 of the embodiment shown in the foregoing, details are not repeated here.

[0048] In step S403, based on the target switch performance information, data item type information for data collection is determined, the data item type information is written into a simple network management protocol, a simple network management protocol request is obtained, the simple network management protocol request is sent to a corresponding switch, and switch monitoring data is collected.

[0049] Specifically, step S403 includes the following steps.

[0050] In step S4031, based on the target switch central processing unit usage, a first number of data items corresponding to the target switch central processing unit usage is determined, and a first number is determined based on the product of the first number of data items and a first preset threshold.

[0051] In this step, as the target switch CPU usage increases, the first number of data items decreases, and the target switch CPU usage can be set to a gradient interval, and different gradient intervals correspond to different first numbers of data items. The first preset threshold can be a scaling 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.

[0052] Step S4032, determining a second number of data items corresponding to the target switch memory usage based on the target switch memory usage, and determining the second number based on the product of the second number of data items and a second preset threshold. The sum of the first preset threshold and the second preset threshold is one.

[0053] In this step, as the target switch memory usage increases, the second number of data items decreases, and the target switch memory usage can be set to a gradient interval, and different gradient intervals correspond to different second numbers of data items. The second preset threshold can be a scaling 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.

[0054] Step S4033, determining the number of data item categories 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 categories.

[0055] In this step, the CPU usage and memory usage of the target switch are considered comprehensively, the number of data item categories is dynamically adjusted, and the data item type information is determined. In enterprise-level monitoring, the switch resource overhead can be effectively reduced, the switch collection time can be shortened, and the switch collection efficiency can be improved.

[0056] In some optional embodiments, the foregoing method for monitoring system data collection further comprises: dividing the central processor usage into a plurality of central processor usage levels, each central processor usage level corresponding to a different number of data items; and dividing the switch memory usage into a plurality of memory usage levels, each memory usage level corresponding to a different number of data items.

[0057] In the 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 CPU usage rate of the first level corresponds to 1 OID; the second level: 40%-60%, the CPU usage rate of the second level corresponds to 3 OIDs; the third level: 20%-40%, the CPU usage rate of the third level corresponds to 5 OIDs; the fourth level: 0%-20%, the CPU usage rate of the fourth level corresponds to 7 OIDs. The specific number of OIDs can be determined by those skilled in the art according to the actual application scene.

[0058] In the 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 memory usage rate of the first level corresponds to 1 OID; the second level: 40%-60%, the memory usage rate of the second level corresponds to 3 OIDs; the third level: 20%-40%, the memory usage rate of the third level corresponds to 5 OIDs; the fourth level: 0%-20%, the memory usage rate of the fourth level corresponds to 7 OIDs. The specific number of OIDs can be determined by those skilled in the art according to the actual application scene.

[0059] In the embodiment, the CPU usage rate and the memory usage rate are divided into the same level as an example, and the determination of the data item type information for data collection is exemplarily illustrated. The CPU usage rate and the memory usage rate can also be divided into different levels, and those skilled in the art can further divide and limit the aforementioned levels according to the actual application scene.

[0060] The correspondence between the number of data item types and the CPU and memory usage rates is shown in Table 2.

[0061] Table 2 Correspondence between the number of data item types and the CPU and memory usage rates

[0062] Usage rate (%) Number of OIDs corresponding to CPU usage rate Number of OIDs corresponding to memory usage rate 60-100 1 1 40-60 3 3 20-40 5 5 0-20 7 7

[0063] In some optional embodiments, the foregoing method for monitoring system data collection further comprises: determining target data item type information for next remaining data collection based on the data item type information; and collecting remaining switch monitoring data based on the target data item type information until the data collection task is completed.

[0064] In the embodiment, after the number of data item categories is determined, the remaining data collection tasks are also performed according to the determined number of data item categories. For example, after the number of data item categories is determined to be 3 according to the CPU usage and the memory usage of the switch, the number of OIDs contained in the subsequent snmp request is at most 3.

[0065] In this way, the single prometheus node can simultaneously collect multiple categories of switch data in one data collection task. The enhanced SNMP collector and the feedback control mechanism are used to dynamically adjust the number of collected OIDs of the switch, which can effectively reduce the resource consumption of the switch, shorten the collection time of the switch, and improve the collection efficiency of the switch in enterprise-level monitoring.

[0066] In some optional embodiments, the method for collecting data of a monitoring system further includes: 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 of the first data item type, the subsequent snmp request collects the monitoring data of other data item types in the remaining data collection.

[0067] In the embodiment, after the enhanced SNMP collector receives the data from the switch, the returned data of the N categories of OIDs is judged. If the returned data of a certain category of OID has completely traversed its nodes, it indicates that the data of the category of OID has been completely queried, and the category of OID is excluded in the next snmp request, and the next category of OID is queried.

[0068] In this way, the nodes that have been completely traversed are no longer queried, which can reduce unnecessary resource consumption, speed up the entire data collection process, and save memory and processor resources by avoiding repeated queries.

[0069] In some optional embodiments, the method for collecting data of a monitoring system further includes: if the monitoring data of the second data item type in the switch monitoring data indicates that there are nodes of the second data item type that have not been traversed by the current snmp request, the last node of the monitoring data of the second data item type in the switch monitoring data is obtained; the last node is taken as the starting node of the second data item type in the next remaining data collection, and the process is repeated until all nodes of the second data item type are traversed.

[0070] In the embodiment, if the returned data of a certain category of OID has not completely traversed its nodes, the last node of the returned data of the category of OID is taken as the starting node of the next request for the category of OID, and the snmp request process is repeated until the nodes of the category of OID are completely traversed.

[0071] The node that has been traversed is accessed again, which causes unnecessary waste of computing resources, and starting the query from the node that has not been traversed can avoid repeated queries and can significantly reduce the time complexity of the algorithm and optimize the program performance.

[0072] The application will be exemplarily described in combination with a specific application scenario. Components implementing the method include a Prometheus server P1, an enhanced SNMP collector S1, and a switch performance detection component D1.

[0073] The switch performance detection component D1 sends an snmp request for querying the CPU and memory average use rate of the previous 1 minute of each switch to each switch every 1 minute, obtains the CPU and memory average use rate of each switch in the previous 1 minute period, and writes the above information into the switch performance table of the component D1 and updates the table regularly.

[0074] The Prometheus server P1 sends 1000 collection tasks to the load balancing server every 5 minutes, and each collection task carries a different switch IP address, for the purpose of collecting data of 1000 different switches.

[0075] After receiving the collection task, the enhanced SNMP collector S1 first sends a request to the switch performance collection component, obtains the CPU and memory average use rate of the switch in the previous 1 minute period according to the switch IP address contained in the collection task. After obtaining the CPU and memory average use rate of the switch in the previous 1 minute period, the S1 calculates the number N of OIDs to be collected in this collection task according to the obtained information. For example, if the CPU and memory average use rate of the switch in the previous 1 minute period are 45% and 27% respectively, referring to Table 2, according to the formula N=CPU use rate corresponding OID number*0.8+memory use rate corresponding OID number*0.2, N=3*0.8+5*0.2≈3 (rounded down) is obtained.

[0076] The SNMP request message fills the start node of the 3 types of OID data (A, B, and C), and sends the request to the switch through the SNMP protocol. After receiving the snmp request, the switch simultaneously queries and returns the data of the 3 types of switch according to the 3 types of OID data in the snmp message. The maximum return number of each type of switch data is set to 50.

[0077] After the enhanced SNMP collector receives the data from the switch, the returned data of the three types of OIDs is judged. The returned data of the A type OID has completely traversed its node, and the next snmp request no longer queries the A type OID, and a new starting node of the D type OID is added. The returned data of the B and C type OIDs has not completely traversed its node, and the last node of the returned data of the B and C type OIDs is taken as the starting node of the B and C type OIDs for the next snmp request, and the snmp request process is repeated until all types of OID nodes are completely traversed.

[0078] Compared with the snmp-exporter, the enhanced SNMP collector supports collecting multiple OID data at one time, which can effectively reduce the switch collection time. The OID quantity feedback control mechanism dynamically adjusts the OID quantity of the current collection setting according to the performance information of the switch in the previous period, which reduces the switch time while guaranteeing the switch performance.

[0079] In the embodiment, an apparatus for monitoring system data collection is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and is contemplated.

[0080] The embodiment provides an apparatus for monitoring system data collection, Figure 5 The structure of the apparatus for monitoring system data collection in the embodiment of the application is shown in a schematic diagram, as shown in Figure 5 As shown, the apparatus comprises:

[0081] The monitoring module 501 is configured 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.

[0082] The switch data collection module 502 is configured to obtain a data collection task, send the data collection task to the switch performance detection module 503, obtain target switch performance information from the switch performance detection module 503 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 a corresponding switch, collect switch data, and send the obtained switch data to the monitoring module 501.

[0083] The enhanced SNMP collector, an enhanced version of the switch data collection component snmp-exporter, supports collecting multiple switch OID indicators in one SNMP request. The switch performance detection module 503 is responsible for calculating the number of OID collected in this task according to the performance information fed back by the switch performance detection module 503, and collecting switch data using the SNMP protocol.

[0084] The switch performance detection module 503 is configured to obtain switch performance information, obtain a 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 502.

[0085] The switch performance detection module 503 is responsible for periodically detecting the CPU and memory consumption of the switch and updating its own switch performance table. When the enhanced SNMP collector sends a query switch performance request, the switch performance information of the previous period is fed back to the enhanced SNMP collector.

[0086] In some optional embodiments, the switch performance detection module 503 includes:

[0087] The switch performance detection unit is configured to query 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 target switch central processing unit usage and target switch memory usage, and the data collection task includes the switch Internet protocol address.

[0088] In some optional embodiments, the switch data collection module 502 includes:

[0089] The first switch data collection unit is configured to determine a first number of data items corresponding to the target switch central processing unit usage based on the target switch central processing unit usage, and determine the first number based on the product of the first number of data items and a first preset threshold.

[0090] The second switch data collection unit is configured 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, wherein the sum of the first preset threshold and the second preset threshold is one.

[0091] The third switch data collection unit is configured to determine the number of data item categories 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 categories.

[0092] In some optional embodiments, the switch data collection module 502 further includes:

[0093] The fourth switch data collection unit is configured to divide the central processor usage rate into a plurality of central processor usage rate levels, each of which corresponds to a different number of data items; and divide the switch memory usage rate into a plurality of memory usage rate levels, each of which corresponds to a different number of data items.

[0094] In some optional embodiments, the device for monitoring system data collection further comprises:

[0095] The remaining data collection module is configured to determine target data item type information for next remaining data collection based on the data item type information; and collect remaining switch monitoring data based on the target data item type information until the data collection task is completed.

[0096] In some optional embodiments, the device for monitoring system data collection further comprises:

[0097] The first data collection unit is configured to, if the monitoring data 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, collect monitoring data of other data item types in the remaining data collection by subsequent Simple Network Management Protocol requests.

[0098] In some optional embodiments, the device for monitoring system data collection further comprises:

[0099] The second data collection unit is configured to, if the monitoring data of the second data item type in the switch monitoring data indicates that there are nodes under the second data item type that have not been traversed by the current Simple Network Management Protocol request, obtain the last node of the monitoring data of the second data item type in the switch monitoring data; and take the last node as a starting node of the second data item type for next remaining data collection until all nodes under the second data item type are traversed.

[0100] Further function descriptions of the above-mentioned modules and units are the same as those of the corresponding embodiments, and will not be described here.

[0101] The device for monitoring system data collection in the present embodiment is presented in the form of functional units. The units herein refer to Application Specific Integrated Circuit (ASIC) circuits, processors and memories executing one or more software or fixed programs, and / or other devices that can provide the above functions.

[0102] The device for monitoring system data acquisition provided in this embodiment of the invention obtains the performance information of the target switch, determines the number of data item (OID) types to be collected by the enhanced SNMP collector in this SNMP request based on the performance of the target switch, and collects multiple OID indicators in a single SNMP request, thereby reducing system resource overhead, reducing the time for monitoring data collection, and improving the efficiency of switch monitoring data collection.

[0103] This invention also provides a computer device having the above-described features. Figure 5 The device shown is used for data acquisition in the monitoring system.

[0104] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a graphical user interface on an external input / output device (such as a display device coupled to the interface). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.

[0105] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0106] The aforementioned memory 20 stores instructions executable by at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0107] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system, application programs required for at least one function, and the like. The data storage area can store data created according to usage of the computer device, and the like. In addition, the memory 20 can include a high-speed random access memory, and can further include a non-transitory memory such as at least one of a magnetic disk storage device, a flash memory device, or other non-transitory solid state memory device. In some alternative embodiments, the memory 20 can optionally include a memory that is remotely located with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0108] The memory 20 can include a volatile memory such as a random access memory, and can further include a non-volatile memory such as a flash memory, a hard disk, or a solid state disk. The memory 20 can also include a combination of the above-mentioned types of memory.

[0109] 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 can be connected through a bus or other means, Figure 6 The connection through the bus is used as an example.

[0110] The input device 30 can receive input digital or character information, and generate key signal input with respect to user settings and function controls of the computer device. Examples of the input device 30 include, but are not limited to, a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, and the like. The output device 40 can include a display device, an auxiliary lighting device (such as a light emitting diode), a tactile feedback device (such as a vibration motor), and the like. Examples of the display device include, but are not limited to, a liquid crystal display, a light emitting diode, a display, and a plasma display. In some alternative embodiments, the display device can be a touch screen.

[0111] The embodiments of the present application further provide a computer readable storage medium, and the method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium through network, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid state disk, etc. Further, the storage medium can also include a combination of the above-mentioned memories. It can be understood that the computer, the processor, the microprocessor controller, or the 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 the computer, the processor, or the hardware, the method shown in the above embodiments is implemented.

[0112] Part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be called or provided. Those skilled in the art should understand that the form of computer program instructions in a computer readable medium includes but is not limited to source files, executable files, installation package files, etc. Correspondingly, the way of executing computer program instructions by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions and then executes the corresponding installed program. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.

[0113] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.

Claims

1. A method for data acquisition in a monitoring system, characterized in that, The method includes: Data acquisition tasks; Obtain switch performance information; based on the data acquisition task and the switch performance information, obtain target switch performance information, including target switch CPU utilization and target switch memory utilization. Based on the target switch performance information, the data item type information for data collection is determined, including: if the CPU utilization rate of the first target switch is greater than that of the CPU utilization rate of the second target switch, the number of data items for data collection corresponding to the CPU utilization rate of the first target switch is less than the number of data items for data collection corresponding to the CPU utilization rate of the second target switch; if the memory utilization rate of the first target switch is greater than that of the second target switch, the number of data items for data collection corresponding to the memory utilization rate of the first target switch is less than the number of data items for data collection corresponding to the memory utilization rate of the second target switch. The data item type information is written into the Simple Network Management Protocol (SMMP) to obtain a SMMP request. The SMMP request is then sent to the corresponding switch to collect switch monitoring data.

2. The method according to claim 1, characterized in that, The process of obtaining target switch performance information based on the data acquisition task and the switch performance information includes: Based on the switch's Internet Protocol address, the target switch's performance information corresponding to the switch's Internet Protocol address is obtained from the switch's performance information; The data acquisition task includes the Internet Protocol address of the switch.

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 CPU utilization rate of the target switch, determine the first number of data items corresponding to the CPU utilization rate of the target switch, and determine the first quantity based on the product of the first number of data items and a first preset threshold. Based on the target switch memory usage rate, a second number of data items corresponding to the target switch memory usage rate is determined. Based on the product of the second number of data items and a second preset threshold, a second number is determined. The sum of the first preset threshold and the second preset threshold is one. Based on the sum of the first quantity and the second quantity, the number of data item types is determined, and based on the number of data item types, the data item type information is determined.

4. The method according to claim 3, characterized in that, The method further includes: The CPU utilization rate is divided into multiple CPU utilization rate levels, and each CPU utilization rate level corresponds to a different number of data items. The switch memory utilization rate is divided into multiple memory utilization rate levels, and each memory utilization rate level corresponds to a different number of data items.

5. The method according to claim 1, characterized in that, The method further includes: Based on the data item type information, determine the target data item type information for the next collection of remaining data; Based on the target data item type information, collect the remaining switch monitoring data until the data collection task is completed.

6. The method according to claim 1, characterized in that, The method further includes: If the monitoring data of the first data item type in the switch monitoring data indicates that the current Simple Network Management Protocol (SRM) request has traversed all nodes under the first data item type, the subsequent SRM request will collect monitoring data of other data item types in the remaining data collection.

7. The method according to claim 1, characterized in that, The method further includes: If the monitoring data representation of the second data item type in the switch monitoring data contains a node under the second data item type that has not been traversed in this Simple Network Management Protocol request, then obtain 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 for the second data item type in the next data collection of the remaining data, until all nodes under the second data item type are traversed.

8. A device for data acquisition in a monitoring system, 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 acquisition tasks to the switch data acquisition module; The switch data acquisition module is used to acquire the data acquisition task and send the data acquisition task to the switch performance detection module. The switch performance detection module is used to acquire switch performance information, acquire the data acquisition task, obtain target switch performance information based on the data acquisition task and the switch performance information, and send the target switch performance information to the switch data acquisition module. The target switch performance information includes the target switch CPU utilization rate and the target switch memory utilization rate. The switch data acquisition module is further configured to obtain the target switch performance information from the switch performance detection module based on the data acquisition task, and determine the data item type information to be acquired based on the target switch performance information, including: if the CPU utilization rate of the first target switch is greater than the CPU utilization rate of the second target switch, the number of data items to be acquired corresponding to the CPU utilization rate of the first target switch is less than the number of data items to be acquired corresponding to the CPU utilization rate of the second target switch. If the memory utilization rate of the first target switch is greater than the memory utilization rate of the second target switch, the number of data items collected corresponding to the memory utilization rate of the first target switch is less than the number of data items collected corresponding to the memory utilization rate of the second target switch. The switch data acquisition module is further configured to write the data item type information into the Simple Network Management Protocol (SMMP) to obtain a SMMP request, send the SMMP 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 acquire 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 are communicatively connected, the memory storing computer instructions, and the processor executing the computer instructions to perform the method for data acquisition of a monitoring system as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to perform the method for data acquisition of a monitoring system as described in 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