Fault log generation method and device
By integrating the parsing function of XML configuration files in BMC, the problem of omission of fault information caused by the long update time of BMC firmware is solved, and the reliability of rapid failure information analysis and display is improved.
Patent Information
- Application Number
- CN202110983608.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-25
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2041-08-25
AI Technical Summary
In the prior art, updating the parsing method during BMC firmware update takes a lot of time, resulting in the server that may not be able to record the fault information during the failure period, reducing the reliability of the server.
The parsing function is integrated into the XML configuration file. By loading the XML configuration file, the failure information is parsed to generate a fault description and sent to the management device, which avoids the time consumption of BMC firmware upgrades and improves the reliability of the collection and display of fault information.
It realizes rapid parsing of fault information, reduces the omission of fault information, and improves the reliability of server collection and display of fault information.
Smart Images

Figure CN113778962B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of communication technology, and in particular to a method and device for generating a fault log. Background Art
[0002] With the application and development of big data and cloud computing technologies, people's demand for servers is getting higher and higher. Therefore, the operating status of the server needs to be paid attention to at all times.
[0003] In a server, you can monitor the server's hardware status and manage it by setting up a BMC (Baseboard Management Controller). During deployment, multiple servers can be installed on a single chassis. A management device can be configured for multiple servers. This management device can connect to the BMCs of multiple servers to aggregate and display their operating status and fault information.
[0004] When a server fails, the BMC collects specific fault information, which is recorded in coded form and is referred to as raw data. The BMC analyzes the raw data based on the configured parsing method to generate an event log, which is then sent to the management device for display. This allows customers to quickly identify server failures on the management device's interface.
[0005] However, in the current implementation, the configuration of the parsing method is bound to the BMC firmware. Each update of the parsing method requires updating the BMC firmware, which takes a lot of time. If a server fails during this period, the BMC may not be able to record the fault information of the fault, resulting in the omission of the server's fault information, which reduces the reliability of the server. Summary of the Invention
[0006] To overcome the problems existing in the related art, this specification provides a method and device for generating a fault log.
[0007] In conjunction with the first aspect of the embodiments of this specification, the present application provides a fault log generation method, which is applied to the BMC of a server, comprising:
[0008] Loading the obtained XML configuration file, wherein the XML configuration file contains one or more parsing functions corresponding to the event code;
[0009] Collect fault information;
[0010] Determine a target event code corresponding to the fault information according to the fault information;
[0011] Determine the parsing function corresponding to the target event code from the XML configuration file;
[0012] Parse the fault information according to the analytical function and generate a fault description;
[0013] An alarm message carrying fault information, target event code, and fault description is sent to the management device so that the management device generates a fault log.
[0014] Optionally, the fault description includes: a target event code and at least one description field;
[0015] Parse the fault information according to the parsing function and generate a fault description, including:
[0016] Determine a field value of at least one description field according to the parsing function and the fault information;
[0017] Concatenate the field values of at least one description field to generate a fault description.
[0018] Optionally, after loading the obtained XML configuration file, it also includes:
[0019] Perform hash operation on the fault information to obtain the event index;
[0020] Establish the correspondence between event index and parsing function;
[0021] Determine the parsing function corresponding to the target event code from the XML configuration file, including:
[0022] Perform hash operation based on the received fault information to determine the target event index;
[0023] Determine the parsing function corresponding to the target event index from the XML configuration file.
[0024] Optionally, after loading the obtained XML configuration file, the following steps are also included:
[0025] Receive update patches for XML configuration files;
[0026] Update the stored XML configuration files according to the update patch;
[0027] Restart the BMC to load the updated XML configuration file.
[0028] Optionally, load the obtained XML configuration file, including:
[0029] Create a parsing process for fault information;
[0030] After loading the obtained extended markup language XML configuration file, it also includes:
[0031] Receive update patches for XML configuration files;
[0032] Update the stored XML configuration files according to the update patch;
[0033] Restart the parsing process and load the updated XML configuration file based on the parsing process.
[0034] Optionally, the XML configuration file also includes shielding items;
[0035] Sends an alarm message containing fault information, target event code, and fault description to the management device, including:
[0036] Determine whether the target event code hits the shielding item;
[0037] If the target event code hits the mask item, the alarm message carrying the fault information, target event code and fault description is prohibited from being sent to the management device;
[0038] If the target event code does not hit the mask item, an alarm message carrying fault information, target event code and fault description is sent to the management device.
[0039] In conjunction with the second aspect of the embodiments of this specification, the present application provides a fault log generation device, which is applied to the BMC of a server, including:
[0040] A loading unit, configured to load the acquired XML configuration file, wherein the XML configuration file includes one or more parsing functions corresponding to the event code;
[0041] A collection unit, used for collecting fault information;
[0042] a conversion unit, configured to determine a target event code corresponding to the fault information according to the fault information;
[0043] A determination unit, configured to determine a parsing function corresponding to a target event code from an XML configuration file;
[0044] A parsing unit, used to parse the fault information according to the parsing function and generate a fault description;
[0045] The sending unit is used to send an alarm message carrying fault information, a target event code and a fault description to the management device, so that the management device generates a fault log.
[0046] Optionally, the fault description includes: a target event code and at least one description field;
[0047] Parsing unit, including:
[0048] A description module, configured to determine a field value of at least one description field according to the parsing function and the fault information;
[0049] The splicing module is used to splice the field value of at least one description field to generate a fault description.
[0050] Optionally, the device further includes:
[0051] A computing unit, used to perform a hash operation on the fault information to obtain an event index;
[0052] Establishing a unit for establishing a corresponding relationship between event index and parsing function;
[0053] Identify units, including:
[0054] An indexing module, configured to perform a hash operation based on the received fault information to determine the target event index;
[0055] The determination module is used to determine the parsing function corresponding to the target event index from the XML configuration file.
[0056] Optionally, the device further includes:
[0057] A receiving unit, configured to receive an update patch of the XML configuration file;
[0058] An updating unit, configured to update the stored XML configuration file according to the update patch;
[0059] The restart unit is used to restart the BMC and load the updated XML configuration file.
[0060] Optional, loading unit, including:
[0061] Create a module to create a parsing process for fault information;
[0062] The device further comprises:
[0063] A receiving unit, configured to receive an update patch of the XML configuration file;
[0064] An updating unit, configured to update the stored XML configuration file according to the update patch;
[0065] The restart unit is used to restart the parsing process and load the updated XML configuration file based on the parsing process.
[0066] Optionally, the XML configuration file also includes shielding items;
[0067] The sending unit includes:
[0068] The judgment module is used to judge whether the target event code hits the shielding item; if the target event code hits the shielding item, it is prohibited to send an alarm message carrying fault information, target event code and fault description to the management device; if the target event code does not hit the shielding item, an alarm message carrying fault information, target event code and fault description is sent to the management device.
[0069] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:
[0070] In the implementation of this specification, the parsing function for implementing fault information parsing is integrated into the XML configuration file, which unbinds the parsing method from the BMC firmware, so that the server can parse the fault information and obtain the corresponding fault description based on the XML configuration file obtained by the BMC, thereby avoiding the time required for BMC firmware upgrades, reducing the omission of fault information, and improving the reliability of the server in collecting and displaying fault information.
[0071] 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 disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and, together with the description, serve to explain the principles of the specification.
[0073] Figure 1 This is a flow chart of a fault log generation method involved in this application;
[0074] Figure 2 This is a structural diagram of a chassis server involved in an embodiment of the present application;
[0075] Figure 3 It is a structural diagram of a fault log generating device involved in this application. DETAILED DESCRIPTION
[0076] Exemplary embodiments are described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different drawings represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this specification.
[0077] This application provides a fault log generation method, which is applied to the BMC of the server, such as Figure 1 Shown, including:
[0078] S100: Load the obtained XML configuration file.
[0079] like Figure 2 As shown, a server is equipped with a BMC for managing and monitoring various components within the server. When a server failure occurs, it can collect status information for each component, including fault information for the faulty component. The collected fault information is called raw data, which is represented in a standardized string format. Each bit in the string can represent a component, a component part, and the type of fault. Although the fault information can be used to identify factors such as the faulty component and the cause of the fault, because it is represented in a string format, the user needs to understand the meaning of each bit to determine the content of the fault information. The string can contain several fields, each of which can represent the fault of a different component and related data at the time of the fault.
[0080] To parse fault information, the BMC can store an XML (eXtensible Markup Language) configuration file. This XML configuration file can be loaded into the BMC's memory and run after the BMC boots up. A separate process can be set up for this XML configuration file. The BMC is pre-installed with an XML parsing library. After receiving the XML configuration file, it can be parsed using the XML parsing library to obtain the specific configuration information.
[0081] The XML configuration file contains one or more parsing functions corresponding to event codes, where the event code corresponds to a type of fault. The event code is formed by concatenating the values of the character strings at preset positions in the fault information and can be set according to actual needs without any restrictions. The parsing function includes a method for parsing the fault information, such as reading a field from a preset position in the fault information to determine the specific faulty device and the status information of the device when the fault occurred. The fault information is generally in 16-byte ciphertext format, and the corresponding event code must be determined after parsing the fault information.
[0082] For different event codes, different parsing functions can be set to obtain the required status information to locate and troubleshoot faults.
[0083] S101. Collect fault information.
[0084] After the server is started, it starts working, receiving and processing messages sent by the client. At this time, if a server failure occurs, an interrupt will be triggered to inform the BMC, so that the BMC can collect the fault information generated in the server and store it in the BMC.
[0085] S102: Determine a target event code corresponding to the fault information according to the fault information.
[0086] After collecting fault information, the BMC reads the content from the preset position of the character string and concatenates it to form an event code. The event code subsequently generated for the fault information actually collected by the BMC is called the target event code. Furthermore, based on this target event code, a corresponding relationship can be established with the fault information stored in the BMC. This relationship stores the storage location of the fault information in the BMC.
[0087] S103: Determine a parsing function corresponding to the target event code from the XML configuration file.
[0088] Based on the target event code, a search is performed in the XML configuration file. If a corresponding parsing function is found, the fault information is obtained from the storage location and imported into the parsing function for parsing.
[0089] S104: Analyze the fault information according to the analytical function to generate a fault description.
[0090] According to the parsing function, the stored fault information is parsed to obtain the corresponding fault description.
[0091] Optionally, the fault description includes: a target event code and at least one description field;
[0092] Step S104: parse the fault information according to the parsing function to generate a fault description, including:
[0093] S104A: Determine a field value of at least one description field according to the parsing function and the fault information.
[0094] S104B: Concatenate the field values of at least one description field to generate a fault description.
[0095] When obtaining a fault description, a specific organization can be configured. For example, if the target event code is 0x0c1000de, the corresponding organization can be: target event code + fault type + fault location. The fault type and fault location are referred to as description fields. Based on the actual fault location, the fault location field can be further subdivided into multiple location fields. Multiple location fields can be combined to identify the specific location of the fault. For example, they can be logically configured in a progressive manner to include processor ID, processor core ID, and channel ID.
[0096] The field value of each description field can be determined according to the parsing function, and the description fields are spliced based on the above organization method to finally form a complete fault description.
[0097] S105: Send an alarm message carrying fault information, target event code, and fault description to the management device, so that the management device generates a fault log.
[0098] After the BMC parses the fault description, it can send the acquired fault information, target event code, and fault description to the management device. This information can be included in an alarm message sent to the management device, but this is not limited to this and can be selected based on actual needs. The management device can be located outside the chassis, connected to each BMC, and receive alarm messages from each server's BMC for processing and display.
[0099] After receiving the alarm message, the management device obtains the fault information, target event code and fault description carried by the lock, generates a fault log based on this information, and displays it on the management device so that the user can quickly locate the fault.
[0100] In the implementation of this specification, the parsing function for implementing fault information parsing is integrated into the XML configuration file, which unbinds the parsing method from the BMC firmware, so that the server can parse the fault information and obtain the corresponding fault description based on the XML configuration file obtained by the BMC, thereby avoiding the time required for BMC firmware upgrades, reducing the omission of fault information, and improving the reliability of the server in collecting and displaying fault information.
[0101] In the XML configuration file, the BMC needs to parse the acquired fault information to obtain the event code, and parse the event code. During the parsing process, the BMC needs to match the fault information one by one with the matching array in the BMC to determine the parsing function applicable to the fault information, which will undoubtedly prolong the log generation time. In order to improve the efficiency of parsing the fault information and speed up the search between the event code and the parsing function, optionally, after step S100, after loading the acquired XML configuration file, the following is also included:
[0102] S106: Perform a hash operation on the fault information to obtain an event index.
[0103] Since the BMC may pre-store fault information corresponding to some fault types, after parsing the XML configuration file, a hash operation may be performed on the fault information corresponding to the fault type to determine the event index corresponding to the fault information.
[0104] S107: Establish a corresponding relationship between the event index and the parsing function.
[0105] A hash operation is performed on the fault information contained in the XML configuration file to form a normalized event index. For example, the XML configuration file may contain fault information corresponding to 10 fault types. A hash operation is performed on this fault information to obtain nine values (0-9), which are the aforementioned event indexes. Each value corresponds to a parsing function in the XML configuration file.
[0106] Step S103: Determine the parsing function corresponding to the target event code from the XML configuration file, including:
[0107] S103A, performing a hash operation based on the received fault information to determine a target event index;
[0108] S103B: Determine a parsing function corresponding to the target event index from the XML configuration file.
[0109] After obtaining the fault information, the event index can be calculated through hash operation, so as to quickly find the corresponding parsing function for event code-based parsing, thereby improving the parsing efficiency of the fault information.
[0110] In addition, after step S100, when the obtained XML configuration file is loaded, the following steps are also included:
[0111] S108: Receive an update patch for the XML configuration file.
[0112] S109: Update the stored XML configuration file according to the update patch.
[0113] S110. Restart the BMC and load the updated XML configuration file.
[0114] When the user needs to reset the parsing function, the management device can send an update patch of the XML configuration file to the BMC. After receiving the update patch, the BMC updates the stored XML configuration file.
[0115] Afterwards, the BMC needs to be restarted to enable the updated XML configuration file. In this case, in addition to the operations required for the BMC restart, only the updated XML configuration file needs to be loaded into memory, without upgrading the BMC firmware. This shortens the time consumed by the parsing function update process, reduces the fault information missed during the BMC firmware upgrade process, and improves the reliability of the server's collection and display of fault information.
[0116] Optionally, step S100, loading the obtained XML configuration file, includes:
[0117] S100A: Create a fault information parsing process.
[0118] After step S100, loading the obtained XML configuration file, the following steps are also included:
[0119] S111, receiving an update patch of the XML configuration file;
[0120] S112, updating the stored XML configuration file according to the update patch;
[0121] S113: Restart the parsing process and load the updated XML configuration file based on the parsing process.
[0122] Correspondingly, during the process of BMC parsing fault information, a separate process can be set up to load the XML configuration file based on the parsing process.
[0123] In this way, after the BMC receives the update patch and updates the stored XML configuration file, it is not necessary to restart the BMC but only to restart the BMC parsing process to complete the update process of the updated XML configuration file, thereby further shortening the time consumed by the XML configuration file update.
[0124] Optionally, the XML configuration file also includes shielding items.
[0125] Step S105: Send an alarm message carrying fault information, target event code, and fault description to the management device, including:
[0126] S105A: Determine whether the target event code hits the shielding item.
[0127] S105B: If the target event code hits a mask item, it is prohibited to send an alarm message carrying fault information, target event code and fault description to the management device.
[0128] S105C: If the target event code does not hit the masked item, an alarm message carrying fault information, target event code and fault description is sent to the management device.
[0129] The XML configuration file can also include a mask item, which indicates whether fault information for a specific event code needs to be sent to the management device for display. This allows users to set which faults are displayed on the management device and which are not, based on their needs. For example, if a server has a correctable fault, meaning that the server can repair the fault according to a preset policy, a mask item can be set for this type of fault in the XML configuration file. This allows the BMC to store fault information for this type of fault only on the BMC after collecting it, without sending it to the management device. Alternatively, the fault information can be sent to the management device without generating a fault log for display, and can be saved only on the management device for users to view when needed. There are no restrictions on this.
[0130] Correspondingly, the present application provides a fault log generation device, which is applied to the BMC of the server, such as Figure 3 Shown, including:
[0131] A loading unit, configured to load the acquired XML configuration file, wherein the XML configuration file includes one or more parsing functions corresponding to the event code;
[0132] A collection unit, used for collecting fault information;
[0133] a conversion unit, configured to determine a target event code corresponding to the fault information according to the fault information;
[0134] A determination unit, configured to determine a parsing function corresponding to a target event code from an XML configuration file;
[0135] A parsing unit, used to parse the fault information according to the parsing function and generate a fault description;
[0136] The sending unit is used to send an alarm message carrying fault information, a target event code and a fault description to the management device, so that the management device generates a fault log.
[0137] Optionally, the fault description includes: an event code and at least one description field;
[0138] Parsing unit, including:
[0139] A description module, configured to determine a field value of at least one description field according to the parsing function and the fault information;
[0140] The splicing module is used to splice the field value of at least one description field to generate a fault description.
[0141] Optionally, the device further includes:
[0142] A computing unit, used to perform a hash operation on the fault information to obtain an event index;
[0143] Establishing a unit for establishing a corresponding relationship between event index and parsing function;
[0144] Identify units, including:
[0145] An indexing module, configured to perform a hash operation based on the received fault information to determine the target event index;
[0146] The determination module is used to determine the parsing function corresponding to the target event index from the XML configuration file.
[0147] Optionally, the device further includes:
[0148] A receiving unit, configured to receive an update patch of the XML configuration file;
[0149] An updating unit, configured to update the stored XML configuration file according to the update patch;
[0150] The restart unit is used to restart the BMC and load the updated XML configuration file.
[0151] Optional, loading unit, including:
[0152] Create a module to create a parsing process for fault information;
[0153] The device further comprises:
[0154] A receiving unit, configured to receive an update patch of the XML configuration file;
[0155] An updating unit, configured to update the stored XML configuration file according to the update patch;
[0156] The restart unit is used to restart the parsing process and load the updated XML configuration file based on the parsing process.
[0157] Optionally, the XML configuration file also includes shielding items;
[0158] The sending unit includes:
[0159] The judgment module is used to judge whether the target event code hits the shielding item; if the target event code hits the shielding item, it is prohibited to send an alarm message carrying fault information, target event code and fault description to the management device; if the target event code does not hit the shielding item, an alarm message carrying fault information, target event code and fault description is sent to the management device.
[0160] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:
[0161] In the implementation of this specification, the parsing function for implementing fault information parsing is integrated into the XML configuration file, which unbinds the parsing method from the BMC firmware, so that the server can parse the fault information and obtain the corresponding fault description based on the XML configuration file obtained by the BMC, thereby avoiding the time required for BMC firmware upgrades, reducing the omission of fault information, and improving the reliability of the server in collecting and displaying fault information.
[0162] It will be understood that the present description is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
[0163] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.
Claims
1. A method for generating a fault log, characterized in that: The baseboard management controller (BMC) used in servers includes: Loading the obtained extended markup language XML configuration file, wherein the XML configuration file includes one or more parsing functions corresponding to the event code; Collect fault information; Determining a target event code corresponding to the fault information according to the fault information; Determine a parsing function corresponding to the target event code from the XML configuration file; Analyze the fault information according to the analytical function to generate a fault description; Sending an alarm message carrying the fault information, the target event code, and the fault description to a management device, so that the management device generates a fault log; After loading the obtained XML configuration file, it also includes: Performing a hash operation on the fault information to obtain an event index; Establishing a correspondence between the event index and the analytical function; Determining a parsing function corresponding to the target event code from the XML configuration file includes: Perform hash operation based on the received fault information to determine the target event index; A parsing function corresponding to the target event index is determined from the XML configuration file.
2. The method according to claim 1, characterized in that The fault description includes: a target event code and at least one description field; The step of parsing the fault information according to the parsing function to generate a fault description includes: Determining a field value of the at least one description field according to the parsing function and the fault information; The field values of the at least one description field are concatenated to generate a fault description.
3. The method according to claim 1 or 2, characterized in that After loading the obtained extended markup language XML configuration file, it also includes: Receive update patches for XML configuration files; Updating the stored XML configuration file according to the update patch; Restart the BMC and load the updated XML configuration file.
4. The method according to claim 1 or 2, characterized in that The XML configuration file obtained by loading includes: Create a parsing process for fault information; After loading the obtained extended markup language XML configuration file, it also includes: Receive update patches for XML configuration files; Updating the stored XML configuration file according to the update patch; The parsing process is restarted, and the updated XML configuration file is loaded based on the parsing process.
5. The method according to claim 1, wherein The XML configuration file also includes a shielding item; The sending of the alarm message carrying the fault information, the target event code, and the fault description to the management device includes: Determining whether the target event code hits the shielding item; If the target event code hits the mask item, it is prohibited to send an alarm message carrying the fault information, the target event code and the fault description to the management device; If the target event code does not hit the mask item, an alarm message carrying the fault information, the target event code and the fault description is sent to the management device.
6. A fault log generating device, characterized in that: BMC used in servers, including: A loading unit, configured to load the acquired XML configuration file, wherein the XML configuration file includes one or more parsing functions corresponding to the event code; A collection unit, used for collecting fault information; a conversion unit, configured to determine a target event code corresponding to the fault information according to the fault information; a determining unit, configured to determine a parsing function corresponding to the target event code from the XML configuration file; a parsing unit, configured to parse the fault information according to the parsing function to generate a fault description; a sending unit, configured to send an alarm message carrying the fault information, the target event code, and the fault description to a management device, so that the management device generates a fault log; The device further comprises: A computing unit, configured to perform a hash operation on the fault information to obtain an event index; An establishing unit, configured to establish a corresponding relationship between the event index and the parsing function; The determining unit includes: An indexing module, configured to perform a hash operation based on the received fault information to determine the target event index; The determination module is used to determine the parsing function corresponding to the target event index from the XML configuration file.
7. The device according to claim 6, characterized in that The fault description includes: a target event code and at least one description field; The parsing unit includes: a description module, configured to determine a field value of the at least one description field according to the parsing function and the fault information; The splicing module is used to splice the field value of the at least one description field to generate a fault description.
8. The device according to claim 6 or 7, characterized in that Also includes: A receiving unit, configured to receive an update patch of the XML configuration file; an updating unit, configured to update the stored XML configuration file according to the update patch; The restart unit is used to restart the BMC and load the updated XML configuration file.
9. The device according to claim 6 or 7, characterized in that The loading unit comprises: Create a module to create a parsing process for fault information; The device further comprises: A receiving unit, configured to receive an update patch of the XML configuration file; an updating unit, configured to update the stored XML configuration file according to the update patch; The restart unit is used to restart the parsing process and load the updated XML configuration file based on the parsing process.
10. The device according to claim 6, characterized in that The XML configuration file also includes a shielding item; The sending unit includes: A judgment module is used to judge whether the target event code hits the shield item; if the target event code hits the shield item, it is prohibited to send an alarm message carrying the fault information, the target event code and the fault description to the management device; if the target event code does not hit the shield item, an alarm message carrying the fault information, the target event code and the fault description is sent to the management device.
Citation Information
Patent Citations
ASTERIX message parsing code generation method based on XML
CN106598581A
Information processing apparatus, fault analysis method, and fault analysis program
JP2011145824A