CN116755773A - IPMI command correction method and device - Google Patents

IPMI command correction method and device Download PDF

Info

Publication number
CN116755773A
CN116755773A CN202310534930.4A CN202310534930A CN116755773A CN 116755773 A CN116755773 A CN 116755773A CN 202310534930 A CN202310534930 A CN 202310534930A CN 116755773 A CN116755773 A CN 116755773A
Authority
CN
China
Prior art keywords
command
ipmi
parameter
standard
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310534930.4A
Other languages
Chinese (zh)
Inventor
李纪元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310534930.4A priority Critical patent/CN116755773A/en
Publication of CN116755773A publication Critical patent/CN116755773A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30145Instruction analysis, e.g. decoding, instruction word fields

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a correction method and device of an IPMI command, wherein the method comprises the following steps: acquiring and splitting an IPMI command to be executed to obtain interface type parameters in the IPMI command and command type parameters in the IPMI command; determining interface type parameters and error parameters in command type parameters based on stored IPMI command standard parameters; and correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command. The method and the device for correcting the IPMI command provided by the invention are used for correcting the interface type parameter and the command type parameter in the acquired IPMI command. Based on the stored IPMI command standard parameters, the interface type parameters and the error parameters in the command type parameters are determined and corrected, so that the automatic correction process of the IPMI command is realized, the accuracy of the execution of the IPMI command is improved, and the efficiency of the execution of the IPMI command is improved.

Description

IPMI command correction method and device
Technical Field
The present invention relates to the field of server technologies, and in particular, to a method and an apparatus for correcting an IPMI command.
Background
IPMI (Intelligent Platform Management Interface ) can span different operating systems, firmware and hardware platforms, and can intelligently monitor, control and automatically report back the operation status of a large number of servers, so as to reduce the cost of the server system. As a function most commonly used in server management, IPMI interfaces are used in large amounts by both users and development testers.
The existing method is based on the direct execution after IPMI command is written by operation and maintenance personnel or developer. Because of the limitation of the IPMI interface, more parameters are required to be set for writing the IPMI command to normally execute the command, if the command fails to be executed due to parameter input errors, the command is re-modified and then executed, so that a great amount of time is consumed, and the resource consumption of a network is increased.
Disclosure of Invention
The invention provides a correction method and device of an IPMI command, which are used for solving the technical problems that more parameters are required to be set for writing the IPMI command in the prior art, if the command is executed again after being modified due to the fact that the parameter is input incorrectly, a great amount of time is consumed, and the resource consumption of a network is increased.
The invention provides a correction method of an IPMI command, which comprises the following steps:
acquiring an Intelligent Platform Management Interface (IPMI) command to be executed;
splitting the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command;
determining the interface type parameter and error parameters in the command type parameter based on stored IPMI command standard parameters, wherein the IPMI command standard parameters comprise a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters;
And correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command.
According to the method for correcting the IPMI command provided by the invention, based on the IPMI command standard parameter, the error parameter is corrected, and the method comprises the following steps:
comparing the error parameter with each IPMI command standard parameter, and determining a target parameter with the maximum number of characters containing the error parameter in each IPMI command standard parameter;
and changing the error parameter in the IPMI command into the target parameter.
According to the method for correcting the IPMI command provided by the invention, the error parameter is compared with each IPMI command standard parameter, and the target parameter with the maximum character number of the error parameter in each IPMI command standard parameter is determined, which comprises the following steps:
splitting the character string corresponding to the error parameter to obtain a plurality of characters of the error parameter;
splitting the character strings corresponding to the IPMI command standard parameters to obtain a plurality of characters of the IPMI command standard parameters;
and comparing the characters of the error parameter with the characters of the IPMI command standard parameter respectively, and determining the target parameter with the maximum number of characters of the error parameter in each IPMI command standard parameter.
According to the method for correcting the IPMI command provided by the invention, before determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI command standard parameter, the method further comprises the following steps:
acquiring a plurality of IPMI standard interface type parameters in IPMI standard parameters and a plurality of IPMI standard command type parameters in the IPMI standard parameters;
storing the IPMI standard interface type parameters to a first parameter set, and storing the IPMI standard command type parameters to a second parameter set.
According to the method for correcting the IPMI command provided by the invention, based on the stored IPMI command standard parameter, the interface type parameter and the error parameter in the command type parameter are determined, and the method comprises the following steps:
judging the interface type parameter based on the character similarity between the interface type parameter and each IPMI standard interface type parameter stored in the first parameter set, and determining an error parameter in the interface type parameter;
and judging the command type parameter based on the character similarity between the command type parameter and each IPMI standard command type parameter stored in the second parameter set, and determining an error parameter in the command type parameter.
According to the method for correcting the IPMI command provided by the invention, the IPMI command is split to obtain the interface type parameter in the IPMI command and the command type parameter in the IPMI command, and the method comprises the following steps:
splitting the IPMI command based on an interface information identifier of the IPMI command to obtain an interface type parameter in the IPMI command, wherein the interface information identifier is an identifier for determining the interface type parameter in the IPMI command;
splitting the IPMI command based on a parameter information identifier of the IPMI command to obtain a command type parameter in the IPMI command, wherein the parameter information identifier is an identifier used for determining an execution parameter in the IPMI command.
According to the method for correcting the IPMI command provided by the invention, the IPMI command of the intelligent platform management interface to be executed is obtained, and the method comprises the following steps:
before an IPMI command execution tool sends a request message corresponding to an IPMI command to be executed, the IPMI command is acquired.
The invention also provides a correction device of the IPMI command, which comprises:
the command acquisition module is used for acquiring an Intelligent Platform Management Interface (IPMI) command to be executed;
the command splitting module is used for splitting the IPMI command to obtain interface type parameters in the IPMI command and command type parameters in the IPMI command;
The verification module is used for determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI command standard parameter, wherein the IPMI command standard parameter comprises a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters;
and the correction module is used for correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the correction method of any IPMI command when executing the computer program.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a correction method for any one of the IPMI commands described above.
According to the correction method and device for the IPMI command, the interface type parameter in the IPMI command and the command type parameter in the IPMI command are obtained by splitting the acquired IPMI command. Based on the stored IPMI command standard parameters, the obtained interface type parameters and command type parameters are judged, error parameters in the interface type parameters and the command type parameters are determined and corrected, the automatic correction process of the IPMI command is realized, the condition that a user needs to execute error multiple times of manual adjustment according to the IPMI command is avoided, the accuracy of the execution of the IPMI command is improved, the efficiency of the execution of the IPMI command is improved, and the network resource consumption is saved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are some embodiments of the invention and that other drawings can be obtained from them without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for correcting IPMI commands according to the present invention;
FIG. 2 is a flow chart illustrating a method for correcting an IPMI command according to the present invention;
FIG. 3 is a schematic diagram of an IPMI command correction device according to the present invention;
fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The present invention provides a method for correcting an IPMI command, and fig. 1 is a flow chart of the method for correcting an IPMI command provided by the present invention. Referring to fig. 1, the method for correcting an IPMI command provided by the present invention may include:
step 110, acquiring an intelligent platform management interface IPMI command to be executed;
step 120, splitting the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command;
step 130, determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI standard parameter, wherein the IPMI standard parameter comprises a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters;
and step 140, correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command.
The execution subject of the correction method of IPMI command provided by the present invention may be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a cell phone, tablet, notebook, palmtop, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS) or personal computer (personal computer, PC), etc., the invention is not particularly limited.
The following describes the technical scheme of the present invention in detail by taking a computer to execute the correction method of the IPMI command provided by the present invention as an example.
In step 110, an intelligent platform management interface IPMI command to be executed is obtained.
IPMI refers to a set of computer interface specifications for out-of-band management. Out-of-band refers to accessing a computer system without being in the same room as the physical assets of the system. IPMI supports remote monitoring without the need for permission of the computer operating system.
IPMI runs on separate hardware connected to the motherboard or server. This separate hardware is the BMC (Baseboard Management Controller ). The BMC manages the interface between platform hardware and system management software. The BMC receives reports from sensors within the system and operates on the reports. Through these reports, IPMI may ensure that the system is operating at optimal capacity.
The core of IPMI is a dedicated chip/controller (server processor or baseboard management controller) that does not rely on the server's processor, BIOS or operating system to operate, and is a proxy-free management subsystem that operates solely within the system, so long as there is a BMC and IPMI firmware that can start to operate, where the BMC is typically a separate board mounted on the server motherboard, and there is also a server motherboard that provides support for IPMI. The good autonomy of IPMI overcomes the limitations of the conventional os-based management methods, such as the operation system still being able to perform operations such as power on/off, information extraction, etc. without responding or loading.
And acquiring the IPMI command to be executed. Specifically, the IPMI command is written by an operator or developer, and the IPMI command is executed in the operating system of the server after the completion of the writing. After the IPMI command is executed in the operating system, the IPMI command is received by the IPMI tool in the operating system, and specific contents in the IPMI command are executed.
Acquiring the IPMI command to be executed may refer to acquiring the IPMI command at a time after the IPMI command is written, but before the IPMI command is executed in the operating system.
In step 120, after the IPMI command is obtained, the IPMI command is split to obtain the interface type parameter in the IPMI command and the command type parameter in the IPMI command.
The IPMI command is composed of two parts, parameter and command, for example, for IPMI command: "ipmitool-I lanplus-H100.2.77.77-U admin-P admin mc info" contains multiple parameters and commands. The parameter part includes "-I lanplus-H100.2.77.77-U admin-P admin". Wherein, "-I lanplus" refers to an interface type of "lanplus"; "-H100.2.77.77" means that the address of the target server is "100.2.77.77"; "-U admin" means that the user name of the target server is "admin"; the term "P admin" means that the password of the target server is "admin". "mc info" refers to the command portion in the IPMI command.
Because of more IPMI instructions, it is difficult to directly judge the whole IPMI instruction and determine whether the current IPMI instruction is normal. Therefore, after the IPMI command is acquired, the IPMI command is split, so that independent judgment of each part in the IPMI command is facilitated, and error parameters in the IPMI command are determined.
The IPMI command is a command for managing the interface of the computer, so when the IPMI command is managed, it is first required to determine whether the corresponding interface type parameter in the IPMI command is accurate, and if the interface type is accurate, it is also required to determine whether the command following the parameter is accurate. Therefore, the IPMI command is split to obtain the interface type parameter in the IPMI command and the command type parameter in the IPMI command, and the judgment of the interface type parameter in the IPMI command and the command type parameter in the IPMI command can be realized later.
In step 130, based on the stored IPMI command standard parameters, the interface type parameter and the command type parameter are determined, and the error parameters in the interface type parameter and the command type parameter are determined.
The IPMI command standard parameters are parameters of a large number of standard IPMI commands stored in advance, and are composed of a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters.
For example, for a remote interface type parameter in an IPMI command, the standard remote interface type parameter is "lanplus", i.e., the corresponding remote interface type parameter in the stored IPMI command standard parameter is "lanplus". If the received IPMI instruction is "ipmitool-I lanpl-H100.2.77.77 xxx", the interface type parameter in the IPMI instruction obtained after splitting is "lanpl", and after comparison, determining that the interface type parameter is an error parameter. Similarly, based on the comparison between the IPMI standard command type parameter in the IPMI standard command parameter and the command type parameter obtained by splitting in the IPMI command, the judgment on whether the command type parameter in the IPMI command is an error parameter can be realized.
In step 140, after determining the error parameters in the IPMI, the error parameters are corrected based on the standard parameters in the standard parameters of the IPMI command, so as to obtain the corrected IPMI command.
Specifically, after determining the error parameter in the IPMI, determining the correct parameter corresponding to the error parameter in the standard parameter of the IPMI command, and replacing the error parameter in the IPMI command with the determined correct parameter to obtain the corrected IPMI command.
It can be understood that, before the IPMI command is executed, the received IPMI command is automatically corrected, so that the user is prevented from manually adjusting the IPMI command for multiple times according to the execution error of the IPMI command, the accuracy of the IPMI command is improved, and the efficiency of the IPMI command execution is improved.
According to the correction method of the IPMI command, the acquired IPMI command is split, so that the interface type parameter in the IPMI command and the command type parameter in the IPMI command are obtained. Based on the stored IPMI command standard parameters, the obtained interface type parameters and command type parameters are judged, error parameters in the interface type parameters and the command type parameters are determined and corrected, the automatic correction process of the IPMI command is realized, the condition that a user needs to execute error multiple times of manual adjustment according to the IPMI command is avoided, the accuracy of the execution of the IPMI command is improved, the efficiency of the execution of the IPMI command is improved, and the network resource consumption is saved.
In one embodiment, correcting the error parameter based on the IPMI command standard parameter includes: comparing the error parameter with each IPMI command standard parameter, and determining a target parameter with the maximum number of characters containing the error parameter in each IPMI command standard parameter; and changing the error parameter in the IPMI command into the target parameter.
After determining the error parameters in the IPMI command, correction of the error parameters is required. It can be understood that the IPMI command standard parameters include standard parameters corresponding to each parameter, and the error parameters are respectively compared with the IPMI command standard parameters to determine the target parameter with the maximum number of characters including the error parameters in the IPMI command standard parameters.
For example, when the obtained error parameter is "lanpl", the obtained error parameter "lanpl" is compared with each parameter in the IPMI standard command parameters. The parameter "lanplus" in the IPMI standard command parameter is determined as the parameter with the largest number of characters in the error parameter, namely, the parameter "lanplus" in the IPMI standard command parameter is taken as the target parameter.
After the target parameter is determined, the error parameter in the IPMI command is changed into the determined target parameter, so that the correction process of the IPMI command can be realized.
According to the IPMI command correction method provided by the embodiment of the invention, after the error parameters in the IPMI command are determined, the error parameters are respectively compared with the IPMI command standard parameters, the target parameter with the maximum character number of the error parameters in the IPMI command standard parameters is determined, and the error parameters in the IPMI command are changed into the target parameters, so that the IPMI command correction process is realized.
In one embodiment, comparing the error parameter with each IPMI command standard parameter, and determining a target parameter with the largest number of characters including the error parameter in each IPMI command standard parameter includes: splitting the character string corresponding to the error parameter to obtain a plurality of characters of the error parameter; splitting the character strings corresponding to the IPMI command standard parameters to obtain a plurality of characters of the IPMI command standard parameters; and comparing the characters of the error parameter with the characters of the IPMI command standard parameter respectively, and determining the target parameter with the maximum number of characters of the error parameter in each IPMI command standard parameter.
When comparing the error parameters with the IPMI standard parameters, splitting the character strings corresponding to the error parameters and the character strings corresponding to the IPMI standard parameters, and obtaining a plurality of characters corresponding to the character strings after splitting.
And comparing the obtained characters of the error parameter with the characters of the IPMI command standard parameter respectively, and determining the same number of the characters in the current IPMI command standard parameter and the characters in the error parameter.
Based on the character comparison mode, the error parameters are compared with the IPMI command standard parameters, and the target parameter with the maximum number of characters containing the error parameters in the IPMI command standard parameters is determined.
According to the IPMI command correction method provided by the embodiment of the invention, the character strings corresponding to the error parameters and the character strings corresponding to the IPMI command standard parameters are split, a plurality of characters of the character strings are obtained after the splitting, and the process of comparing the error parameters with the IPMI command standard parameters is realized.
In one embodiment, before determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI command standard parameter, the method further includes: acquiring a plurality of IPMI standard interface type parameters in IPMI standard parameters and a plurality of IPMI standard command type parameters in the IPMI standard parameters; storing the IPMI standard interface type parameters to a first parameter set, and storing the IPMI standard command type parameters to a second parameter set.
Before checking the IPMI command and determining the error parameters therein, it is necessary to construct a standard parameter set for storing the IPMI command. And acquiring a plurality of IPMI standard interface type parameters in the IPMI command standard parameters and a plurality of IPMI standard command type parameters in the IPMI command standard parameters. And storing the acquired multiple IPMI standard interface type parameters into a first parameter set, and storing the acquired multiple IPMI standard command type parameters into a second parameter set to realize the storage of the IPMI standard command parameters.
Optionally, the first parameter set and the second parameter set may be data structures such as a group or a container, and when the PMI standard interface type parameter in the first parameter set or the IPMI standard command type parameter in the second parameter set needs to be acquired later, the parameter acquisition can be achieved based on the parameters stored in the traversal set.
In the subsequent parameter comparison process, IPMI command standard parameters can be obtained from traversing the first parameter set and the second parameter set, so that a foundation is provided for realizing the comparison process of the interface type parameters and the command type parameters with the IPMI command standard parameters.
The correction method of the IPMI command provided by the embodiment of the invention obtains a plurality of IPMI standard interface type parameters in the IPMI standard parameters and a plurality of IPMI standard command type parameters in the IPMI standard parameters. The acquired standard parameters are stored in the set, and a foundation is provided for the comparison of the interface type parameters, the command type parameters and the IPMI command standard parameters in the follow-up implementation.
In one embodiment, determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI command standard parameter comprises: judging the interface type parameter based on the character similarity of the interface type parameter and each IPMI standard interface type parameter in the IPMI command standard parameters stored in the first parameter set, and determining an error parameter in the interface type parameter; and judging the command type parameter based on the character similarity between the command type parameter and each IPMI standard command type parameter in the IPMI standard command parameters stored in the second parameter set, and determining an error parameter in the command type parameter.
And determining error parameters in the interface type parameter and the command type parameter based on the IPMI command standard parameters stored in the first parameter set and the second parameter set. And calculating the character similarity of the interface type parameter and each IPMI standard interface type parameter in the IPMI command standard parameters, and realizing the judgment process of the interface type parameter.
Specifically, if the received IPMI instruction is "ipmitool-I lanpl-H100.2.77.77 xxx", the interface type parameter in the IPMI instruction obtained after splitting is "lanpl", and the IPMI standard interface type parameter "lanplus" in the IPMI command standard parameter is compared based on calculating the character similarity of the two to find that the difference is larger, so that the interface type parameter can be determined to be an error parameter. Similarly, the judgment of the command type parameter in the IPMI command can be realized, and the error parameter in the command type parameter is determined.
According to the IPMI command correction method provided by the embodiment of the invention, the judgment process of the interface type parameters is realized by calculating the character similarity of the interface type parameters and the IPMI standard interface type parameters in the IPMI command standard parameters, and a foundation is provided for correcting error parameters in the IPMI command in the follow-up process.
In one embodiment, splitting the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command includes: splitting the IPMI command based on an interface information identifier of the IPMI command to obtain an interface type parameter in the IPMI command, wherein the interface information identifier is an identifier for determining the interface type parameter in the IPMI command; splitting the IPMI command based on a parameter information identifier of the IPMI command to obtain a command type parameter in the IPMI command, wherein the parameter information identifier is an identifier used for determining an execution parameter in the IPMI command.
When splitting the IPMI command, the IPMI command may be split based on the interface information identifier and the parameter information identifier in the IPMI command. Wherein, the interface information identifier is an identifier for determining an interface type parameter in the IPMI command, and the parameter information identifier is an identifier for determining an execution parameter in the IPMI command. For example, for IPMI commands: "ipmitool-I lanplus-H100.2.77.77-U admin-P admin mc info" contains multiple parameters and commands. The interface type parameter is "lanplus", the interface information identifier is "-I", and the interface information identifier "-I" is identified and positioned, so that the interface type parameter immediately following the interface information identifier can be determined.
The IPMI command is composed of two parts, parameter and command, for example, for IPMI command: "ipmitool-I lanplus-H100.2.77.77-U admin-P admin mc info" contains multiple parameters and commands. The parameter part includes "-I lanplus-H100.2.77.77-U admin-P admin". The command portion includes "mc info". Each parameter in the parameter section contains a parameter information identifier, such as "-I", "-H", etc. All parameter information identifiers in the IPMI command are identified, and the last parameter is identified followed by the command portion.
Based on the parameter information identifier of the identification parameter IPMI command, the IPMI command can be split, so that the determination of the command type parameter in the IPMI command is realized.
According to the IPMI command correction method provided by the embodiment of the invention, the IPMI command can be split based on the interface information identifier and the parameter information identifier in the IPMI command, so that the splitting process of the IPMI command is realized, and a foundation is provided for the correction of the subsequent IPMI command.
In one embodiment, obtaining an intelligent platform management interface IPMI command to be executed includes: before an IPMI command execution tool sends a request message corresponding to an IPMI command to be executed, the IPMI command is acquired.
The IPMI command execution tool is an IPMI platform management tool in a command line mode, which can be used in a Linux system, supports the IPMI standard, and can realize the functions of acquiring information of a sensor, displaying log content of a system, remotely switching on and switching off a network and the like by executing the IPMI command. Wherein, the IPMI command execution tool may be an ipmtool tool.
After the developer or the operation and maintenance personnel writes the IPMI command to be executed, the IPMI command is executed in a command execution interface of the operating system. After the IPMI command is executed in the operating system, a request message corresponding to the IPMI command is generated based on the IPMI command execution tool and sent to a corresponding server for execution. Therefore, after the IPMI command execution tool receives the IPMI command to be executed and before the IPMI tool sends the corresponding request message, the IPMI command to be executed can be obtained, and the obtained IPMI command is automatically corrected, so that the accuracy of the execution of the IPMI command can be improved.
According to the IPMI command correction method provided by the embodiment of the invention, before the IPMI command execution tool sends the request message corresponding to the IPMI command to be executed, the IPMI command is acquired and corrected, so that the process of directly generating the request message based on the IPMI command to cause the IPMI command execution error can be avoided, and the accuracy of the IPMI command execution is improved.
The following describes a technical solution provided by the present invention by taking a flow chart of a correction method of an IPMI command provided by the present invention as an example, as shown in fig. 2:
in step 210, before the ipmtool sends a request message corresponding to the IPMI command to be executed, acquiring the IPMI command to be executed;
in step 220, error correction of the inface (interface type parameter) is performed on the acquired IPMI command;
specifically, when receiving an IPMI command, firstly acquiring an interface information identifier "-I" parameter, acquiring an interface type parameter based on a character string after identifying the interface information identifier "-I" parameter, and judging whether the stored IPMI command standard parameter contains the interface type parameter;
if the interface type parameter exists, continuing to execute the command; if the interface type parameter does not exist, matching similar interface type parameters according to character strings of parameters in the IPMI command standard parameters, and modifying corresponding interface type parameters in the IPMI command based on the matched similar interface type parameters to realize correction of the IPMI command.
For example: for the IPMI command "ipmitool-I lanpl-H100.2.77.77 xxx", where the "-I" parameter is followed by the interface type parameter;
Acquiring an interface type parameter which is a 'lanpl' type, judging that the type does not exist in the defined standard interface type based on the stored IPMI command standard parameter, and setting the command interface type as a 'lanplus' type when the interface type closest to character string matching is the 'lanplus' type, so as to realize the correction of the IPMI command;
in step 230, command (Command type parameter) error correction is performed on the IPMI Command:
specifically, command type parameters of the IPMI Command are obtained, and whether a Command of the type exists in the defined standard interface type is judged based on the stored IPMI Command standard parameters;
continuing execution if the Command exists; if the Command does not exist, matching the character strings of all parameters in the IPMI Command standard parameters with similar commands, and obtaining a nearest Command for replacement to realize correction of interface type parameters in the IPMI Command.
For example: for the IMPI Command "ipmitool-I lanpl-H100.2.77.77-U admin-P admin md info", the last parameter is followed by "md info", which is the Command type parameter Command of the IPMI Command,
the "md" command is not present in the standard interface type defined based on the stored IPMI command standard parameter determination,
Searching the IPMI command standard parameters to find the most matched "mc" command, wherein the "info" query command is also in the "mc" command, and modifying the IPMI command to obtain the "ipmitool-I lanpl-H100.2.77.77-U admin-P admin mc info" so as to realize the correction of the command type parameters in the IPMI command.
Fig. 3 is a schematic structural diagram of an IPMI command correction device according to the present invention, and as shown in fig. 3, the device includes a command obtaining module 310, a command splitting module 320, a checking module 330, and a correction module 340.
The command obtaining module 310 is configured to obtain an IPMI command of the intelligent platform management interface to be executed.
IPMI refers to a set of computer interface specifications for out-of-band management. Out-of-band refers to accessing a computer system without being in the same room as the physical assets of the system. IPMI supports remote monitoring without the need for permission of the computer operating system.
IPMI runs on separate hardware connected to the motherboard or server. This separate hardware is the BMC. The BMC manages the interface between platform hardware and system management software. The BMC receives reports from sensors within the system and operates on the reports. Through these reports, IPMI may ensure that the system is operating at optimal capacity.
The core of IPMI is a dedicated chip/controller (server processor or baseboard management controller) that does not rely on the server's processor, BIOS or operating system to operate, but rather is a proxy-free management subsystem that operates solely within the system, so long as there is a BMC and IPMI firmware that can start to operate, and the BMC is typically a separate board card that is installed on the server motherboard, as well as the server motherboard that provides support for IPMI. The good autonomy of IPMI overcomes the limitations of the conventional os-based management methods, such as the operation system still being able to perform operations such as power on/off, information extraction, etc. without responding or loading.
Specifically, the IPMI command is written by an operator or developer, and the IPMI command is executed in the operating system of the server after the completion of the writing. After the IPMI command is executed in the operating system, the IPMI command is received by the IPMI tool in the operating system, and specific contents in the IPMI command are executed.
Acquiring the IPMI command to be executed refers to acquiring the IPMI command after the IPMI command is written, but before the IPMI command is executed in the operating system.
And a command splitting module 320, configured to split the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command.
The IPMI command is composed of two parts, parameter and command, for example, for IPMI command: "ipmitool-I lanplus-H100.2.77.77-U admin-P admin mc info" contains multiple parameters and commands. The parameter part includes "-I lanplus-H100.2.77.77-U admin-P admin". Wherein, "-I lanplus" refers to an interface type of "lanplus"; "-H100.2.77.77" means that the address of the target server is "100.2.77.77"; "-U admin" means that the user name of the target server is "admin"; the term "P admin" means that the password of the target server is "admin". "mc info" refers to the command portion in the IPMI command.
Because of more IPMI instructions, it is difficult to directly judge the whole IPMI instruction and determine whether the current IPMI instruction is normal. Therefore, after the IPMI command is acquired, the IPMI command is split, so that independent judgment of each part in the IPMI command is facilitated, and error parameters in the IPMI command are determined.
The IPMI command is a command for managing the interface of the computer, so when the IPMI command is managed, it is first required to determine whether the corresponding interface type parameter in the IPMI command is accurate, and if the interface type is accurate, it is also required to determine whether the command is accurate. Therefore, the IPMI command is split to obtain the interface type parameter in the IPMI command and the command type parameter in the IPMI command, and the judgment of the interface type parameter in the IPMI command and the command type parameter in the IPMI command can be realized later.
And a checking module 330, configured to determine the interface type parameter and an error parameter in the command type parameter based on the stored IPMI command standard parameter, where the IPMI command standard parameter includes a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters.
The IPMI command standard parameters are parameters of a large number of standard IPMI commands stored in advance, and are composed of a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters.
For example, for a remote interface type parameter in an IPMI command, the standard remote interface type parameter is "lanplus", i.e., the corresponding remote interface type parameter in the stored IPMI command standard parameter is "lanplus". If the received IPMI instruction is "ipmitool-I lanpl-H100.2.77.77 xxx", the interface type parameter in the IPMI instruction obtained after splitting is "lanpl", and after comparison, determining that the interface type parameter is an error parameter. Similarly, based on the comparison between the IPMI standard command type parameter in the IPMI standard command parameter and the command type parameter obtained by splitting in the IPMI command, the judgment on whether the command type parameter in the IPMI command is an error parameter can be realized.
And the correction module 340 is configured to correct the error parameter based on the IPMI command standard parameter, to obtain a corrected IPMI command.
Specifically, after determining the error parameter in the IPMI, determining the correct parameter corresponding to the error parameter in the standard parameter of the IPMI command, and replacing the error parameter in the IPMI command with the determined correct parameter to obtain the corrected IPMI command.
It can be understood that, before the IPMI command is executed, the received IPMI command is automatically corrected, so that the user is prevented from manually adjusting the IPMI command for multiple times according to the execution error of the IPMI command, the accuracy of the IPMI command is improved, and the efficiency of the IPMI command execution is improved.
According to the correction device for the IPMI command, the acquired IPMI command is split, so that the interface type parameter in the IPMI command and the command type parameter in the IPMI command are obtained. Based on the stored IPMI command standard parameters, the obtained interface type parameters and command type parameters are judged, error parameters in the interface type parameters and the command type parameters are determined and corrected, the automatic correction process of the IPMI command is realized, the condition that a user needs to execute error multiple times of manual adjustment according to the IPMI command is avoided, the accuracy of the execution of the IPMI command is improved, the efficiency of the execution of the IPMI command is improved, and the network resource consumption is saved.
In one embodiment, the correction module 340 is specifically configured to:
correcting the error parameter based on the IPMI command standard parameter, including:
comparing the error parameter with each IPMI command standard parameter, and determining a target parameter with the maximum number of characters containing the error parameter in each IPMI command standard parameter;
and changing the error parameter in the IPMI command into the target parameter.
In one embodiment, the correction module 340 is further specifically configured to:
comparing the error parameter with each IPMI command standard parameter, and determining a target parameter with the maximum character number of the error parameter in each IPMI command standard parameter, wherein the target parameter comprises the following components:
splitting the character string corresponding to the error parameter to obtain a plurality of characters of the error parameter;
splitting the character strings corresponding to the IPMI command standard parameters to obtain a plurality of characters of the IPMI command standard parameters;
and comparing the characters of the error parameter with the characters of the IPMI command standard parameter respectively, and determining the target parameter with the maximum number of characters of the error parameter in each IPMI command standard parameter.
In one embodiment, the verification module 330 is specifically configured to:
before determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI command standard parameter, the method further includes:
acquiring a plurality of IPMI standard interface type parameters in IPMI standard parameters and a plurality of IPMI standard command type parameters in the IPMI standard parameters;
storing the IPMI standard interface type parameters to a first parameter set, and storing the IPMI standard command type parameters to a second parameter set.
In one embodiment, the verification module 330 is further specifically configured to:
determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI command standard parameter, including:
judging the interface type parameter based on the character similarity between the interface type parameter and each IPMI standard interface type parameter stored in the first parameter set, and determining an error parameter in the interface type parameter;
and judging the command type parameter based on the character similarity between the command type parameter and each IPMI standard command type parameter stored in the second parameter set, and determining an error parameter in the command type parameter.
In one embodiment, the command splitting module 320 is specifically configured to:
splitting the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command, wherein the method comprises the following steps:
splitting the IPMI command based on an interface information identifier of the IPMI command to obtain an interface type parameter in the IPMI command, wherein the interface information identifier is an identifier for determining the interface type parameter in the IPMI command;
splitting the IPMI command based on a parameter information identifier of the IPMI command to obtain a command type parameter in the IPMI command, wherein the parameter information identifier is an identifier used for determining an execution parameter in the IPMI command.
In one embodiment, the command acquisition module 310 is specifically configured to:
acquiring an Intelligent Platform Management Interface (IPMI) command to be executed, comprising:
before an IPMI command execution tool sends a request message corresponding to an IPMI command to be executed, the IPMI command is acquired.
Fig. 4 illustrates a physical schematic diagram of an electronic device, as shown in fig. 4, which may include: processor 410, communication interface (Communications Interface) 420, memory 430 and communication bus 440, wherein processor 410, communication interface 420 and memory 430 communicate with each other via communication bus 440. The processor 410 may call logic instructions in the memory 430 to perform a correction method for IPMI commands, the method comprising:
Acquiring an Intelligent Platform Management Interface (IPMI) command to be executed;
splitting the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command;
determining the interface type parameter and error parameters in the command type parameter based on stored IPMI command standard parameters, wherein the IPMI command standard parameters comprise a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters;
and correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command.
Further, the logic instructions in the memory 430 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform a method of correcting an IPMI command provided by the above methods, the method comprising:
acquiring an Intelligent Platform Management Interface (IPMI) command to be executed;
splitting the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command;
determining the interface type parameter and error parameters in the command type parameter based on stored IPMI command standard parameters, wherein the IPMI command standard parameters comprise a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters;
and correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command.
In still another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the correction method of IPMI commands provided above, the method comprising:
Acquiring an Intelligent Platform Management Interface (IPMI) command to be executed;
splitting the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command;
determining the interface type parameter and error parameters in the command type parameter based on stored IPMI command standard parameters, wherein the IPMI command standard parameters comprise a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters;
and correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for correcting an IPMI command, the method comprising:
acquiring an Intelligent Platform Management Interface (IPMI) command to be executed;
splitting the IPMI command to obtain an interface type parameter in the IPMI command and a command type parameter in the IPMI command;
determining the interface type parameter and error parameters in the command type parameter based on stored IPMI command standard parameters, wherein the IPMI command standard parameters comprise a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters;
and correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command.
2. The method for correcting an IPMI command according to claim 1, wherein said correcting said error parameter based on said IPMI command standard parameter comprises:
comparing the error parameter with each IPMI command standard parameter, and determining a target parameter with the maximum number of characters containing the error parameter in each IPMI command standard parameter;
and changing the error parameter in the IPMI command into the target parameter.
3. The method for correcting an IPMI command according to claim 2, wherein said comparing said error parameter with each IPMI command standard parameter to determine a target parameter having a largest number of characters including said error parameter in each IPMI command standard parameter, comprises:
Splitting the character string corresponding to the error parameter to obtain a plurality of characters of the error parameter;
splitting the character strings corresponding to the IPMI command standard parameters to obtain a plurality of characters of the IPMI command standard parameters;
and comparing the characters of the error parameter with the characters of the IPMI command standard parameter respectively, and determining the target parameter with the maximum number of characters of the error parameter in each IPMI command standard parameter.
4. The method for correcting an IPMI command according to claim 1, wherein before determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI command standard parameter, further comprising:
acquiring a plurality of IPMI standard interface type parameters in IPMI standard parameters and a plurality of IPMI standard command type parameters in the IPMI standard parameters;
storing the IPMI standard interface type parameters to a first parameter set, and storing the IPMI standard command type parameters to a second parameter set.
5. The method for correcting an IPMI command according to claim 4, wherein said determining an error parameter in said interface type parameter and said command type parameter based on stored IPMI command standard parameters comprises:
Judging the interface type parameter based on the character similarity between the interface type parameter and each IPMI standard interface type parameter stored in the first parameter set, and determining an error parameter in the interface type parameter;
and judging the command type parameter based on the character similarity between the command type parameter and each IPMI standard command type parameter stored in the second parameter set, and determining an error parameter in the command type parameter.
6. The method for correcting an IPMI command according to claim 1, wherein said splitting the IPMI command to obtain the interface type parameter in the IPMI command and the command type parameter in the IPMI command comprises:
splitting the IPMI command based on an interface information identifier of the IPMI command to obtain an interface type parameter in the IPMI command, wherein the interface information identifier is an identifier for determining the interface type parameter in the IPMI command;
splitting the IPMI command based on a parameter information identifier of the IPMI command to obtain a command type parameter in the IPMI command, wherein the parameter information identifier is an identifier used for determining an execution parameter in the IPMI command.
7. The method for correcting an IPMI command according to claim 1, wherein said obtaining an Intelligent Platform Management Interface (IPMI) command to be executed comprises:
before an IPMI command execution tool sends a request message corresponding to an IPMI command to be executed, the IPMI command is acquired.
8. An IPMI command correction apparatus, comprising:
the command acquisition module is used for acquiring an Intelligent Platform Management Interface (IPMI) command to be executed;
the command splitting module is used for splitting the IPMI command to obtain interface type parameters in the IPMI command and command type parameters in the IPMI command;
the verification module is used for determining the interface type parameter and the error parameter in the command type parameter based on the stored IPMI command standard parameter, wherein the IPMI command standard parameter comprises a plurality of IPMI standard interface type parameters and a plurality of IPMI standard command type parameters;
and the correction module is used for correcting the error parameter based on the IPMI command standard parameter to obtain a corrected IPMI command.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of correcting IPMI commands according to any one of claims 1 to 7 when executing the computer program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the method of correcting IPMI commands according to any one of claims 1 to 7.
CN202310534930.4A 2023-05-12 2023-05-12 IPMI command correction method and device Pending CN116755773A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310534930.4A CN116755773A (en) 2023-05-12 2023-05-12 IPMI command correction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310534930.4A CN116755773A (en) 2023-05-12 2023-05-12 IPMI command correction method and device

Publications (1)

Publication Number Publication Date
CN116755773A true CN116755773A (en) 2023-09-15

Family

ID=87957962

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310534930.4A Pending CN116755773A (en) 2023-05-12 2023-05-12 IPMI command correction method and device

Country Status (1)

Country Link
CN (1) CN116755773A (en)

Similar Documents

Publication Publication Date Title
US10002054B2 (en) Method and system for performing automatic system recovery
EP2472402A1 (en) Remote management systems and methods for mapping operating system and management controller located in a server
CN106547645B (en) Method for automatically restoring image file and server system
US20180077232A1 (en) Method and Device for Establishing Communication Connection
US11693731B2 (en) System and methods for diagnosing and repairing a smart mobile device by disabling components
CN110716892A (en) Board management method and device and communication board
CN113672306A (en) Server component self-checking abnormity recovery method, device, system and medium
CN111694684A (en) Abnormal construction method and device of storage equipment, electronic equipment and storage medium
CN111625264B (en) Method, device, equipment and medium for upgrading multi-level management system
CN117251333A (en) Method, device, equipment and storage medium for acquiring hard disk information
CN116755773A (en) IPMI command correction method and device
CN114860325A (en) Network card adapting method, device, equipment and storage medium
WO2019056545A1 (en) Test machine automation management method and apparatus, device, and storage medium
US11586536B1 (en) Remote configuration of multi-mode DIMMs through a baseboard management controller
US11204704B1 (en) Updating multi-mode DIMM inventory data maintained by a baseboard management controller
CN111124095B (en) Power supply running state detection method and related device during upgrading of power supply firmware
CN113849354A (en) Connection checking method, connection checking device, server and storage medium
CN111400094A (en) Method, device, equipment and medium for restoring factory settings of server system
CN117215859B (en) Main and standby BIOS automatic switching method, automatic switching device and computer
CN114327986B (en) FRB2WDT timeout time determining method, device, equipment and medium
CN117349127B (en) GPU card-falling detection method and device
CN108196798B (en) RAID control card configuration method and device
CN113869108B (en) Method and related device for identifying equipment connected with hard disk backboard
CN109710319B (en) Method and system for identifying in-place hard disk of computer
CN117349062A (en) BIOS fault processing method, system, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination