Hardware monitoring method and device based on Redfish interface
By adopting the hardware monitoring method of Redfish interface in a diverse and complex hardware environment, the shortcomings of traditional SNMP protocol in fault monitoring and diagnosis are solved, and fast and accurate hardware fault monitoring and diagnosis are achieved, improving system stability and maintenance.
Patent Information
- Application Number
- CN202411630328.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-04-18
AI Technical Summary
In a diverse and complex hardware environment, traditional SNMP protocols are difficult to quickly and accurately monitor and diagnose hardware failures, and there are problems of weak security, cumbersome configuration and inconsistent standards.
Using the hardware monitoring method based on the Redfish interface, by obtaining the Redfish interface of the substrate management controller of the target server, establishing communication connections, automatically obtaining hardware monitoring data, analyzing monitoring parameters, and achieving compatibility with diverse hardware environments.
It realizes rapid and accurate monitoring and diagnosis of hardware failures in a diverse and complex hardware environment, optimizes hardware monitoring efficiency, and improves system stability and maintenance.
Smart Images

Figure CN119847853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of servers, and in particular to a hardware monitoring method and device based on a Redfish interface. Background Art
[0002] In large-scale server cluster systems, hardware failures inevitably become common due to the large number of devices. How to detect and handle these hardware failures in a timely and accurate manner is an important challenge in server operation and maintenance management. Traditional server hardware monitoring methods usually rely on SNMP (Simple Network Management Protocol), which has certain advantages in monitoring hardware status. However, SNMP has also exposed some problems in practical applications, especially in large-scale data center environments.
[0003] The security of the SNMP protocol is relatively weak and is vulnerable to malicious attacks or unauthorized access, which makes the stability and security of the system insufficiently guaranteed. Secondly, the standards of the SNMP protocol have not yet been fully unified, and the devices of different manufacturers may not be completely consistent, resulting in the monitoring and management of device status becoming complicated and inflexible in the environment of multi-vendor equipment. In addition, the configuration and use of SNMP is relatively cumbersome, requiring system administrators to have certain professional knowledge, which increases the difficulty of operation and the risk of error. Some newer domestic hardware devices do not fully support SNMP, or do not support this protocol at all, which makes traditional SNMP monitoring methods unable to meet the status perception and monitoring needs of these hardware devices, further increasing the complexity and difficulty of operation and maintenance work. Therefore, how to quickly and accurately monitor and diagnose hardware failures in this diverse and complex hardware environment has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of this, the present invention provides a hardware monitoring method, device, computer equipment, and storage medium based on the Redfish interface to solve the problem of how to quickly and accurately monitor and diagnose hardware failures in a diversified and complex hardware environment.
[0005] In a first aspect, the present invention provides a hardware monitoring method based on a Redfish interface, the method being applied to a monitoring end, the method comprising:
[0006] Obtaining a Redfish interface of a baseboard management controller of a target server, and establishing a communication connection with the Redfish interface;
[0007] Obtaining, through the communication connection, a first text in a target root address of the Redfish interface;
[0008] According to the first preset keyword, searching the first text for a preset address corresponding to each hardware to be tested in the hardware set to be tested, to obtain a preset address set corresponding to the hardware set to be tested;
[0009] Determining a target address set based on each preset address in the preset address set;
[0010] Respectively obtain the second text of each target address in the target address set to obtain a second text set;
[0011] The monitoring parameters of each piece of hardware to be tested are respectively parsed from each second text in the second text set.
[0012] The hardware monitoring method based on the Redfish interface provided by the present invention has the following advantages:
[0013] By establishing a connection with the Redfish interface, the monitoring data of hardware devices can be obtained in batches, avoiding the tedious process of manual acquisition and management. Through the automatic matching of the first preset keyword and the preset address set, the second text of each target address can be automatically obtained and the monitoring parameters of different hardware to be tested can be parsed from each text, ensuring that the monitoring data of the hardware to be tested is comprehensively and accurately extracted, providing strong support for system operation and maintenance and troubleshooting. This method can adapt to different servers. The main reason is that as long as the server supports the Redfish protocol, the hardware parameters stored in different sub-addresses can be uniformly accessed through the target root address, thereby achieving compatibility of this method with diverse and complex hardware environments. In summary, this method optimizes the efficiency of hardware monitoring and improves the stability and maintainability of the system through automatic and accurate data acquisition and processing.
[0014] In an optional embodiment, the method further includes:
[0015] According to a second preset keyword, searching the first text for an overall status identifier of the target server;
[0016] According to the overall status identifier, overall status information of the target server is determined, where the overall status information indicates an overall health status of the target server.
[0017] Specifically, in the steps of the method, by obtaining and parsing the target root address text of the Redfish interface in the communication connection, and searching for the health status identifier through the second preset keyword, the overall health status information of the target server is further determined, which not only improves the efficiency and accuracy of monitoring, but also enhances the automatic processing capability, making the entire server management system more intelligent and efficient.
[0018] In an optional implementation, the target root address includes: a chassis root address and a system root address;
[0019] The determining of the target address set based on each preset address in the preset address set includes:
[0020] Comparing each of the preset addresses in the first sub-address set and the second sub-address set to obtain a comparison result, wherein the first sub-address set is a sub-address set of the chassis root address in the preset address set; and the second sub-address set is a sub-address set of the system root address in the preset address set;
[0021] From the preset address set, duplicate preset addresses indicated by the comparison result are removed to obtain a target address set.
[0022] Specifically, in the steps of the method, by comparing the sub-address set in the chassis root address and the system root address, and removing duplicate preset addresses, the system can accurately determine the unique target address set, thereby optimizing monitoring, improving efficiency, and reducing redundancy. This not only improves system performance and management efficiency, but also enhances operation and maintenance automation and troubleshooting capabilities, and is suitable for large-scale data centers or multi-level architecture system environments.
[0023] In an optional implementation manner, comparing each of the preset addresses in the first sub-address set and the second sub-address set to obtain a comparison result includes:
[0024] Comparing whether each of the preset addresses in the first sub-address set and the second sub-address set corresponds to the same hardware to be tested at the same time, and obtaining a comparison result;
[0025] The step of removing duplicate preset addresses indicated by the comparison result from the preset address set to obtain a target address set includes:
[0026] If the comparison result corresponds to the same hardware under test at the same time, then according to the first preset rule, the preset address corresponding to the same hardware under test in the first sub-address set or the second sub-address set is deleted from the preset address set to obtain the target address set.
[0027] Specifically, in the steps of this method, by comparing and removing duplicate preset addresses, the system can optimize the management of hardware addresses, reduce redundant data, and improve monitoring efficiency and resource utilization. This can reduce management complexity, improve system performance, scalability, and maintainability, and has important application value in large-scale device management and complex network environments.
[0028] In an optional implementation, determining a target address set based on each preset address in the preset address set includes:
[0029] Determining the priority of each preset address in the preset address set according to a second preset rule;
[0030] According to the priorities of the preset addresses, multiple target addresses are extracted from the preset address set to obtain the target address set.
[0031] Specifically, in the steps of the method, by filtering the addresses in the preset address set based on priority and generating the target address set, this implementation method improves the accuracy and efficiency of address screening and optimizes resource allocation and scheduling. It can flexibly adapt to different business needs, support large-scale data processing, and improve the responsiveness and scalability of the system. Ultimately, the system can more efficiently extract and manage the target address, improving the intelligence and automation level of the overall system.
[0032] In an optional implementation, parsing out monitoring parameters of each hardware to be tested from each second text in the second text set includes:
[0033] According to a third preset keyword, searching for parameter identifiers of each hardware to be tested of the target server from each second text in the second text set;
[0034] According to the parameter identifiers of the hardware to be tested, the monitoring parameters of the hardware to be tested are parsed.
[0035] Specifically, in the steps of the method, by searching and parsing the monitoring parameters of the hardware to be tested in the second text set, the accuracy and efficiency of data extraction can be improved. This can not only optimize resource utilization, improve the accuracy and integrity of system monitoring, but also support the efficient operation of the system when facing scale expansion, while enhancing fault diagnosis and early warning capabilities, providing strong technical support for large-scale equipment management and complex system environments.
[0036] In a second aspect, the present invention provides a hardware monitoring device based on a Redfish interface, the device being applied to a monitoring end, the device comprising:
[0037] A first acquisition module is used to acquire a Redfish interface of a baseboard management controller of a target server and establish a communication connection with the Redfish interface;
[0038] A second acquisition module is used to acquire the first text in the target root address of the Redfish interface through the communication connection;
[0039] A search module, configured to search the first text for a preset address corresponding to each hardware to be tested in the hardware set to be tested according to a first preset keyword, and obtain a preset address set corresponding to the hardware set to be tested;
[0040] A determination module, configured to determine a target address set based on each preset address in the preset address set;
[0041] A third acquisition module is used to respectively acquire the second text of each target address in the target address set to obtain a second text set;
[0042] The parsing module is used to parse out the monitoring parameters of each hardware to be tested from each second text in the second text set.
[0043] The hardware monitoring device based on the Redfish interface provided by the present invention has the following advantages:
[0044] By establishing a connection with the Redfish interface, the monitoring data of hardware devices can be obtained in batches, avoiding the tedious process of manual acquisition and management. Through the automatic matching of the first preset keyword and the preset address set, the second text of each target address can be automatically obtained and the monitoring parameters of different hardware to be tested can be parsed from each text, ensuring that the monitoring data of the hardware to be tested is comprehensively and accurately extracted, providing strong support for system operation and maintenance and troubleshooting. This method can adapt to different servers. The main reason is that as long as the server supports the Redfish protocol, the hardware parameters stored in different sub-addresses can be uniformly accessed through the target root address, thereby achieving compatibility of this method with diverse and complex hardware environments. In summary, this method optimizes the efficiency of hardware monitoring and improves the stability and maintainability of the system through automatic and accurate data acquisition and processing.
[0045] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the hardware monitoring method based on the Redfish interface of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0046] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the hardware monitoring method based on the Redfish interface of the above-mentioned first aspect or any corresponding embodiment thereof.
[0047] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the hardware monitoring method based on the Redfish interface of the above-mentioned first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 is one of the flow charts of the hardware monitoring method based on the Redfish interface according to an embodiment of the present invention;
[0050] Figure 2 This is a second flowchart of a hardware monitoring method based on a Redfish interface according to an embodiment of the present invention;
[0051] Figure 3 is a schematic diagram of a hardware monitoring device based on a Redfish interface according to an embodiment of the present invention;
[0052] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0054] A RESTful interface is an application programming interface (API) based on the REST (Representational State Transfer) architectural style.
[0055] Redfish is a management standard that uses a data model representation of a hypermedia RESTful interface. This model is represented in a standard machine-readable schema, and its message payload is represented in JSON. The Redfish API is a hypermedia API that can represent various implementations through a unified interface. The Redfish API provides mechanisms for data center resource management, event processing, long-duration tasks, and discovery.
[0056] According to an embodiment of the present invention, a hardware monitoring method embodiment based on a Redfish interface is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0057] In this embodiment, a hardware monitoring method based on the Redfish interface is provided, which can be used for the monitoring terminal deployed in the above-mentioned computer. Figure 1 is one of the flow charts of a hardware monitoring method based on a Redfish interface according to an embodiment of the present invention, the method comprising:
[0058] Step S101, obtaining a Redfish interface of a baseboard management controller (BMC) of a target server, and establishing a communication connection with the Redfish interface.
[0059] In this embodiment, the target server may be a server having a Redfish interface among a plurality of servers of different types, architectures or performances.
[0060] In some examples, the execution subject obtains the Redfish interface and establishes a communication connection therewith, which may include but is not limited to: using the HTTPS (HyperText Transfer Protocol Secure) protocol on the monitoring end to complete authentication with the server's Redfish API and establish a session connection (i.e., a communication connection).
[0061] Step S102: obtaining the first text in the target root address of the Redfish interface through the communication connection.
[0062] In this embodiment, the target root address may be a URL (Uniform Resource Locator) of the target server that includes multiple sub-resources.
[0063] In some examples, the above-mentioned execution entity obtains the first text in a manner that may include but is not limited to: using a Python (a high-level, general-purpose programming language) script to send a request to a target root address, and obtaining a returned JSON (JavaScript Object Notation) text, namely, the first text.
[0064] Step S103: searching the first text for a preset address corresponding to each hardware under test in the hardware under test set according to the first preset keyword, and obtaining a preset address set corresponding to the hardware under test set.
[0065] In this embodiment, the first preset keyword is a keyword corresponding to the hardware resource to be searched. The first keyword may be provided through the @odata.id (a field in the open data protocol) field, pointing to a specific hardware parameter or sub-address.
[0066] In the first text, there are usually fields corresponding to multiple hardware parameters. Different fields contain addresses pointing to different hardware or management units. By searching the first keyword, the preset address of each hardware parameter can be found.
[0067] Step S104: determining a target address set based on each preset address in the preset address set.
[0068] In this embodiment, all or part of the preset addresses may be selected from the preset address set as target addresses from which hardware parameters need to be extracted, as the target address set.
[0069] Step S105 , respectively obtain the second text of each target address in the target address set to obtain a second text set.
[0070] In this embodiment, the second text may be obtained in the same manner as the first text. The second text may be a JSON text obtained by sending requests to each target address in the target address set determined in the previous step one by one.
[0071] Step S106: parsing the monitoring parameters of each hardware to be tested from each second text in the second text set.
[0072] In this embodiment, multiple key-value pairs in the second text can be parsed, and the values corresponding to each key are used as monitoring parameters corresponding to each hardware to be tested. These monitoring parameters are the health status, configuration, performance content, etc. of the hardware, which are not limited in this application.
[0073] The hardware monitoring method based on the Redfish interface provided by the present invention has the following advantages: by establishing a connection with the Redfish interface, the monitoring data of the hardware equipment can be obtained in batches, avoiding the tedious process of manual acquisition and management. Through the automatic matching of the first preset keyword and the preset address set, the second text of each target address can be automatically obtained and the monitoring parameters of different hardware to be tested can be parsed from each text, ensuring that the monitoring data of the hardware to be tested is comprehensively and accurately extracted, providing strong support for system operation and maintenance and troubleshooting. The method can adapt to different servers, the main reason is that as long as the server supports the Redfish protocol, the hardware parameters stored in different sub-addresses can be uniformly accessed through the target root address, thereby realizing the compatibility of the method with diversified and complex hardware environments. In summary, the method optimizes the hardware monitoring efficiency and improves the stability and maintainability of the system through automatic and accurate data acquisition and processing.
[0074] In some optional embodiments, in order to further determine the overall health status of the target server, the above method also includes: searching for the overall status identifier of the above target server from the above first text according to a second preset keyword; and determining the overall status information of the above target server according to the above overall status identifier.
[0075] In this optional implementation, the second preset keyword can be a predefined keyword used to search for the overall status identifier in the first text, and the overall status identifier is used to correspond to the device model, serial number, and health status. For example, the JSON text includes the keywords "Model", "SerialNumber", and "Status.Health", from which the model, serial number, and health status of the device can be obtained respectively. The overall status information is the current status information of the target server determined according to the overall status identifier. The current status information indicates the overall health status of the above-mentioned target server.
[0076] For example, the "Status.Health" keyword in the second preset keyword and the overall status identifier are a set of key-value pairs, and the corresponding value, that is, the overall status identifier, can be found according to the key "Status.Health". If the above overall status identifier is "OK", the overall status information is healthy, and if the above overall status identifier is not "OK", the overall status information is faulty.
[0077] The hardware monitoring method based on the Redfish interface in this embodiment obtains and parses the target root address text of the Redfish interface in the communication connection, and searches for the health status identifier through the second preset keyword to further determine the overall health status information of the target server, which not only improves the efficiency and accuracy of monitoring, but also enhances the automatic processing capability, making the entire server management system more intelligent and efficient.
[0078] In some optional implementations, in order to further be compatible with different servers, the target root address includes: a chassis root address and a system root address.
[0079] The chassis root address is the address of the physical chassis (hardware layer), while the system root address is the root address on the server system layer (such as the operating system and virtualization platform).
[0080] The above step 104 includes:
[0081] The preset addresses in the first sub-address set and the second sub-address set are compared to obtain a comparison result. From the preset address set, repeated preset addresses indicated by the comparison result are removed to obtain a target address set.
[0082] The first sub-address set is a sub-address set of the chassis root address in the preset address set, and the second sub-address set is a sub-address set of the system root address in the preset address set.
[0083] The execution subject can compare the first sub-address set and the second sub-address set to check whether there are duplicate preset addresses in them. The purpose is to identify whether there is an intersection between the two sets of address sets, that is, whether there are corresponding sub-addresses with the same hardware parameters in both sub-address sets. The execution subject identifies the duplicate preset addresses through the comparison results and removes them from the preset address set. The target address set does not contain duplicate addresses, ensuring that only unique addresses are retained in the end, thereby avoiding the same hardware parameters from being collected from two addresses separately.
[0084] The Redfish interface-based hardware monitoring method in this embodiment can accurately determine the unique target address set by comparing the sub-address set in the chassis root address and the system root address and removing duplicate preset addresses, thereby optimizing monitoring, improving efficiency, and reducing redundancy. This not only improves system performance and management efficiency, but also enhances operation and maintenance automation and troubleshooting capabilities, and is suitable for large-scale data centers or multi-level architecture system environments.
[0085] In some optional implementations, in order to further deduplicate sub-addresses, the above-mentioned comparison of each of the above-mentioned preset addresses in the first sub-address set and the second sub-address set to obtain a comparison result includes: comparing whether each of the above-mentioned preset addresses in the above-mentioned first sub-address set and the above-mentioned second sub-address set simultaneously corresponds to the same hardware to be tested to obtain a comparison result. The above-mentioned deduplication of the repeated preset addresses indicated by the above-mentioned comparison result from the above-mentioned preset address set to obtain a target address set includes: if the above-mentioned comparison result is that they simultaneously correspond to the same hardware to be tested, then according to the first preset rule, the above-mentioned preset addresses corresponding to the above-mentioned same hardware to be tested in the above-mentioned first sub-address set or the above-mentioned second sub-address set are deleted from the above-mentioned preset address set to obtain the above-mentioned target address set.
[0086] In this embodiment, the hardware to be tested may be configured with multiple addresses, and these addresses may appear in different address sets, such as the addresses of the chassis layer and the addresses of the system layer. In this step, each preset address in the first sub-address set and the second sub-address set needs to be compared with the hardware to be tested. That is, for each address in the set, it is necessary to check whether the address points to the same hardware parameter.
[0087] The first preset rule indicates how to select and delete addresses, for example, to select and delete duplicate preset addresses in the sub-address set of the chassis root address. After deleting the duplicate addresses, a target address set is finally obtained, and the addresses in this set will not be repeated, and the address corresponding to each hardware to be tested is unique. The target address set after deduplication can ensure that each hardware device corresponds to only one address, avoiding redundant monitoring data.
[0088] The hardware monitoring method based on the Redfish interface in this embodiment can optimize the management of hardware addresses, reduce redundant data, and improve monitoring efficiency and resource utilization by comparing and removing duplicate preset addresses. It can also reduce management complexity, improve system performance, scalability, and maintainability, and has important application value in large-scale device management and complex network environments.
[0089] In some optional implementations, in order to further accurately extract multiple target addresses as needed, step S104 includes:
[0090] According to the second preset rule, the priority of each preset address in the preset address set is determined. According to the priority of each preset address, multiple target addresses are extracted from the preset address set to obtain the target address set.
[0091] Among them, the factors that determine the priority may include multiple factors, such as the importance of the hardware to be tested corresponding to the address, the address type, and the location of the address in the BMC. Therefore, the second preset rule may be to sort the priority of each preset address according to the importance of the hardware to be tested corresponding to each preset address. It may also be to lower the priority of the backup address and the redundant address. It may also be to sort the priority of each preset address according to the location of each preset address in the BMC. Among them, multiple preset addresses with higher priority rankings may be extracted as target addresses.
[0092] The hardware monitoring method based on the Redfish interface in this embodiment improves the accuracy and efficiency of address screening and optimizes resource allocation and scheduling by filtering addresses in a preset address set based on priority, and supports large-scale data processing, and improves the responsiveness and scalability of the system. Ultimately, the system can more efficiently extract and manage target addresses, improving the intelligence and automation level of the overall system.
[0093] In some optional implementations, in order to further accurately extract monitoring parameters of each hardware to be tested as needed, step S106 includes:
[0094] According to the third preset keyword, the parameter identifiers of the hardware to be tested of the target server are searched from the second texts in the second text set. According to the parameter identifiers of the hardware to be tested, the monitoring parameters of the hardware to be tested are parsed.
[0095] Among them, the "MemorySummary.Status.HealthRollup" keyword of the memory sub-address can be used to obtain the overall health status of the memory; the "Name", "CapacityBytes", "Model", "SerialNumber", "SlotNumber", "Status.Health" keywords of the hard disk sub-address can be used to obtain the name, capacity, model, serial number, slot number information, and health status; the PCIe (Peripheral Component Interconnect Express) card sub-address, such as the RAID card (Redundant Array of Independent Disks), uses the "Name", "Description", "Status.Health" keywords to obtain the name, description, and health status. For the power module part, use the "PowerConsumedWatts", "Name", "Status.Health" keywords to obtain the power consumption, module name, and monitoring status. For the temperature part, use the "Name" and "Status.Health" in "Fans" to obtain the fan name and monitoring status. In "Temperatures", extract the "ReadingCelsius" with "Name" of "Inlet Temp" or "inAir Temp" to read the inlet temperature, and extract the "ReadingCelsius" with "Name" of "Outlet Temp" or "outAir Temp" to read the outlet temperature.
[0096] Among them, in each text in the second text set, by searching the third preset keyword, the system can locate the part containing the monitoring information of the hardware to be tested. After finding the parameter identifier of the hardware to be tested, the value or state corresponding to each identifier is analyzed to obtain the specific monitoring parameters of the hardware.
[0097] The hardware monitoring method based on the Redfish interface in this embodiment can improve the accuracy and efficiency of data extraction by searching and parsing the monitoring parameters of the hardware to be tested in the second text set. This can not only optimize resource utilization and improve the accuracy and integrity of system monitoring, but also support the efficient operation of the system when facing scale expansion, while enhancing fault diagnosis and early warning capabilities, providing strong technical support for large-scale equipment management and complex system environments.
[0098] Furthermore, the monitoring parameters can be sorted out, and after adding the identification information of the target server, the health status, power consumption, temperature, etc. can be used as monitoring values, and the other parts can be used as monitoring items to generate monitoring results and send them to Promehteus (an open source monitoring system), so that the hardware under test of the target server can be effectively monitored. See Table 1 for details, which shows a simple schematic diagram of the monitoring parameters of the hardware under test.
[0099] Table 1
[0100] Monitoring item content result Remark Overall health status {device model, device serial number} Monitoring / Fault Memory Monitoring / Fault Hard disk {hard disk number, hard disk model, hard disk serial number, slot location} Monitoring / Fault Multiple hard disks, multiple indicators PCIe card {device name (network card, RAID card, etc.), description information} Monitoring / Fault Multiple cards, multiple indicators Power supply {module 1 / 2} Monitoring / Fault Multiple power modules Power {power consumption} Numeric Temperature {Fan} Monitoring / Fault Temperature {inlet / outlet} Numeric 2 indicators for entry and exit
[0101] Figure 2 Flowchart 2 of a hardware monitoring method based on a Redfish interface according to an embodiment of the present invention, the method comprising:
[0102] The monitoring end establishes a session with the target server, that is, a communication connection. The monitoring end can also establish other concurrent sessions with other servers. The overall status of the chassis is parsed from the chassis root address and returned to the monitoring system, and the address of the hardware to be tested is obtained using the first preset keyword. The overall status of the system is parsed from the system root address and returned to the monitoring system, and the address of the hardware to be tested is obtained using the first preset keyword. After integrating and removing duplicates from the two sets of addresses, request the integrated addresses one by one, and parse the required monitoring data according to the defined strategy. The spliced data forms the indicator name and monitoring value required by the monitoring system, and sends it to the monitoring system.
[0103] The present invention also provides a hardware monitoring device based on the Redfish interface, which is applied to a monitoring terminal. Figure 3 is a schematic diagram of a hardware monitoring device based on a Redfish interface according to an embodiment of the present invention, the device comprising:
[0104] The first acquisition module 301 is used to acquire the Redfish interface of the baseboard management controller of the target server and establish a communication connection with the Redfish interface.
[0105] The second acquisition module 302 is used to acquire the first text in the target root address of the Redfish interface through the communication connection.
[0106] The search module 303 is used to search the preset address corresponding to each hardware under test in the hardware under test set from the first text according to the first preset keyword, and obtain the preset address set corresponding to the hardware under test set.
[0107] The determination module 304 is configured to determine a target address set based on each preset address in the preset address set.
[0108] The third acquisition module 305 is used to respectively acquire the second text of each target address in the target address set to obtain a second text set.
[0109] The parsing module 306 is used to parse the monitoring parameters of each hardware to be tested from each second text in the second text set.
[0110] The hardware monitoring device based on the Redfish interface provided by the present invention has the following advantages:
[0111] By establishing a connection with the Redfish interface, the monitoring data of hardware devices can be obtained in batches, avoiding the tedious process of manual acquisition and management. Through the automatic matching of the first preset keyword and the preset address set, the second text of each target address can be automatically obtained and the monitoring parameters of different hardware to be tested can be parsed from each text, ensuring that the monitoring data of the hardware to be tested is comprehensively and accurately extracted, providing strong support for system operation and maintenance and troubleshooting. This method can adapt to different servers. The main reason is that as long as the server supports the Redfish protocol, the hardware parameters stored in different sub-addresses can be uniformly accessed through the target root address, thereby achieving compatibility of this method with diverse and complex hardware environments. In summary, this method optimizes the efficiency of hardware monitoring and improves the stability and maintainability of the system through automatic and accurate data acquisition and processing.
[0112] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0113] The hardware monitoring device based on the Redfish interface in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0114] The embodiment of the present invention also provides a computer device having the above Figure 3 The hardware monitoring device based on the Redfish interface is shown.
[0115] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.
[0116] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include an integrated circuit. The integrated circuit may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0117] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0118] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0119] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0120] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.
[0121] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0122] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0123] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0124] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0125] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A hardware monitoring method based on Redfish interface, characterized in that: The method is applied to a monitoring end, and the method comprises: Obtaining a Redfish interface of a baseboard management controller of a target server, and establishing a communication connection with the Redfish interface; Obtaining, through the communication connection, a first text in a target root address of the Redfish interface; According to the first preset keyword, searching the first text for a preset address corresponding to each hardware to be tested in the hardware set to be tested, to obtain a preset address set corresponding to the hardware set to be tested; Determining a target address set based on each preset address in the preset address set; Respectively obtain the second text of each target address in the target address set to obtain a second text set; The monitoring parameters of each piece of hardware to be tested are respectively parsed from each second text in the second text set.
2. The method according to claim 1, characterized in that The method further comprises: According to a second preset keyword, searching the first text for an overall status identifier of the target server; According to the overall status identifier, overall status information of the target server is determined, where the overall status information indicates an overall health status of the target server.
3. The method according to claim 1, characterized in that The target root address includes: a chassis root address and a system root address; The determining of the target address set based on each preset address in the preset address set includes: Comparing each of the preset addresses in the first sub-address set and the second sub-address set to obtain a comparison result, wherein the first sub-address set is a sub-address set of the chassis root address in the preset address set; and the second sub-address set is a sub-address set of the system root address in the preset address set; From the preset address set, duplicate preset addresses indicated by the comparison result are removed to obtain a target address set.
4. The method according to claim 3, characterized in that The comparing each of the preset addresses in the first sub-address set and the second sub-address set to obtain a comparison result includes: Comparing whether each of the preset addresses in the first sub-address set and the second sub-address set corresponds to the same hardware to be tested at the same time, and obtaining a comparison result; The step of removing duplicate preset addresses indicated by the comparison result from the preset address set to obtain a target address set includes: If the comparison result corresponds to the same hardware under test at the same time, then according to the first preset rule, the preset address corresponding to the same hardware under test in the first sub-address set or the second sub-address set is deleted from the preset address set to obtain the target address set.
5. The method according to claim 3, characterized in that: Determining a target address set based on each preset address in the preset address set includes: Determining the priority of each preset address in the preset address set according to a second preset rule; According to the priorities of the preset addresses, multiple target addresses are extracted from the preset address set to obtain the target address set.
6. The method according to claim 5, characterized in that Parsing the monitoring parameters of each hardware to be tested from each second text in the second text set respectively includes: According to a third preset keyword, searching for parameter identifiers of each hardware to be tested of the target server from each second text in the second text set; According to the parameter identifiers of the hardware to be tested, the monitoring parameters of the hardware to be tested are parsed.
7. A hardware monitoring device based on Redfish interface, characterized in that: The device is applied to a monitoring end, and comprises: A first acquisition module is used to acquire a Redfish interface of a baseboard management controller of a target server and establish a communication connection with the Redfish interface; A second acquisition module is used to acquire the first text in the target root address of the Redfish interface through the communication connection; A search module, configured to search the first text for a preset address corresponding to each hardware to be tested in the hardware set to be tested according to a first preset keyword, and obtain a preset address set corresponding to the hardware set to be tested; A determination module, configured to determine a target address set based on each preset address in the preset address set; A third acquisition module is used to respectively acquire the second text of each target address in the target address set to obtain a second text set; The parsing module is used to parse out the monitoring parameters of each hardware to be tested from each second text in the second text set.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the hardware monitoring method based on the Redfish interface according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the hardware monitoring method based on the Redfish interface according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the hardware monitoring method based on the Redfish interface according to any one of claims 1 to 6.
Citation Information
Cited By
Server hardware management method, system, equipment and medium
CN120872699A
Monitoring method and system based on Redfish protocol, electronic equipment and storage medium
CN122152644A