A smart log collection and analysis method, system, device and medium
Patent Information
- Application Number
- CN202310504940.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2043-05-06
AI Technical Summary
此方法只是实现对某块盘异常报错信息快速响应处理,由于服务器配备的RAID卡与硬盘种类、数量多,不同配置、不同类型硬盘的smart日志采集方式不同,测试对比标准也不同,此方法无法应在不同项目的测试场景中,无法实现smart日志的全自动化采集分析,且不适用于服务器存储子系统的自动化测试
[0042] Compared with existing technologies, the advantages of this invention are as follows: This invention provides a smart log collection and analysis method, system, device, and medium that can associate with the server under test via a network, automatically identify the hard drive information of the server under test, determine the connection method and type of each hard drive based on the hard drive information, and determine the appropriate smart log collection instructions. During the execution of test cases, it automatically collects, analyzes, and compares smart logs. It achieves fully automatic smart log collection and analysis covering various types of server hard drives (HDD, SSD, NVMe) and various configurations (RAID, non-RAID).
Smart Images

Figure CN116627730B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically to a smart log collection and analysis method, system, device, and medium. Background Technology
[0002] Currently, servers undergo rigorous testing of their storage subsystems before leaving the factory. RAID cards and hard drives, as key components of the storage subsystem, are tested in various ways, including performance testing, functional testing, and stress testing. SMART logs, as a technical standard for automatically monitoring the condition of hard drives and reporting potential problems, define the standards that hard drive manufacturers should follow. SMART log parameters can determine and report information such as the hard drive's operating status, lifespan, and temperature. When an abnormality occurs, it can provide users with early warning information, giving them sufficient time to transfer important data to other storage devices or replace the server hard drive in a timely manner. Therefore, SMART log checks are typically included in many test cases for server hard drive performance and stress testing.
[0003] The related technologies employ methods for checking SMART logs, including: acquiring hard drive SMART logs; filtering for abnormal hard drives with a count of `num_err_log_entries` in the SMART logs; capturing the code value of the abnormal hard drive; parsing the code value and outputting the parsing result. This method only enables rapid response and processing of abnormal error messages for a specific disk. Due to the large variety and quantity of RAID cards and hard drives equipped on servers, and the different SMART log collection methods and testing comparison standards for different configurations and types of hard drives, this method cannot be applied to the testing scenarios of different projects, cannot achieve fully automated collection and analysis of SMART logs, and is not suitable for automated testing of server storage subsystems. Summary of the Invention
[0004] To address the above problems, the present invention aims to provide a smart log collection and analysis method, system, device, and medium that enables fully automated smart log collection and analysis across multiple servers of various types, thereby reducing a large amount of repetitive manual operations and saving testing time and manpower.
[0005] To achieve the above objectives, the present invention employs the following technical solution:
[0006] In a first aspect, the present invention discloses a method for collecting and analyzing smart logs, including:
[0007] Obtain the network configuration information of the server under test, and use the network configuration information to connect to the server under test;
[0008] Identify the hard drive information on the server under test;
[0009] The connection mode and type of each hard drive are identified based on the hard drive information, and the appropriate smart log collection instructions are determined based on the identification results.
[0010] The smart log of any hard drive under test on the server under test is collected using the smart log collection command and recorded as the first log.
[0011] Perform a smart log check test case on the hard drive under test;
[0012] After the test is completed, the SMART log of the hard drive under test is collected using the SMART log collection command and recorded as the second log.
[0013] Determine the appropriate hard drive standard based on the information of the hard drive under test;
[0014] The first and second logs are analyzed using hard disk standards, and the analysis results are output.
[0015] Furthermore, the step of obtaining the network configuration information of the server under test and connecting to the server under test using the network configuration information includes:
[0016] Obtain the IP address, user password, and SSH protocol of the server under test;
[0017] Connect to the server under test using the SSH protocol and IP address, and log in to the server using the user password.
[0018] Furthermore, the identification of hard drive information on the server under test includes:
[0019] Identify the number of hard drives, connection method, hard drive type, hard drive letter, sg number, and DID number of the server under test.
[0020] Furthermore, the step of identifying the connection mode and type of each hard drive based on the hard drive information, and determining the appropriate smart log collection command based on the identification result, includes:
[0021] Determine if the hard drive's connection mode is RAID mode;
[0022] If the hard drive is connected in RAID mode, the type of the corresponding RAID card is identified based on the hard drive information, and the appropriate smart log collection command is determined according to the type of RAID card.
[0023] If the hard drive connection mode is not RAID mode, the hard drive protocol is identified based on the hard drive information, and the appropriate smart log collection command is determined according to the hard drive protocol.
[0024] Furthermore, the step of determining the appropriate smart log collection command based on the type of RAID card includes: if the RAID card is a Class A card, using the command smartctl –a / dev / sg* to collect smart logs;
[0025] If the RAID card is a Class B card, use the command smartctl –d cciss,* –a / dev / sd* to collect smart logs;
[0026] If the RAID card is a Class C card, use the command smartctl --all --device=megaraid,DID / dev / sd* to collect smart logs.
[0027] Furthermore, the step of determining the appropriate SMART log collection command based on the hard disk protocol includes:
[0028] If the hard drive uses the SATA or SAS protocol, use the command smartctl -a / dev / sd* to collect smart logs;
[0029] If the hard drive uses the NVMe protocol, use the command `nvme smart-log / dev / nvme0n1` to collect smart logs.
[0030] Furthermore, the analysis of the first and second logs using hard disk standards, and the output of analysis results, include:
[0031] The test compares the corresponding parameter values in the first and second logs with the hard disk standard. If all parameters meet the hard disk standard, the test is successful; otherwise, the test fails and abnormal parameters and error messages are output.
[0032] Secondly, the present invention also discloses a smart log collection and analysis system, comprising:
[0033] The server maintenance module is used to obtain the network configuration information of the server under test and connect to the server under test using the network configuration information.
[0034] The hard drive information identification module is used to identify the hard drive information on the server under test.
[0035] The smart log collection instruction maintenance module is used to identify the connection mode and type of each hard drive based on the hard drive information, and determine the appropriate smart log collection instruction based on the identification result; it collects the smart log of any hard drive under test on the server under test through the smart log collection instruction, and records it as the first log; after the test is completed, it collects the smart log of the hard drive under test through the smart log collection instruction, and records it as the second log;
[0036] The smart function association module is used to create smart log inspection functions and associate smart log inspection test cases, and to perform smart log inspection test case tests on the hard drive.
[0037] The smart log test standard maintenance module is used to determine the corresponding hard drive standard based on the information of the hard drive under test; the log automatic analysis module is used to analyze the first log and the second log according to the hard drive standard and output the analysis results.
[0038] Thirdly, the present invention also discloses a smart log collection and analysis device, comprising:
[0039] Memory, used to store the smart log collection and analysis program;
[0040] A processor is used to implement the steps of the smart log collection and analysis method described above when executing the smart log collection and analysis program.
[0041] Fourthly, the present invention also discloses a readable storage medium storing a smart log collection and analysis program, wherein when the smart log collection and analysis program is executed by a processor, it implements the steps of the smart log collection and analysis method described in any of the above descriptions.
[0042] Compared with existing technologies, the advantages of this invention are as follows: This invention provides a smart log collection and analysis method, system, device, and medium that can associate with the server under test via a network, automatically identify the hard drive information of the server under test, determine the connection method and type of each hard drive based on the hard drive information, and determine the appropriate smart log collection instructions. During the execution of test cases, it automatically collects, analyzes, and compares smart logs. It achieves fully automatic smart log collection and analysis covering various types of server hard drives (HDD, SSD, NVMe) and various configurations (RAID, non-RAID).
[0043] This invention implements the logic of automatic checking of smart logs in the form of a shell script. Users can manually copy the script to the server under test to execute the script to collect and analyze smart logs, which can meet the user's need for manual testing of a single server.
[0044] Therefore, it is evident that the present invention has outstanding substantive features and significant progress compared with the prior art, and the beneficial effects of its implementation are also obvious. Attached Figure Description
[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0046] Figure 1 This is a flowchart illustrating a specific embodiment of the present invention.
[0047] Figure 2 This is a flowchart illustrating a specific embodiment of the present invention, showing how hard disk information is used to identify the hard disk and determine the appropriate smart log collection command.
[0048] Figure 3 This is a system structure diagram of a specific embodiment of the present invention.
[0049] In the diagram, 1. Server maintenance module; 2. Hard disk information identification module; 3. SMART log collection instruction maintenance module; 4. SMART function association module; 5. SMART log test standard maintenance module; 6. Automatic log analysis module. Detailed Implementation
[0050] The core of this invention is to provide a smart log collection and analysis method. In related technologies, the smart log inspection method only realizes the rapid response and processing of abnormal error information of a certain disk. Since the RAID cards and hard drives equipped in the server are of various types and quantities, the smart log collection methods of different configurations and types of hard drives are different, and the test comparison standards are also different. This method cannot be applied to the test scenarios of different projects, cannot achieve fully automated collection and analysis of smart logs, and is not suitable for automated testing of server storage subsystems.
[0051] The SMART log collection and analysis method provided by this invention first obtains the network configuration information of the server under test, connects to the server using the network configuration information, and identifies the hard drive information on the server. Then, based on the hard drive information, it identifies the connection mode and type of each hard drive, and determines the appropriate SMART log collection command based on the identification results. Next, it collects the SMART logs of any hard drive under test on the server using the SMART log collection command, and records them as the first log. At this point, it is necessary to perform SMART log check case tests on the hard drive under test. After the test is completed, it collects the SMART logs of the hard drive under test using the SMART log collection command, records them as the second log, and determines the corresponding hard drive standard based on the information of the hard drive under test. Finally, it analyzes the first and second logs using the hard drive standard and outputs the analysis results. Therefore, this invention achieves fully automated SMART log collection and analysis for multiple servers of various types, reducing a large amount of repetitive manual operations and saving testing time and manpower.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0053] The key terms used in this invention will be explained below.
[0054] SMART, short for "Self-Monitoring Analysis and Reporting Technology," is an automated hard drive status detection and early warning system and standard. It monitors and records the operation of hard drive hardware components such as read / write heads, platters, motors, and circuitry using internal hardware monitoring commands, comparing the data with preset safety values set by the manufacturer. If the monitored status is approaching or has exceeded the preset safety range, the host computer's monitoring hardware or software can automatically warn the user and perform minor automatic repairs to proactively protect hard drive data. Most hard drives today, except for some very early models, are equipped with this technology.
[0055] RAID, or Redundant Arrays of Independent Disks, is an array of independent hard drives designed for redundancy. It combines many individual hard drives into a single, high-capacity group, leveraging the synergistic effect of individual disks to improve overall system performance. This technology divides data into segments and stores them across multiple hard drives. RAID also utilizes parity checking, ensuring data can still be retrieved even if one hard drive fails. During data reconstruction, data can be recalculated and re-placed onto new hard drives.
[0056] To enable those skilled in the art to better understand the present invention, the invention 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 invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] See Figure 1 As shown, this embodiment provides a method for collecting and analyzing smart logs, including the following steps:
[0058] S1: Obtain the network configuration information of the server under test, and use the network configuration information to connect to the server under test.
[0059] In a specific implementation, the IP address, user password, and SSH protocol of the server under test are obtained; the server under test is connected using the SSH protocol and IP address, and the user password is used to log in to the server under test.
[0060] S2: Identify the hard drive information on the server under test.
[0061] In a specific implementation, the number of hard drives, connection method, hard drive type, hard drive letter, sg number, and DID number of the server under test are identified.
[0062] In this step, the identified hard drive information includes: the number of hard drives, connection method (non-RAID, RAID group), RAID card manufacturer in RAID group mode, hard drive type (HDD / SSD), hard drive protocol (SATA / SAS / NVME), hard drive letter, sg number, DID number, and other information required by SMART data collection.
[0063] S3: Identify the connection mode and type of each hard drive based on the hard drive information, and determine the appropriate smart log collection command based on the identification results.
[0064] In this specific implementation, this step involves identifying the hard drive using its information and determining the appropriate SMART log collection command. The specific process is as follows: Figure 2 As shown:
[0065] First, determine whether the hard drive is connected in RAID mode. If the hard drive is connected in RAID mode, identify the type of the corresponding RAID card based on the hard drive information, and determine the appropriate SMART log collection command based on the RAID card type. If the hard drive is not connected in RAID mode, identify the hard drive protocol based on the hard drive information, and determine the appropriate SMART log collection command based on the hard drive protocol.
[0066] In this embodiment, the identified RAID card types mainly include three categories:
[0067] Class A cards are PMC80 series RAID cards. When the RAID card is a RAID card of this series, use the command smartctl –a / dev / sg* to collect the smart log, where the sg number is obtained from the hard drive information.
[0068] Class B cards are PMC82 series RAID cards. When the RAID card is a RAID card of this series, use the command smartctl –dcciss,* –a / dev / sd* to collect smart logs; the drive letter information is obtained from the hard drive information.
[0069] Class C cards are LSI series RAID cards. When the RAID card is a RAID card of this series, use the command smartctl --all --device=megaraid,DID / dev / sd* to collect smart logs. The DID information is obtained from the hard drive identification information.
[0070] In this embodiment, the identified hard disk protocols mainly include two protocols:
[0071] When the hard drive uses the SATA or SAS protocol, use the command smartctl -a / dev / sd* to collect smart logs;
[0072] When the hard drive uses the NVMe protocol, use the command nvme smart-log / dev / nvme0n1 to collect smart logs.
[0073] Additionally, it should be noted that this method also includes the following in order to execute the smart log collection command:
[0074] Upload and download the Smart Log Collection Tool, send the Smart Log Collection Tool to the server under test, and install it.
[0075] The smart log collection tools include smartctl and nvme-cli.
[0076] S4: Collect the SMART log of any hard drive under test on the server under test using the SMART log collection command, and record it as the first log.
[0077] The first log is the SMART log of the hard drive under test, which is collected by the SMART log collection command before the test cases are executed.
[0078] S5: Perform a smart log check test case on the hard drive under test.
[0079] S6: After the test is completed, collect the SMART log of the hard drive under test using the SMART log collection command, and record it as the second log.
[0080] The second log is the SMART log of the hard drive under test, which is collected by the SMART log collection command after the test cases are executed.
[0081] S7: Determine the appropriate hard drive standard based on the information of the hard drive under test.
[0082] Specifically, it is necessary to select the corresponding standard for comparison and inspection based on the hard drive information. In the above steps, SMART logs were collected before and after each test case. The inspection standards for the two logs are different, and the determined hard drive standard will compare and judge the different parameters in the two logs.
[0083] S8: Analyze the first and second logs using hard disk standards and output the analysis results.
[0084] The test compares the corresponding parameter values in the first and second logs with the hard disk standard. If all parameters meet the hard disk standard, the test is successful; otherwise, the test fails and abnormal parameters and error messages are output.
[0085] In a specific implementation, taking the hard drive under test as an NVME drive as an example, the evaluation criteria for the parameter values in the first log are as follows:
[0086] vailable_spare>5%
[0087] critical_warning equals 0
[0088] percentage_used<95%
[0089] The criteria for evaluating the parameter values in the second log are as follows:
[0090] Temperature < 74
[0091] The number of media_errors did not increase compared to before the test.
[0092] If the relevant parameters in the first and second logs both meet the above hard drive standards, the test is successful; otherwise, the test fails, and abnormal parameters and error messages are output.
[0093] In another implementation, taking a SAS disk as an example, the evaluation criteria for the parameter values in the first log are as follows:
[0094] SMART Health Status 0k
[0095] Elements in grown defect list equals 0
[0096] Verify total uncorrected error<10
[0097] The criteria for evaluating the parameter values in the second log are as follows:
[0098] The number of uncorrected error reads did not increase compared to before the test.
[0099] Elements in grown defect list equals 0
[0100] The total number of uncorrected errors verified was no higher than before the test.
[0101] If the relevant parameters in the first and second logs both meet the above hard drive standards, the test is successful; otherwise, the test fails, and abnormal parameters and error messages are output.
[0102] Therefore, this invention provides a smart log collection and analysis method that can associate with the server under test via a network, automatically identify the hard drive information of the server under test, determine the connection method and type of each hard drive based on the hard drive information, and determine the appropriate smart log collection command. During the execution of test cases, it automatically collects, analyzes, and compares smart logs. It achieves fully automated smart log collection and analysis covering various types of server hard drives (HDD, SSD, NVMe) and various configurations (RAID, non-RAID).
[0103] See Figure 3As shown, the present invention also discloses a smart log collection and analysis system, including: a server maintenance module 1, a hard disk information identification module 2, a smart log collection instruction maintenance module 3, a smart function association module 4, a smart log test standard maintenance module 5, and a log automatic analysis module 6.
[0104] Server maintenance module 1 is configured to: obtain the network configuration information of the server under test and connect to the server under test using the network configuration information. Server maintenance module 1 supports adding the server under test to the system via the IP address and user password of the server under test, SSH, and other protocols.
[0105] Hard disk information identification module 2 is configured to identify hard disk information on the server under test.
[0106] In a specific implementation, the hard disk information identification module 2 can identify the information of the hard disks on the server under test, including the number of hard disks, connection method (non-RAID, group RAID, RAID card manufacturer in group RAID mode), hard disk type (HDD / SSD), hard disk protocol (SATA / SAS / NVME), and information required for SMART collection such as hard disk drive letter, sg number, and DID number.
[0107] The smart log collection instruction maintenance module 3 is configured to: identify the connection mode and type of each hard drive based on the hard drive information, determine the appropriate smart log collection instruction based on the identification result; collect the smart log of any hard drive under test on the server under test through the smart log collection instruction, and record it as the first log; after the test is completed, collect the smart log of the hard drive under test through the smart log collection instruction, and record it as the second log.
[0108] The smart log collection instruction maintenance module 3 can support the maintenance of smart log collection instructions. Based on the hard drive identification information, it can automatically call the corresponding connection mode and hard drive type instructions, pass in the identification parameters, and complete the smart log collection.
[0109] The smart function association module 4 is configured to create smart log inspection functions and associate smart log inspection test cases, and to perform smart log inspection test case tests on the hard drive.
[0110] The Smart Log Test Standard Maintenance Module 5 is configured to determine the corresponding hard drive standard based on the information of the hard drive under test. Module 5 supports the maintenance of Smart Log Test Standards. Different hard drive types have different comparison standards and need to be maintained separately. The module automatically performs comparison checks based on the hard drive identification information and selects the corresponding standard. Smart logs need to be checked before and after each test case. Since the checking standards differ, two sets of standards, Standard 1 and Standard 2, need to be maintained.
[0111] Log automatic analysis module 6 is configured to analyze the first and second logs according to hard disk standards and output the analysis results.
[0112] In a specific implementation, the automatic log analysis module 6 is specifically used to: compare the corresponding parameter values in the first log and the second log with the hard disk standard respectively; if all parameters meet the hard disk standard, the test is successful; otherwise, the test fails and abnormal parameters and error messages are output.
[0113] Therefore, this invention provides a smart log collection and analysis system that, after adding the server under test to the system, creates test tasks, determines automated test cases, and associates the test cases with the smart log automatic collection and analysis function, automatically collects and analyzes smart logs before and after the execution of automated test cases; ensuring that all testing work is completed automatically after the automated task starts, avoiding human intervention.
[0114] The present invention also discloses a smart log collection and analysis device, including a processor and a memory; wherein, when the processor executes the smart log collection and analysis program stored in the memory, it performs the following steps:
[0115] 1. Obtain the network configuration information of the server under test, and use the network configuration information to connect to the server under test.
[0116] 2. Identify the hard drive information on the server under test.
[0117] 3. Identify the connection mode and type of each hard drive based on the hard drive information, and determine the appropriate smart log collection command based on the identification results.
[0118] 4. Collect the SMART logs of any hard drive under test on the server under test using the SMART log collection command, and record it as the first log.
[0119] 5. Perform a smart log check test case on the hard drive under test.
[0120] 6. After the test is completed, collect the SMART log of the hard drive under test using the SMART log collection command, and record it as the second log.
[0121] 7. Determine the appropriate hard drive standard based on the information of the hard drive to be tested.
[0122] 8. Analyze the first and second logs using hard disk standards and output the analysis results. The smart log collection and analysis device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.
[0123] The processor may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor can be implemented using at least one hardware form of Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor may also include a main processor and coprocessors. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.
[0124] The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory is used to store at least the following computer program, which, after being loaded and executed by the processor, is capable of implementing the relevant steps of the smart log collection and analysis method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory may also include operating systems and data, and the storage method may be temporary or permanent storage. The operating system may include Windows, Unix, Linux, etc. The data may include, but is not limited to, the data involved in the aforementioned smart log collection and analysis method.
[0125] In a specific implementation, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: obtaining the IP address, user password, and SSH protocol of the server under test; connecting to the server under test using the SSH protocol and IP address, and logging into the server under test using the user password.
[0126] In a specific implementation, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: identifying the number of hard disks, connection method, hard disk type, hard disk drive letter, sg number and DID number of the server under test.
[0127] In a specific implementation, when the processor executes the computer program stored in the memory, it may specifically implement the following steps: determining whether the hard drive connection mode is RAID mode; if the hard drive connection mode is RAID mode, identifying the type of the corresponding RAID card based on the hard drive information, and determining the appropriate smart log collection instruction according to the type of RAID card; if the hard drive connection mode is not RAID mode, identifying the hard drive protocol based on the hard drive information, and determining the appropriate smart log collection instruction according to the hard drive protocol.
[0128] In a specific implementation, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: If the RAID card is a Class A card, use the command `smartctl -a / dev / sg*` to collect SMART logs; if the RAID card is a Class B card, use the command `smartctl -d cciss,* -a / dev / sd*` to collect SMART logs; if the RAID card is a Class C card, use the command `smartctl --all`.
[0129] --device=megaraid,DID / dev / sd* collects smart logs.
[0130] In a specific implementation, when the processor executes the computer program stored in the memory, it can specifically perform the following steps: if the hard drive uses the SATA or SAS protocol, use the command `smartctl -a / dev / sd*` to collect the smart log; if the hard drive uses the NVMe protocol, use the command `nvme smart-log`.
[0131] / dev / nvme0n1 collects SMART logs.
[0132] In a specific implementation, when the processor executes the computer program stored in the memory, it can specifically implement the following steps: compare the corresponding parameter values in the first log and the second log with the hard disk standard respectively; if all parameters meet the hard disk standard, the test is successful; otherwise, the test fails and abnormal parameters and error information are output.
[0133] Furthermore, the smart log collection and analysis device in this embodiment may also include:
[0134] The input interface is used to acquire externally imported smart log collection and analysis programs and save them to the memory. It can also acquire various instructions and parameters transmitted from external terminal devices and transmit them to the processor, allowing the processor to perform corresponding processing using these instructions and parameters. In this embodiment, the input interface may include, but is not limited to, a USB interface, a serial interface, a voice input interface, a fingerprint input interface, and a hard disk read interface.
[0135] An output interface is used to output various data generated by the processor to connected terminal devices, so that other terminal devices connected to the output interface can obtain the various data generated by the processor. In this embodiment, the output interface may include, but is not limited to, a USB interface, a serial interface, etc.
[0136] The communication unit is used to establish a remote communication connection between the server-running business optimization configuration device and the external server, so that the smart log collection and analysis device can mount the image file to the external server. In this embodiment, the communication unit may specifically include, but is not limited to, a remote communication unit based on wireless communication technology or wired communication technology.
[0137] The keyboard is used to acquire various parameter data or commands input by the user through real-time keystrokes.
[0138] The monitor is used to display relevant information in real time during the smart log collection and analysis process.
[0139] A mouse can be used to assist users in inputting data and simplifying user operations.
[0140] This invention also discloses a readable storage medium, which includes random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art. The readable storage medium stores a smart log collection and analysis program, which, when executed by a processor, performs the following steps:
[0141] 1. Obtain the network configuration information of the server under test, and use the network configuration information to connect to the server under test.
[0142] 2. Identify the hard drive information on the server under test.
[0143] 3. Identify the connection mode and type of each hard drive based on the hard drive information, and determine the appropriate smart log collection command based on the identification results.
[0144] 4. Collect the SMART logs of any hard drive under test on the server under test using the SMART log collection command, and record it as the first log.
[0145] 5. Perform a smart log check test case on the hard drive under test.
[0146] 6. After the test is completed, collect the SMART log of the hard drive under test using the SMART log collection command, and record it as the second log.
[0147] 7. Determine the appropriate hard drive standard based on the information of the hard drive to be tested.
[0148] 8. Analyze the first and second logs using hard disk standards and output the analysis results.
[0149] In summary, this invention achieves fully automated collection and analysis of smart logs covering various types of hard drives (HDD, SSD, NVMe) and various configurations (RAID, non-RAID).
[0150] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. The methods disclosed in the embodiments are described simply because they correspond to the systems disclosed in the embodiments; relevant details can be found in the method section.
[0151] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0152] In the embodiments provided by this invention, it should be understood that the disclosed systems, methods, and approaches can be implemented in other ways. For example, the system 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 systems or units may be electrical, mechanical, or other forms.
[0153] 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.
[0154] In addition, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit.
[0155] Similarly, in the various embodiments of the present invention, each processing unit can be integrated into a functional module, or each processing unit can exist physically, or two or more processing units can be integrated into a functional module.
[0156] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0157] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0158] The present invention has provided a detailed description of the smart log collection and analysis method, system, apparatus, and readable storage medium. Specific examples have been used to illustrate the principles and implementation methods of the invention. The descriptions of these embodiments are merely illustrative of the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to the invention without departing from its principles, and these improvements and modifications also fall within the scope of protection of the claims.
Claims
1. A method for collecting and analyzing smart logs, characterized in that, include: Obtain the network configuration information of the server under test, and use the network configuration information to connect to the server under test; Identify the hard drive information on the server under test; The connection mode and type of each hard drive are identified based on the hard drive information, and the appropriate smart log collection instructions are determined based on the identification results. The smart log of any hard drive under test on the server under test is collected using the smart log collection command and recorded as the first log. Perform a smart log check test case on the hard drive under test; After the test is completed, the SMART log of the hard drive under test is collected using the SMART log collection command and recorded as the second log. Determine the appropriate hard drive standard based on the information of the hard drive under test; The first and second logs are analyzed using hard disk standards, and the analysis results are output. The identification of hard drive information on the server under test includes: Identify the number of hard drives, connection method, hard drive type, hard drive letter, sg number, and DID number of the server under test; The process of identifying the connection mode and type of each hard drive based on hard drive information, and determining the appropriate smart log collection command based on the identification result, includes: Determine if the hard drive's connection mode is RAID mode; If the hard drive is connected in RAID mode, the type of the corresponding RAID card is identified based on the hard drive information, and the appropriate smart log collection command is determined according to the type of RAID card. If the hard drive connection mode is not RAID mode, the hard drive protocol is identified based on the hard drive information, and the appropriate smart log collection command is determined according to the hard drive protocol. Determine the appropriate hard drive standard based on the information of the hard drive under test, including: The first log and the second log have different inspection standards. The determined hard drive standard will compare and judge different parameters in the first log and the second log. The analysis of the first and second logs using hard disk standards, and the output of the analysis results, include: The test compares the corresponding parameter values in the first and second logs with the hard disk standard. If all parameters meet the hard disk standard, the test is successful; otherwise, the test fails and abnormal parameters and error messages are output.
2. The smart log collection and analysis method according to claim 1, characterized in that, The step of obtaining the network configuration information of the server under test and connecting to the server under test using the network configuration information includes: Obtain the IP address, user password, and SSH protocol of the server under test; Connect to the server under test using the SSH protocol and IP address, and log in to the server using the user password.
3. The smart log collection and analysis method according to claim 1, characterized in that, The method for determining the appropriate smart log collection command based on the RAID card type includes: If the RAID card is a Class A card, use the command `smartctl –a / dev / sg`. Collect smart logs; If the RAID card is a Class B card, use the command `smartctl -d cciss`. -a / dev / sd Collect smart logs; If the RAID card is a Class C card, use the command `smartctl --all --device=megaraid,DID / dev / sd`. Collect smart logs; Class A cards are PMC80 series RAID cards, Class B cards are PMC82 series RAID cards, and Class C cards are LSI series RAID cards.
4. The smart log collection and analysis method according to claim 1, characterized in that, The step of determining the appropriate SMART log collection instructions based on the hard disk protocol includes: If the hard drive uses the SATA or SAS protocol, use the command `smartctl -a / dev / sd`. Collect smart logs; If the hard drive uses the NVME protocol, use the command `nvme smart-log / dev / nvme0n1` to collect smart logs.
5. A smart log collection and analysis system, characterized in that, include: The server maintenance module is used to obtain the network configuration information of the server under test and connect to the server under test using the network configuration information. The hard drive information identification module is used to identify the hard drive information on the server under test. The smart log collection instruction maintenance module is used to identify the connection mode and type of each hard drive based on the hard drive information, and determine the appropriate smart log collection instruction based on the identification result; it collects the smart log of any hard drive under test on the server under test through the smart log collection instruction and records it as the first log. After the test is completed, the SMART log of the hard drive under test is collected using the SMART log collection command and recorded as the second log. The smart function association module is used to create smart log inspection functions and associate smart log inspection test cases, and to perform smart log inspection test case tests on the hard drive. The smart log test standard maintenance module is used to determine the corresponding hard drive standard based on the information of the hard drive under test. The automatic log analysis module is used to analyze the first and second logs according to hard disk standards and output the analysis results; The identification of hard drive information on the server under test includes: Identify the number of hard drives, connection method, hard drive type, hard drive letter, sg number, and DID number of the server under test; The process of identifying the connection mode and type of each hard drive based on hard drive information, and determining the appropriate smart log collection command based on the identification result, includes: Determine if the hard drive's connection mode is RAID mode; If the hard drive is connected in RAID mode, the type of the corresponding RAID card is identified based on the hard drive information, and the appropriate smart log collection command is determined according to the type of RAID card. If the hard drive connection mode is not RAID mode, the hard drive protocol is identified based on the hard drive information, and the appropriate smart log collection command is determined according to the hard drive protocol. Determine the appropriate hard drive standard based on the information of the hard drive under test, including: The first log and the second log have different inspection standards. The determined hard drive standard will compare and judge different parameters in the first log and the second log. The first and second logs are analyzed using hard disk standards, and the analysis results are output, including: The test compares the corresponding parameter values in the first and second logs with the hard disk standard. If all parameters meet the hard disk standard, the test is successful; otherwise, the test fails and abnormal parameters and error messages are output.
6. A smart log collection and analysis device, characterized in that, include: Memory, used to store the smart log collection and analysis program; A processor, configured to implement the steps of the smart log collection and analysis method as described in any one of claims 1 to 4 when executing the smart log collection and analysis program.
7. A readable storage medium, characterized in that: The readable storage medium stores a smart log collection and analysis program, which, when executed by a processor, implements the steps of the smart log collection and analysis method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Hard disk alarm method and device, computer equipment and storage medium
CN112256535A
Hard disk fault prediction method and device
CN114661566A