A BMC storage area log collection method and device, a terminal and a storage medium
By collecting the identifier value of log files in the BMC storage area to distinguish duplicate logs, and combining the passive and active collection methods of the operating system, the problem of duplicate logs in the BMC storage area log collection is solved, reducing system space usage and improving collection efficiency.
Patent Information
- Application Number
- CN202211047242.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-08-30
AI Technical Summary
Existing technologies sometimes result in duplicate log collection or failure to collect target logs during the log collection process in the BMC storage area, leading to high storage space utilization.
By collecting the identifier values (such as SHA256 or MD5 values) of log files, duplicate log files are distinguished, a packaged file is generated and sent to the operating system, and the collection of duplicate logs is reduced by combining the passive and active collection methods of the operating system.
This effectively reduces the collection of duplicate logs, lowers system space usage, and ensures the integrity of log files and collection efficiency.
Smart Images

Figure CN115470188B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of log collection, and specifically to a method, apparatus, terminal, and storage medium for collecting logs from a BMC storage area. Background Technology
[0002] In the early stages of product development, various tests need to be performed on the BMC or BIOS in CentOS or KylinOS. To facilitate problem localization, logs from the BMC, BIOS, CPLD, and others are collected through the BMC. Due to the limited storage space of the BMC, and the frequent long-term stability tests in the early stages of development, the logs stored in the BMC may become full, resulting in the collection of logs often containing duplicates or failing to collect the target logs at once.
[0003] Based on the above problems, patent application CN202010590056.2 discloses a BMC log collection and management method, including: setting the storage peak of the log storage system, the size limit of each log compressed file, and the maximum number of log compressed files that can be saved at one time; setting the naming rules for log compressed files; formulating log saving rules based on the tags of the log compressed file names, the storage peak, the number limit, and the size limit; after the log storage system starts, it obtains new log compressed files and manages the log compressed files according to the formulated naming and saving rules. Patent application CN202110860920.0 discloses a BMC log collection method and system, including: determining the log collection mode; when the log collection mode is automatic collection, prioritizing all devices based on user behavior and device status, determining the devices with a user behavior priority set and the devices with a device operating status priority set; reading the data in the sets and processing it using IP rules to determine the devices that need log collection; parsing the device information of the devices that need log collection; and collecting device logs based on the parsing results.
[0004] Existing methods constrain the requirements for BMC log collection to meet the needs, but they do not solve the problem of duplicate log collection in the BMC storage area or failure to collect the target log in one go. Summary of the Invention
[0005] To address the aforementioned problems, this invention provides a method, apparatus, terminal, and storage medium for collecting logs in the BMC storage area, thereby reducing redundant log collection.
[0006] In a first aspect, the technical solution of the present invention provides a method for collecting logs in a BMC storage area, comprising the following steps:
[0007] When the size of a certain type of log reaches a threshold, retrieve all current log files of that type.
[0008] Collect the identifier values of each log file retrieved;
[0009] Each identifier value is compared with the data in the current identifier value table, the new identifier value is selected, and the new identifier value is updated to the current identifier value table to form a new identifier value table;
[0010] Package the log files corresponding to the newly added identifier values to generate a package file;
[0011] Trigger the operating system to passively collect logs, and collect the packaged files into the operating system.
[0012] Furthermore, the method also includes the following steps:
[0013] If the operating system fails to respond when passively collecting logs, wait for the operating system to actively collect the packaged files.
[0014] If the size of a certain type of log reaches the threshold again during the waiting process, all log files of that type of log are retrieved, and the identifier value of each log file is collected and compared with the data in the current identifier value table. The newly added identifier value is selected and updated to the current identifier value table. The log file corresponding to the newly added identifier value is compressed into the current packaged file to generate a new packaged file.
[0015] The operating system actively collects the latest packaged files.
[0016] Furthermore, the method also includes the following steps:
[0017] When the operating system triggers the active collection of packaged files, it retrieves all current log files in the BMC storage area for various types of logs, collects the identifier value of each log file, compares it with the data in the current identifier value table, selects the newly added identifier value to update the current identifier value table, and compresses the log file corresponding to the newly added identifier value into the currently packaged file to generate the latest packaged file.
[0018] The operating system actively collects the latest packaged files.
[0019] Furthermore, the method also includes the following steps:
[0020] Pre-configure the maximum number of log files in the package file for various types of logs;
[0021] If the number of log files in a package file for a certain type of log has reached the preset maximum value, when a new log file with a newly added identifier value needs to be compressed into the current package file, the log file with the longest storage time in the current package file will be deleted to make room for the new log file with the newly added identifier value.
[0022] Furthermore, the method also includes the following steps:
[0023] Each time a log file is retrieved, the log file corresponding to the newly added identifier value is packaged, and the log file corresponding to the remaining duplicate identifier values is deleted.
[0024] Furthermore, the method also includes the following steps:
[0025] After the packaged file is collected into the operating system, the packaged file on the BMC side is deleted.
[0026] Furthermore, the identifier value of the log file is either a SHA256 value or an MD5 value.
[0027] Secondly, the technical solution of the present invention provides a BMC storage area log collection device, comprising,
[0028] Log size threshold monitoring module: Monitors whether the size of various logs in the BMC storage area reaches the threshold;
[0029] Log file retrieval module: Retrieves all log files of a certain type that have reached a certain size threshold;
[0030] Identifier value acquisition module: Acquires identifier values from log files;
[0031] Identifier value recording module: compares the collected identifier values with the data in the identifier value table, selects the newly added identifier values and updates them to the identifier value table to form a new identifier value table;
[0032] File packaging module: Packages the log files corresponding to the newly added identifier values to generate a package file;
[0033] Operating system passive collection trigger module: triggers the passive collection of operating system logs, collecting the packaged files into the operating system;
[0034] Operating System Active Collection Module: Enables the operating system to actively collect packaged files.
[0035] Thirdly, the technical solution of the present invention provides a terminal, comprising:
[0036] Memory used to store the BMC storage area log collection program;
[0037] A processor, configured to implement the steps of the BMC storage area log collection method as described above when executing the BMC storage area log collection program.
[0038] Fourthly, the present invention provides a computer-readable storage medium storing a BMC storage area log collection program, wherein the BMC storage area log collection program, when executed by a processor, implements the steps of the BMC storage area log collection method as described in any of the above claims.
[0039] This invention provides a log collection method, apparatus, terminal, and storage medium for the BMC storage area. Compared with existing technologies, it has the following advantages: When the log size in the BMC storage area reaches a threshold, duplicate log files are distinguished by collecting the identifier values of the log files, and then non-duplicate files are filtered and packaged for sending to the operating system. This invention can reduce the collection of duplicate logs and reduce system space occupancy without reducing the number of log files. Preferably, the log collection method distinguishes between passive and active collection by the operating system, realizing log collection using different methods. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a schematic diagram of a BMC storage area log collection method provided in Embodiment 1 of the present invention.
[0042] Figure 2 This is a schematic diagram of a BMC storage area log collection method provided in Embodiment 2 of the present invention.
[0043] Figure 3 This is a schematic block diagram of a BMC storage area log collection device provided in Embodiment 3 of the present invention.
[0044] Figure 4 This is a schematic diagram of the structure of a terminal provided in Embodiment 4 of the present invention. Detailed Implementation
[0045] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] Example 1
[0047] Embodiment 1 of this invention provides a log collection method for the BMC storage area. When a log record in the BMC storage area reaches a threshold, the BMC actively records the identifier value (unique identity value) of each log file and packages all log files. At this time, when the BMC triggers the OS to passively collect logs, the currently packaged files are collected into the main system. If a log record in the BMC storage area reaches the threshold again, the identifier value of the current log file is calculated and compared with the previously recorded value. If a log file has not changed, it is a duplicate log, and this log file is not packaged into the main system. Only the logs that have changed are uploaded to the OS system.
[0048] Figure 1 This is a schematic diagram of a BMC storage area log collection method provided in Embodiment 1 of the present invention, as shown below. Figure 1 As shown, the method includes the following steps.
[0049] S1, when the size of a certain type of log reaches the threshold, retrieve all current log files of that type of log.
[0050] The BMC storage area records various types of logs, including BMC logs, BIOS logs, CPLD logs, and other logs. For each type of log, there is a corresponding log size threshold in the BMC storage area. The size of each type of log is monitored, and the collection method of this embodiment is executed for each type of log.
[0051] S2 collects the identifier values of each log file retrieved.
[0052] The identifier value is a unique identifier for a log file, used to distinguish duplicate files.
[0053] S3. Compare each identifier value with the data in the current identifier value table, select the new identifier value, update the current identifier value table with the new identifier value, and form a new identifier value table.
[0054] Understandably, an initial identifier value table is pre-stored before the program starts. The data in the initial identifier value table is empty. In this way, the identifier values of all log files retrieved for the first time after the program starts are all newly added identifier values. All log files retrieved for the first time will be packaged and collected into the operating system.
[0055] The log files retrieved later need to be filtered to identify non-duplicate log files based on the comparison of the identifier values. If there are two log files with the same identifier value, it means that the two log files are the same and belong to duplicate log files. They will not be packaged and collected. Only non-duplicate log files will be packaged and collected.
[0056] Of course, each new identifier value is updated in the identifier value table. As the data in the identifier value table gradually increases, duplicate log files from all previous log files are filtered out.
[0057] S4. Package the log files corresponding to the newly added identifier values to generate a package file.
[0058] Since the log files corresponding to the newly added identifier values are packaged together, it can be ensured that no duplicate files are collected into the operating system.
[0059] S5 triggers the operating system to passively collect logs, collecting the packaged files into the operating system.
[0060] After the packaged file is generated, BMC triggers the operating system to perform a passive collection operation, collecting the packaged file into the operating system.
[0061] This invention provides a BMC (Browser Control Center) storage area log collection method. When the log size in the BMC storage area reaches a threshold, it distinguishes duplicate log files by collecting the identifier values of the log files, then filters out non-duplicate files, and packages and sends the filtered non-duplicate files to the operating system. This invention can reduce the collection of duplicate logs and reduce system space occupancy without reducing the number of log files.
[0062] Example 2
[0063] Embodiment 2 of the present invention provides a method for collecting BMC storage area logs, which divides the log collection method into two cases: one is that the BMC notifies the operating system, so that the operating system passively collects the BMC storage area logs, and the other is that the operating system actively collects the BMC storage area logs through tools, so as to avoid the operating system being unable to collect logs due to passive collection failure.
[0064] Figure 2 This is a schematic diagram of a BMC storage area log collection method provided in Embodiment 2 of the present invention, as shown below. Figure 2 As shown, the method includes the following steps.
[0065] S1, when the size of a certain type of log reaches the threshold, retrieve all current log files of that type of log.
[0066] S2 collects the identifier values of each log file retrieved.
[0067] S3. Compare each identifier value with the data in the current identifier value table, select the new identifier value, update the current identifier value table with the new identifier value, and form a new identifier value table.
[0068] S4. Package the log files corresponding to the newly added identifier values to generate a package file.
[0069] S5 triggers the operating system to passively collect logs.
[0070] S6. If the operating system passively collects logs and responds, the operating system passively collects logs and collects the packaged file into the operating system.
[0071] S7: If the operating system does not respond to the passive collection of logs, wait for the operating system to actively collect the packaged files.
[0072] S8. During the waiting process, if the size of a certain type of log reaches the threshold again, then retrieve all log files of that type of log.
[0073] During the waiting process, the logs in the BMC storage area continue to increase, so there is a possibility that the log size will reach the threshold again.
[0074] S9 collects the identifier values of each log file retrieved.
[0075] S10: Compare each identifier value with the data in the current identifier value table, select the new identifier value, update the current identifier value table with the new identifier value, and form a new identifier value table.
[0076] S11, compress the log file corresponding to the newly added identifier value into the currently packaged file to generate a new packaged file.
[0077] S12, repeat steps S7-S11 until the operating system actively collects the latest packaged file.
[0078] Embodiment 2 of this invention provides a log collection method for the BMC storage area. When the log size in the BMC storage area reaches a threshold, duplicate log files are distinguished by collecting the identifier values of the log files. Non-duplicate files are then filtered, and the filtered non-duplicate files are packaged and sent to the operating system. This invention can reduce the collection of duplicate logs, thereby reducing system space occupancy without reducing the number of log files. Preferably, the log collection method distinguishes between passive and active collection by the operating system, enabling log collection using different methods.
[0079] Based on the above embodiments, as a preferred implementation, when the operating system actively collects packaged files, in addition to collecting the latest packaged files, it also collects the log files being recorded in the BMC storage area at the same time, thereby improving collection efficiency.
[0080] Specifically, when the operating system triggers the active collection of packaged files, it retrieves all current log files in the BMC storage area for various types of logs, collects the identifier value of each log file, compares it with the data in the current identifier value table, selects the newly added identifier value to update the current identifier value table, and compresses the log file corresponding to the newly added identifier value into the currently packaged file to generate the latest packaged file.
[0081] This preferred embodiment compresses the log file corresponding to the newly added identifier value in the log file currently being recorded in the BMC storage area into the corresponding package file, generating a new package file. The operating system will actively collect this new package file, improving collection efficiency and saving space for the BMC.
[0082] During the waiting process, if no log files are collected for a long time, the number of log files in the packaged file will increase. To save storage space, log files are retrieved as needed. As the preferred real-time method, the maximum number of log files in the packaged file for various types of logs is pre-configured so that the number of log files in the packaged file reaches this maximum value. If new log files arrive, some log files in the packaged file need to be deleted to ensure the number of log files in the packaged file.
[0083] Specifically, if the number of log files in a package file for a certain type of log has reached the preset maximum value, when a new log file with a newly added identifier value needs to be compressed into the current package file, the log file with the longest storage time in the current package file will be deleted to make room for the new log file with the newly added identifier value.
[0084] In other words, while waiting for active collection, if the number of log files in the packaged file continues to increase, when the maximum number is reached, it is necessary to first delete some of the oldest log files in the packaged file to free up space before adding new log files. For example, if the maximum number is 30 and there are currently 30 log files, and two new log files need to be retrieved from the BMC storage area and added to the packaged file, then the two oldest and second oldest log files in the packaged file need to be identified and deleted. After deletion, the two newly retrieved log files are added to the packaged file, generating a new packaged file.
[0085] To save storage space, each time a log file is retrieved, the log file corresponding to the newly added identifier value is packaged, and the log files corresponding to the remaining duplicate identifier values are deleted; after the packaged file is collected into the operating system, the packaged file on the BMC side is deleted.
[0086] In practice, the SHA256 or MD5 value of the log file can be calculated as the identifier of the log file.
[0087] To further understand this solution, based on the above embodiments, the following specific embodiment is provided to further illustrate the invention in detail.
[0088] The specific implementation process is as follows:
[0089] When a certain log size in the BMC storage area reaches a threshold, the BMC will actively record the SHA256 / MD5 values of each file and package all the files into A.tar.gz.
[0090] If the BMC triggers the OS to passively collect logs at this time and there is a response, the currently packaged file A.tar.gz is collected into the main system. If a log file in the BMC storage area reaches the threshold size again, the sha256 / MD5 value of the file is calculated and compared with the previously recorded value. If a file has not changed, it is a duplicate log and is not collected. The remaining files are packaged into B.tar.gz and uploaded to the OS. The B.tar.gz file in the BMC storage area is then deleted. Since the BMC triggers the OS to passively collect logs at this time, there is no problem of missing collection logs.
[0091] If the BMC system triggers the OS to passively collect logs but receives no response, it waits for the OS to actively collect the file A.tar.gz from the BMC storage area. If, at this time, the size of a log file in the BMC system storage area reaches a threshold, the SHA256 / MD5 values of each file are calculated and compared with the SHA256 / MD5 values of the files in A.tar.gz. A.tar.gz is then decompressed, and the different files are added to the decompressed folder and packaged into a compressed archive, B.tar.gz. If the OS actively collects BMC / BIOS logs, B.tar.gz and the currently being recorded files in the storage area are packaged into C.tar.gz and uploaded to the OS system, and B.tar.gz is deleted. If the OS never actively collects BMC / BIOS logs, the compressed files in the BMC storage area are never collected. In this case, based on the user-defined number of files, the oldest logs are deleted, ensuring the latest files are preserved.
[0092] Example 3
[0093] The foregoing has described in detail an embodiment of a method for collecting BMC storage area logs. Based on the BMC storage area log collection method described in the above embodiment, this invention also provides an apparatus for collecting BMC storage area logs corresponding to the method.
[0094] Figure 3 This is a schematic block diagram of a BMC storage area log collection device provided in Embodiment 3 of the present invention, as shown in the figure. Figure 3 As shown, the device includes: a log size threshold monitoring module, a log file acquisition and recording module, an identifier value acquisition module, an identifier value recording module, a file packaging module, an operating system passive collection triggering module, and an operating system active collection module.
[0095] Log size threshold monitoring module: Monitors whether the size of various logs in the BMC storage area reaches the threshold.
[0096] Log file retrieval module: Retrieves all log files of a certain type of log that have reached a certain size threshold.
[0097] Identifier value acquisition module: Acquires the identifier values of log files.
[0098] Identifier value recording module: compares the collected identifier values with the data in the identifier value table, selects the newly added identifier values and updates them to the identifier value table to form a new identifier value table.
[0099] File packaging module: Packages the log files corresponding to the newly added identifier values to generate a package file.
[0100] Operating System Passive Collection Trigger Module: Triggers the passive collection of operating system logs, collecting the packaged files into the operating system.
[0101] Operating System Active Collection Module: Enables the operating system to actively collect packaged files.
[0102] The BMC storage area log collection in this embodiment is used to implement the aforementioned BMC storage area log collection method. Therefore, the specific implementation of this device can be found in the embodiment section of the BMC storage area log collection method above. Thus, the specific implementation can be referred to the description of the corresponding embodiments, and will not be elaborated here.
[0103] Furthermore, since the BMC storage area log collection device in this embodiment is used to implement the aforementioned BMC storage area log collection method, its function corresponds to the function of the above method, and will not be described again here.
[0104] Example 4
[0105] Figure 4 A schematic diagram of a terminal device 400 provided in an embodiment of the present invention includes: a processor 410, a memory 420, and a communication unit 430. The processor 410 is used to implement the following steps when executing the BMC storage area log collection program stored in the memory 420:
[0106] When the size of a certain type of log reaches a threshold, retrieve all current log files of that type.
[0107] Collect the identifier values of each log file retrieved;
[0108] Each identifier value is compared with the data in the current identifier value table, the new identifier value is selected, and the new identifier value is updated to the current identifier value table to form a new identifier value table;
[0109] Package the log files corresponding to the newly added identifier values to generate a package file;
[0110] Trigger the operating system to passively collect logs, and collect the packaged files into the operating system.
[0111] This invention, when the log size in the BMC storage area reaches a threshold, distinguishes duplicate log files by collecting their identifier values, then filters out non-duplicate files, and packages the filtered non-duplicate files for transmission to the operating system. This invention reduces the collection of duplicate logs, lowering system space usage without reducing the number of log files. Preferably, it differentiates between passive and active log collection by the operating system, enabling different collection methods for each.
[0112] The terminal device 400 includes a processor 410, a memory 420, and a communication unit 430. These components communicate via one or more buses. Those skilled in the art will understand that the server structure shown in the figure does not constitute a limitation of the present invention. It can be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0113] The memory 420 can be used to store the execution instructions of the processor 410. The memory 420 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. When the execution instructions in the memory 420 are executed by the processor 410, the terminal 400 is able to perform some or all of the steps in the above method embodiments.
[0114] The processor 410 serves as the control center of the storage terminal, connecting various parts of the electronic terminal via various interfaces and lines. It executes software programs and / or modules stored in the memory 420, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 410 may consist only of a central processing unit (CPU). In this embodiment of the invention, the CPU may have a single processing core or include multiple processing cores.
[0115] The communication unit 430 is used to establish a communication channel, enabling the storage terminal to communicate with other terminals. It can receive user data sent by other terminals or send user data to other terminals.
[0116] Example 5
[0117] The present invention also provides a computer storage medium, which may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0118] The computer storage medium stores a BMC (Browser Memory Management System) log collection program, which, when executed by the processor, performs the following steps:
[0119] When the size of a certain type of log reaches a threshold, retrieve all current log files of that type.
[0120] Collect the identifier values of each log file retrieved;
[0121] Each identifier value is compared with the data in the current identifier value table, the new identifier value is selected, and the new identifier value is updated to the current identifier value table to form a new identifier value table;
[0122] Package the log files corresponding to the newly added identifier values to generate a package file;
[0123] Trigger the operating system to passively collect logs, and collect the packaged files into the operating system.
[0124] This invention, when the log size in the BMC storage area reaches a threshold, distinguishes duplicate log files by collecting their identifier values, then filters out non-duplicate files, and packages the filtered non-duplicate files for transmission to the operating system. This invention reduces the collection of duplicate logs, lowering system space usage without reducing the number of log files. Preferably, it differentiates between passive and active log collection by the operating system, enabling different collection methods for each.
[0125] Those skilled in the art will clearly understand that the techniques in the embodiments of the present invention can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium such as a USB flash drive, mobile hard drive, read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, or other media capable of storing program code. It includes several instructions to cause a computer terminal (which may be a personal computer, server, or a second terminal, network terminal, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0126] In the embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0128] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0129] The above-disclosed embodiments are merely preferred embodiments of the present invention, but the present invention is not limited thereto. Any non-creative variations that can be conceived by those skilled in the art, as well as any improvements and modifications made without departing from the principles of the present invention, should fall within the protection scope of the present invention.
Claims
1. A BMC storage area log collection method, characterized by, The method comprises the following steps: When the size of a certain type of log reaches a threshold value, all log files of the type of log are taken out; The identification values of the taken-out log files are collected; The collected identification values are compared with the data in the current identification value table, and new identification values are selected and updated to the current identification value table to form a new identification value table; The log files corresponding to the new identification values are packed to generate a packed file; The operating system is triggered to passively collect logs, and the packed file is collected to the operating system; The method further comprises the following steps: After the log files are taken out each time, the log files corresponding to the new identification values are packed, and then the log files corresponding to the remaining repeated identification values are deleted; The method further comprises the following steps: After the packed file is collected to the operating system, the packed file at the BMC end is deleted. 2.The BMC storage area log collection method according to claim 1, characterized in that, The method further comprises the following steps: If the triggering of the operating system to passively collect logs does not respond, the operating system is waited to actively collect the packed file; During the waiting process, if the size of a certain type of log again reaches a threshold value, all log files of the type of log are taken out, the identification values of the log files are collected, the collected identification values are compared with the data in the current identification value table, new identification values are selected and updated to the current identification value table, and the log files corresponding to the new identification values are compressed into the current packed file to generate a new packed file; The operating system actively collects the latest packed file. 3.The BMC storage area log collection method according to claim 2, characterized in that, The method further comprises the following steps: When the operating system triggers to actively collect the packed file, all log files in the BMC storage area are taken out for each type of log, the identification values of the log files are collected, the collected identification values are compared with the data in the current identification value table, new identification values are selected and updated to the current identification value table, and the log files corresponding to the new identification values are compressed into the current packed file to generate the latest packed file; The operating system actively collects the latest packed file.
4. The BMC storage area log collection method according to claim 3, characterized by, The method further comprises the following steps: The maximum number of log files in the packed file of each type of log is pre-configured; If the number of log files in the packed file of a certain type of log has reached the preset maximum value, the log file with the longest stored time in the current packed file is deleted when a new log file with a new identification value needs to be compressed into the current packed file.
5. The BMC storage area log collection method according to claim 4, characterized by, The identification value of the log file is a sha256 value or an MD5 value.
6. A BMC storage area log collection apparatus characterized by comprising: The method comprises, A log size threshold value monitoring module: monitoring whether the size of each type of log in the BMC storage area reaches a threshold value; A log file acquisition recording module: taking out all log files of a certain type of log whose size reaches a threshold value; An identification value collection module: collecting the identification values of the log files; An identification value recording module: comparing the collected identification values with the data in the identification value table, selecting new identification values, updating the new identification values to the identification value table, and forming a new identification value table; A file packing module: packing the log files corresponding to the new identification values to generate a packed file; An operating system passive collection triggering module: triggering the operating system to passively collect logs and collect the packed file to the operating system; An operating system active collection module: for the operating system to actively collect the packed file; The device is further used for Each time the log file is taken out, the log file corresponding to the new identification value is packed, and the log file corresponding to the remaining repeated identification value is deleted; After the packed file is collected to the operating system, the packed file at the BMC end is deleted.
7. A terminal, characterized by comprising: The method comprises the following steps: a memory for storing a BMC storage area log collection program; a processor for implementing the steps of the BMC storage area log collection method according to any one of claims 1-5 when the BMC storage area log collection program is executed.
8. A computer-readable storage medium, characterized in that, The readable storage medium stores a BMC storage area log collection program, and the steps of the BMC storage area log collection method according to any one of claims 1-5 are implemented when the BMC storage area log collection program is executed by the processor.
Citation Information
Patent Citations
BMC log collection and management method and system, terminal and storage medium
CN111858528A
BMC log collection method and system
CN113656367A
Log information management method and log extraction server
CN105071966A