A BMC log collection method and system
By prioritizing the BMC log collection method and data processing, the problem of low log collection efficiency in the existing technology is solved, and efficient and energy-saving log collection effect is achieved.
Patent Information
- Application Number
- CN202110860920.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-29
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2041-07-29
AI Technical Summary
The existing methods of using BMC for log collection are inefficient, especially in large-scale data center application scenarios, which leads to excessive load on log collection equipment and may even cause server unavailability.
By prioritizing all devices based on user behavior and device status, determining the priority set of user behavior and device operation status, and processing the data by establishing IP rules, determining the devices that need to be collected from BMC logs, thereby realizing the implementation of Efficient log collection.
It improves log collection efficiency, saves computing and storage resources, avoids the problem of excessive server load, and meets the log collection needs of devices with higher priority.
Smart Images

Figure CN113656367B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of server log management, and in particular to a BMC (Baseboard Management Controller) log collection method and system. Background Art
[0002] With the rapid development of computer software and hardware technology, more and more organizations, companies and institutions have their own network devices such as servers, switches and firewalls. As these organizations, companies and institutions grow and develop, their hardware network devices are also increasing, and equipment maintenance has become an important issue. During the operation of the equipment, many important operations will be written into the corresponding logs, so log files play a very important role in equipment maintenance. Therefore, how to use BMC to collect logs to provide effective evidence for equipment maintenance is an important technical issue.
[0003] At present, the method of using BMC for log collection is usually to collect and display device logs through logstash, elasticsearch, and Kibana. Specifically, on the logstash platform, logs of all devices are collected and processed according to the elasticsearch search engine, and displayed on the Kibana platform for users to access.
[0004] However, the current method of using BMC for log collection requires more storage and computing resources because logs are collected and organized for all devices. Especially in large-scale data center application scenarios, collecting and organizing logs for all devices at the same time will cause the log collection device to be overloaded, and may even cause the server to be unavailable. Moreover, the operation and maintenance of the computer room does not pay much attention to some devices that are running normally, and correspondingly, these logs are sometimes not needed to be collected. Therefore, the current method of using BMC for log collection has a low log collection efficiency. Summary of the invention
[0005] The present application provides a BMC log collection method and system to solve the problem that the log collection method in the prior art has low log collection efficiency.
[0006] In order to solve the above technical problems, the embodiments of the present application disclose the following technical solutions:
[0007] A BMC log collection method, the method comprising:
[0008] Determine a log collection method according to the acquired command, wherein the log collection method includes: automatic collection and manual collection;
[0009] When the log collection method is automatic collection, all devices are prioritized according to user behavior and device status, and devices prioritized by user behavior and devices prioritized by device operation status are determined;
[0010] Reading data in the user behavior priority set and the device operation status priority set, and processing the data by establishing IP rules to determine the devices for which BMC log collection is required;
[0011] Analyze device information for devices that require BMC log collection;
[0012] Collect device logs based on the results of device information analysis.
[0013] Optionally, when the log collection mode is automatic collection, a method for prioritizing all devices according to user behavior and device status, and determining devices in a user behavior priority group and a device operation status priority group includes:
[0014] When the log collection mode is automatic collection, all devices are prioritized according to device status, devices in a priority set of device operation status are determined, and the priority set of device operation status is updated;
[0015] Prioritize all devices based on user behavior, determine devices in the user behavior priority set, and update the user behavior priority set.
[0016] Optionally, when the log collection mode is automatic collection, the method of prioritizing all devices according to device status, determining devices in a device operation status priority set, and updating the device operation status priority set includes:
[0017] Obtaining alarm information of the current device, wherein the alarm information includes: alarm type and alarm level;
[0018] Determine the device state of the current device according to the alarm type and the alarm level, wherein the device state includes, in descending order of alarm levels: emergency state, moderate state, slight state, and normal state;
[0019] Add devices in emergency status to the priority set of device operating status;
[0020] When the device status changes, determine whether the current device status exceeds the alarm level of the current device at the previous moment;
[0021] If yes, add the current device to the device operation status priority set.
[0022] Optionally, the method of prioritizing all devices according to user behavior, determining devices in a user behavior priority set, and updating the user behavior priority set includes:
[0023] Based on the log query information of any device by the user, the operation time of the user's log query is recorded;
[0024] Within a set time period, determining whether the frequency of the user performing log queries on any of the devices is greater than or equal to a set frequency threshold;
[0025] If so, add any of the devices to the user behavior priority set.
[0026] If not, no update is made to the user behavior priority set.
[0027] Optionally, the set time period is one week, and the set frequency threshold is 3 times.
[0028] Optionally, determining the log collection method according to the acquired command includes:
[0029] When the acquired command is a timed collection command, determining that the log collection mode is automatic collection;
[0030] When the acquired command is a single collection command, it is determined that the log collection mode is manual collection.
[0031] Optionally, the method further comprises:
[0032] When the log collection method is manual collection, a BMC log collection request is sent to the device requiring log collection in a page request manner;
[0033] According to the obtained BMC log collection request, the device that needs to collect logs returns corresponding response information;
[0034] According to the response information, analyze the device information of the device for which logs need to be collected;
[0035] Collect device logs based on the results of device information analysis.
[0036] Optionally, the processing of the data by establishing IP rules includes:
[0037] Processing the data by removing data corresponding to a specified IP or a specified IP segment; or,
[0038] The data is processed by collecting data corresponding to a specified IP or a specified IP segment.
[0039] A BMC log collection system, the system comprising:
[0040] A log collection mode determination module, used to determine a log collection mode according to the acquired command, wherein the log collection mode includes: automatic collection and manual collection;
[0041] A priority classification module, used to prioritize all devices according to user behavior and device status when the log collection mode is automatic collection, and determine the devices in the user behavior priority set and the devices in the device operation status priority set;
[0042] A priority set data processing module, used to read the data in the user behavior priority set and the device operation status priority set, and process the data by establishing IP rules to determine the devices for which BMC log collection is required;
[0043] The parsing module is used to parse the device information of the device that needs to collect BMC logs;
[0044] The log collection module is used to collect device logs based on the results of device information analysis.
[0045] Optionally, the system further includes: a manual collection module, which is used to send a BMC log collection request to a device requiring log collection by using a page request method when the log collection method is manual collection.
[0046] The technical solution provided by the embodiments of the present application may have the following beneficial effects:
[0047] The present application provides a BMC log collection method, which first determines the log collection mode according to the acquired command. When the log collection mode is automatic collection, all devices are prioritized according to user behavior and device status, and devices in the user behavior priority set and devices in the device operation status priority set are determined; secondly, the data in the user behavior priority set and the device operation status priority set are read, and the data is processed by establishing IP rules to determine the devices that need to be BMC log collected; then, the device information of the devices that need to be BMC log collected is parsed; finally, the device log is collected according to the result of the device information parsing. When the present embodiment automatically collects logs, the devices are differentiated based on the two dimensions of user behavior and device status, and the data in the limited set is processed to determine the devices with higher priority levels, so as to ensure that the BMC logs are collected for the devices with higher priority levels. Compared with the method of collecting and sorting logs of all devices at the same time in the prior art, the log collection method in the present embodiment can effectively improve the efficiency of log collection and save computing and storage resources.
[0048] The present application also provides a BMC log collection system, which mainly includes: a log collection method determination module, a priority division module, a priority set data processing module, a parsing module and a log collection module. The current log collection method is determined by the log collection method determination module. When the collection method is automatic collection, the priority division module is used to prioritize all devices according to the two dimensions of user behavior and device status, and the user behavior priority set and the device operation status priority combination are determined. Then, the priority set data processing module uses the method of establishing IP rules to process the relevant data, and determines the devices that need to be collected by BMC logs, so that devices with higher priority levels can be selected for BMC log collection. This method can avoid collecting logs for all devices at the same time on the basis of meeting user needs, which is conducive to greatly improving the efficiency of log collection and saving the computing and storage resources of the server.
[0049] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0051] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 A flow chart of a BMC log collection method provided in an embodiment of the present application;
[0053] Figure 2 A schematic diagram of the structure of a BMC log collection system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.
[0055] Logstash is a platform for transmitting, processing, managing and searching application logs and events. Logstash can be used to collect and manage application logs in a unified manner, provide a web interface for query and statistics, and is responsible for collecting and filtering data. Elasticsearch is a distributed, free, open source search and analysis engine that is suitable for all types of data, including text, numbers, geospatial, structured and unstructured data. Elasticsearch is known for its simple REST-style API, distributed characteristics, speed and scalability. It is the core component of the Elastic Stack and is responsible for storing data. Kibana is an open source analysis and visualization platform that is usually used with Elasticsearch. Kibana can be used to search and view data stored in Elasticsearch. Kibana interacts with Elasticsearch through various charts, tables, maps, etc., which intuitively display data, thereby achieving the purpose of advanced data analysis and visualization.
[0056] In order to better understand the present application, the implementation methods of the present application are explained in detail below with reference to the accompanying drawings.
[0057] Embodiment 1
[0058] See also Figure 1 , Figure 1 A flow chart of a BMC log collection method provided in an embodiment of the present application. Figure 1 It can be seen that the BMC log collection method in this embodiment mainly includes the following processes:
[0059] S1: Determine the log collection method based on the obtained command.
[0060] The log collection methods in this embodiment include: automatic collection and manual collection. Automatic collection is generally used. When a user views the log of a device, if the log of the device is not stored in Elasticsearch, a manual collection operation of the device BMC log is triggered.
[0061] Specifically, step S1 includes the following process:
[0062] S11: When the acquired command is a scheduled collection command, determine that the log collection mode is automatic collection.
[0063] In this embodiment, the automatic collection method is a conventional method, and usually a timed collection method is adopted, that is, a fixed collection frequency is set, and the device BMC log is automatically collected once every set time.
[0064] S12: When the acquired command is a single collection command, determine that the log collection mode is manual collection.
[0065] When the log collection mode is automatic collection, step S2 is executed: according to user behavior and device status, all devices are prioritized to determine devices in a user behavior priority group and devices in a device operation status priority group.
[0066] In this embodiment, when all devices are prioritized, they are differentiated based on two dimensions: user behavior and device status, where device status has a higher priority than user behavior, that is, the device status is prioritized first, and then the device is prioritized based on user behavior. This method can ensure that priority is given to the impact of device status on the server operation process, thereby improving the stability of server operation and further improving log collection efficiency. Moreover, when the total number of tasks that can be executed in the background is certain, this priority method will give the remaining capacity to the user behavior priority device after the device priority is differentiated, which is conducive to further improving resource utilization.
[0067] Specifically, step S2 includes the following process:
[0068] S21: When the log collection mode is automatic collection, all devices are prioritized according to device status, devices in a device operation status priority set are determined, and the device operation status priority set is updated.
[0069] Specifically, step S21 includes the following process:
[0070] S211: Acquire alarm information of the current device, wherein the alarm information at least includes: alarm type and alarm level.
[0071] S212: Determine the device status of the current device according to the alarm type and the alarm level.
[0072] The device status in this embodiment includes, in descending order of alarm levels, an emergency state, a moderate state, a minor state, and a normal state.
[0073] S213: Add the device in the emergency state to the device operation state priority set.
[0074] S214: When the device status changes, determine whether the current device status exceeds the alarm level of the current device at the previous moment.
[0075] If the current device state exceeds the alarm level of the current device at the last moment, execute step S215: add the current device to the device operation state priority set.
[0076] If the current device status does not exceed the alarm level of the current device at the previous moment, no change is made to the current device.
[0077] In summary, when all devices are prioritized according to their status, usually, devices in emergency status are added to the priority set of device operation status. This method can ensure that devices in emergency status with higher alarm levels can collect and update BMC logs in time, thereby improving the efficiency of log collection. When there is an abnormal change in the device status that exceeds the alarm level of the current device at the previous moment, according to step S215, the device is added to the priority set of device operation status. This method can ensure that BMC logs are collected and updated in time when the alarm level changes, thereby improving the stability of device operation, and is also conducive to improving the flexibility of BMC log collection, so that the collection method can collect and update important logs in time according to different scenarios, thereby improving the efficiency of log collection.
[0078] S22: Prioritize all devices according to user behavior, determine devices in the user behavior priority set, and update the user behavior priority set.
[0079] Specifically, step S22 includes the following process:
[0080] S221: According to the log query information of any device by the user, the operation time of the user performing the log query is recorded.
[0081] S222: Within a set time period, determine whether the frequency of the user performing log query on any device is greater than or equal to a set frequency threshold.
[0082] In this embodiment, the time period is set to one week, and the frequency threshold is set to 3 times. Such a time period and frequency threshold can ensure timely updating of the user behavior priority set, while not updating too frequently and occupying too many system resources, which is conducive to saving storage and computing system resources.
[0083] If the frequency of the user performing log query on any device is greater than or equal to the set frequency threshold, step S223 is executed: any device is added to the user behavior priority set, thereby updating the user behavior priority set.
[0084] If the frequency of the user performing log query on any device is less than the set frequency threshold, step S224 is executed: the user behavior priority set is not updated.
[0085] From the above steps S221-S224, it can be seen that when a user performs a log query of a device, according to the method in this embodiment, the user operation time and frequency will be recorded. When the user queries a device within a recent period of time and reaches a set frequency threshold, the device is added to the user behavior priority set, or the user behavior priority set is updated according to the set rules.
[0086] Continue to see Figure 1 It can be seen that after determining the devices in the user behavior priority set and the devices in the device operation status priority set, step S3 is executed: reading the data in the user behavior priority set and the device operation status priority set, and processing the data by establishing IP rules to determine the devices that need to collect BMC logs.
[0087] In this embodiment, the method of processing data by establishing IP rules includes two methods. The first method is to process the data by removing the data corresponding to the specified IP or the specified IP segment.
[0088] The second method is to process the data by collecting the data corresponding to the specified IP or specified IP segment.
[0089] That is, assuming that the data in the user behavior priority set and the device operation status priority set include the first data and the second data, define the data of the specified IP or the specified IP segment as the first data, and define the data other than the data of the specified IP or the specified IP segment as the second data. When the first method is adopted, after reading the data in the user behavior priority set and the device operation status priority set, the second data is eliminated, leaving the first data, and then the device for which BMC log collection is required is determined based on the first data. When the second method is adopted, after reading the data in the user behavior priority set and the device operation status priority set, the first data is collected, and the device for which BMC log collection is required is determined based on the first data.
[0090] Continue to see Figure 1 It can be seen that after determining the device for which BMC log collection is required, step S4 is executed: parsing device information of the device for which BMC log collection is required.
[0091] S5: Collect device logs based on the results of device information analysis.
[0092] Furthermore, the BMC log collection method in this embodiment further includes:
[0093] S6: When the log collection mode is manual collection, a BMC log collection request is sent to the device requiring log collection in a page request manner.
[0094] S7: According to the obtained BMC log collection request, the device that needs to collect logs returns corresponding response information.
[0095] In the manual collection method, after the device for which logs need to be collected returns the corresponding response information, the subsequent execution method is the same as the automatic collection method, which is to parse the device information and collect device logs based on the parsing results. Specifically, step S4: parse the device information for the device for which logs need to be collected based on the response information.
[0096] S5: Collect device logs based on the results of device information analysis.
[0097] Furthermore, the BMC log collection method in this embodiment further includes: manually updating the BMC log of the designated device according to the acquired manual update instruction.
[0098] Specifically, when the user needs to manually update the log file of a specified device, the user can manually click the update button, and after obtaining the update instruction, the log update is triggered to update the BMC log of the specified device separately.
[0099] Embodiment 2
[0100] exist Figure 1 Based on the embodiment shown, see Figure 2 , Figure 2 A schematic diagram of the structure of a BMC log collection system provided in an embodiment of the present application. Figure 2 It can be seen that the BMC log collection system in this embodiment mainly includes: a log collection mode determination module, a priority classification module, a priority set data processing module, a parsing module and a log collection module.
[0101] Among them, the log collection mode determination module is used to determine the log collection mode according to the acquired command, and the log collection modes include: automatic collection and manual collection; the priority division module is used to prioritize all devices according to user behavior and device status when the log collection mode is automatic collection, and determine the devices in the user behavior priority set and the devices in the device operation status priority set; the priority set data processing module is used to read the data in the user behavior priority set and the device operation status priority set, and process the data by establishing IP rules to determine the devices that need to collect BMC logs; the parsing module is used to parse the device information of the devices that need to collect BMC logs; the log collection module is used to collect device logs according to the results of the device information parsing.
[0102] The log collection mode determination module is used to determine the log collection mode as automatic collection when the acquired command is a scheduled collection command; and to determine the log collection mode as manual collection when the acquired command is a single collection command.
[0103] The priority division module includes: a device status priority division unit and a user behavior priority division unit. Among them, the device status priority division unit is used to prioritize all devices according to the device status when the log collection mode is automatic collection, determine the devices in the device operation status priority set, and update the device operation status priority set; the user behavior priority division unit is used to prioritize all devices according to user behavior, determine the devices in the user behavior priority set, and update the user behavior priority set.
[0104] Furthermore, the device status priority division unit further includes: an alarm information acquisition subunit, a device status determination subunit, a first adding subunit, a first judging unit, and a second adding subunit. Among them, the alarm information acquisition subunit is used to obtain the alarm information of the current device, and the alarm information includes: alarm type and alarm level; the device status determination subunit is used to determine the device status of the current device according to the alarm type and alarm level, and the device status includes: emergency state, moderate state, slight state and normal state in descending order according to the alarm level; the first adding subunit is used to add the device in the emergency state to the device operation status priority set; the first judging unit is used to judge whether the current device status exceeds the alarm level of the current device at the previous moment when the device status changes; the second adding subunit is used to add the current device to the device operation status priority set when the current device status exceeds the alarm level of the current device at the previous moment.
[0105] The user behavior priority division unit includes: a recording subunit, a second judgment subunit and a third adding subunit. Among them, the recording subunit is used to record the operation time of the user's log query based on the user's log query information for any device; the second judgment subunit is used to judge whether the frequency of the user's log query for any device is ≥ the set frequency threshold within the set time period. If the frequency of the user's log query for any device is ≥ the set frequency threshold, the third adding subunit is started; otherwise, if the frequency of the user's log query for any device is < the set frequency threshold, the user behavior priority set is not updated. The third adding subunit is used to add any device to the user behavior priority set when the frequency of the user's log query for any device is ≥ the set frequency threshold.
[0106] Furthermore, the BMC log collection system of this embodiment further includes a manual collection module, which is used to send a BMC log collection request to the device requiring log collection by using a page request when the log collection mode is manual collection.
[0107] The working principle and working method of the BMC log collection system in this embodiment are as follows: Figure 1 The embodiments shown have been described in detail, and the two embodiments can refer to each other, which will not be described again here.
[0108] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features disclosed herein.
Claims
1. A BMC log collection method, characterized in that: The method comprises: Determine a log collection method according to the acquired command, wherein the log collection method includes: automatic collection and manual collection; When the log collection method is automatic collection, all devices are prioritized according to user behavior and device status, and devices prioritized by user behavior and devices prioritized by device operation status are determined; Reading data in the user behavior priority set and the device operation status priority set, and processing the data by establishing IP rules to determine the devices for which BMC log collection is required; Analyze device information for devices that require BMC log collection; Collect device logs based on the results of device information analysis; When the log collection mode is automatic collection, the method of prioritizing all devices according to user behavior and device status, and determining devices with user behavior priority and devices with device operation status priority includes: When the log collection mode is automatic collection, all devices are prioritized according to device status, devices in a priority set of device operation status are determined, and the priority set of device operation status is updated; Prioritize all devices based on user behavior, determine devices in the user behavior priority set, and update the user behavior priority set; When the log collection mode is automatic collection, a method for prioritizing all devices according to device status, determining devices in a device operation status priority set, and updating the device operation status priority set includes: Obtaining alarm information of the current device, wherein the alarm information includes: alarm type and alarm level; Determine the device state of the current device according to the alarm type and the alarm level, wherein the device state includes, in descending order of alarm levels: emergency state, moderate state, slight state, and normal state; Add devices in emergency status to the priority set of device operating status; When the device status changes, determine whether the current device status exceeds the alarm level of the current device at the previous moment; If yes, add the current device to the device operation status priority set; The method of prioritizing all devices according to user behavior, determining devices in a user behavior priority set, and updating the user behavior priority set includes: Based on the log query information of any device by the user, the operation time of the user's log query is recorded; Within a set time period, determining whether the frequency of the user performing log queries on any of the devices is greater than or equal to a set frequency threshold; If yes, adding any of the devices to the user behavior priority set; If not, no update is made to the user behavior priority set.
2. A BMC log collection method according to claim 1, characterized in that: The set time period is one week, and the set frequency threshold is 3 times.
3. A BMC log collection method according to claim 1, characterized in that: Determining the log collection method according to the acquired command includes: When the acquired command is a timed collection command, determining that the log collection mode is automatic collection; When the acquired command is a single collection command, it is determined that the log collection mode is manual collection.
4. A BMC log collection method according to claim 3, characterized in that: The method further comprises: When the log collection method is manual collection, a BMC log collection request is sent to the device requiring log collection in a page request manner; According to the obtained BMC log collection request, the device that needs to collect logs returns corresponding response information; According to the response information, analyze the device information of the device for which logs need to be collected; Collect device logs based on the results of device information analysis.
5. A BMC log collection method according to claim 1, characterized in that: The method of establishing IP rules to process the data includes: Processing the data by removing data corresponding to a specified IP or a specified IP segment; or, The data is processed by collecting data corresponding to a specified IP or a specified IP segment.
6. A BMC log collection system, characterized in that: The system is used to implement the method according to claim 1, and the system comprises: A log collection mode determination module, used to determine a log collection mode according to the acquired command, wherein the log collection mode includes: automatic collection and manual collection; A priority classification module, used to prioritize all devices according to user behavior and device status when the log collection mode is automatic collection, and determine the devices in the user behavior priority set and the devices in the device operation status priority set; A priority set data processing module, used to read the data in the user behavior priority set and the device operation status priority set, and process the data by establishing IP rules to determine the devices for which BMC log collection is required; The parsing module is used to parse the device information of the device that needs to collect BMC logs; The log collection module is used to collect device logs based on the results of device information analysis.
7. A BMC log collection system according to claim 6, characterized in that: The system further includes: a manual collection module, which is used to send a BMC log collection request to a device requiring log collection by adopting a page request method when the log collection method is manual collection.
Citation Information
Patent Citations
Log monitoring method, apparatus and system
CN107104840A
Log alarming system based on user's personalized characteristics
CN109408331A