CN116192807A - BMC IP acquisition method, device, equipment and storage medium - Google Patents
BMC IP acquisition method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN116192807A CN116192807A CN202310199272.8A CN202310199272A CN116192807A CN 116192807 A CN116192807 A CN 116192807A CN 202310199272 A CN202310199272 A CN 202310199272A CN 116192807 A CN116192807 A CN 116192807A
- Authority
- CN
- China
- Prior art keywords
- address
- test
- address pool
- bmc
- target
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000012360 testing method Methods 0.000 claims abstract description 240
- 238000004891 communication Methods 0.000 claims abstract description 49
- 238000004590 computer program Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000004888 barrier function Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Computer And Data Communications (AREA)
- Small-Scale Networks (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The disclosure provides a BMC IP acquisition method, device, equipment and storage medium, and relates to the technical field of computers. The method mainly comprises the following steps: under the condition that the baseboard management controller BMC is connected with the current network segment, carrying out communication test on an Internet Protocol (IP) address in the current network segment to obtain a first test result, and determining an IP address which represents successful communication in the first test result as a first address pool; under the condition that the BMC is disconnected from the current network segment, carrying out a connection test on the IP address in the current network segment to obtain a second test result, and determining the IP address which represents successful connection in the second test result as a second address pool; performing difference comparison on the first address pool and the second address pool to obtain a target address pool, wherein the target address pool comprises different IP addresses in the first address pool and the second address pool; and determining the target IP address of the BMC according to the target address pool.
Description
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a BMC IP acquisition method, device, equipment and storage medium.
Background
The baseboard management controller (BMC, baseboard Manager Controller) is used to manage the server, and the server system log can be checked by the BMC, and access to the BMC needs to obtain the internet protocol (IP, internet Protocol) address of the BMC, but in some abnormal situations, such as no usable display, or abnormal server, even if the display is accessed, the operating system and the basic input output system (BIOS, basic Input Output System) cannot be accessed to obtain the BMC IP of the server.
Aiming at the problem that BMC IP is difficult to acquire under abnormal conditions, the prior art mainly comprises the following two solutions:
firstly, a BMC serial port line is used for obtaining BMC IP, namely the BMC serial port line is connected into the BMC serial port, the BMC serial port line directly enters a BMC self system through a user name and a password, and the BMC IP is directly read by an ifconfig command, but the BMC serial port line is required to be prepared in the mode;
secondly, acquiring the BMC IP according to the media access control (MAC, media Access Control) address, namely checking the MAC address on the BMC mainboard, entering a dynamic host configuration protocol (DHCP, dynamic Host Configuration Protocol) server, checking the IP allocated by the corresponding MAC address, or analyzing the corresponding relation between the MAC address and the IP in the network segment through software, so as to acquire the BMC IP, wherein the case needs to be opened in the mode to check the MAC address on the mainboard, the MAC address on the mainboard may not be consistent with the real MAC address of the BMC, and in addition, the login of the DHCP server may have a barrier.
Disclosure of Invention
The disclosure provides a BMC IP acquisition method, device, equipment and storage medium, so as to at least solve the technical problems in the prior art.
According to a first aspect of the present disclosure, there is provided a BMC IP acquisition method, including: under the condition that the baseboard management controller BMC is connected with the current network segment, carrying out communication test on an Internet Protocol (IP) address in the current network segment to obtain a first test result, and determining an IP address which represents successful communication in the first test result as a first address pool; under the condition that the BMC is disconnected from the current network segment, carrying out a connection test on the IP address in the current network segment to obtain a second test result, and determining the IP address which represents successful connection in the second test result as a second address pool; performing difference comparison on the first address pool and the second address pool to obtain a target address pool, wherein the target address pool comprises different IP addresses in the first address pool and the second address pool; and determining the target IP address of the BMC according to the target address pool.
In an embodiment, the performing the connectivity test on the IP address in the current network segment includes: and carrying out connectivity test on the IP address in the current network segment through an nbtsacn command or a ping command.
In an embodiment, the performing the difference comparison on the first address pool and the second address pool to obtain a target address pool includes: generating a first file according to a first IP address in the first address pool; generating a second file according to a second IP address in the second address pool; and performing difference comparison on the first file and the second file according to the file comparison command to obtain the target address pool.
In an embodiment, the performing the difference comparison on the first address pool and the second address pool to obtain a target address pool includes: performing difference comparison on the first address pool and the second address pool to obtain an initial address pool; judging whether the number of the IP addresses in the initial address pool meets a preset threshold value or not to obtain a judging result; the judgment result is that the initial address pool is determined to be the target address pool; and if the judgment result is negative, carrying out communication test on the IP address in the current network segment again under the condition that the BMC is disconnected from the current network segment to obtain a third test result, determining the IP address which is indicated to be successfully communicated in the third test result as a third address pool, and carrying out difference comparison on the first address pool and the third address pool until the judgment result is positive.
In an embodiment, the determining, according to the target address pool, the target IP address of the BMC includes: under the condition that the BMC is connected with the current network segment, carrying out a connection test on a test IP address to obtain a fourth test result, wherein the test IP address is the IP address in the target address pool; the fourth test result represents that the connection of the test IP address is successful, and if the BMC is disconnected from the current network segment, the connection test is carried out on the test IP address to obtain a fifth test result, and the target IP address is determined according to the fifth test result; and if the fourth test result indicates that the communication of the test IP address fails, determining other IP addresses in the target address pool as test IP addresses, and performing communication test on the test IP addresses under the condition that the BMC is connected with the current network segment until the fourth test result indicates that the communication of the test IP addresses is successful.
In an embodiment, the determining the target IP address according to the fifth test result includes: the fifth test result represents that the communication of the test IP address fails, and the test IP address is determined to be the target IP address; and if the fifth test result indicates that the communication of the test IP address is successful, determining other IP addresses in the target address pool as test IP addresses, and performing communication test on the test IP addresses under the condition that the BMC is connected with the current network segment until the fifth test result indicates that the communication of the test IP addresses fails.
In an embodiment, the method further comprises: and sending a lighting instruction to the BMC according to the target IP address, and determining the target IP address as the correct IP address of the BMC when the BMC lights a positioning lamp according to the lighting instruction.
According to a second aspect of the present disclosure, there is provided a BMC IP obtaining apparatus, which is characterized in that the apparatus includes: the first test module is used for carrying out a connection test on an Internet Protocol (IP) address in a current network segment under the condition that the Baseboard Management Controller (BMC) is connected with the current network segment to obtain a first test result, and determining an IP address which represents successful connection in the first test result as a first address pool; the second test module is used for carrying out communication test on the IP address in the current network segment under the condition that the BMC is disconnected with the current network segment to obtain a second test result, and determining the IP address which represents successful communication in the second test result as a second address pool; the comparison module is used for performing difference comparison on the first address pool and the second address pool to obtain a target address pool, wherein the target address pool comprises different IP addresses in the first address pool and the second address pool; and the determining module is used for determining the target IP address of the BMC according to the target address pool.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described in the present disclosure.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of the present disclosure.
According to the BMC IP acquisition method, device, equipment and storage medium, under the condition that a baseboard management controller BMC is connected with a current network segment, a communication test is conducted on an Internet protocol IP address in the current network segment to obtain a first test result, and an IP address which indicates successful communication in the first test result is determined to be a first address pool; under the condition that the BMC is disconnected from the current network segment, carrying out a connection test on the IP address in the current network segment to obtain a second test result, and determining the IP address which represents successful connection in the second test result as a second address pool; performing difference comparison on the first address pool and the second address pool to obtain a target address pool, wherein the target address pool comprises different IP addresses in the first address pool and the second address pool; and determining the target IP address of the BMC according to the target address pool. Therefore, the target IP address of the BMC is included in the first address pool obtained under the condition that the BMC is connected with the current network segment, the target IP address of the BMC is not included in the second address pool obtained under the condition that the BMC is disconnected with the current network segment, different IP addresses in the first address pool and the second address pool are used as the target address pool, namely the target IP address of the BMC is included in the target address pool, and therefore the target IP address of the BMC can be finally determined according to the target address pool, and therefore when the target IP address of the BMC is obtained, a BMC serial port line does not need to be prepared, and a case does not need to be opened to check the MAC address on the main board and log in a DHCP server.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The above, as well as additional purposes, features, and advantages of exemplary embodiments of the present disclosure will become readily apparent from the following detailed description when read in conjunction with the accompanying drawings. Several embodiments of the present disclosure are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings, in which:
in the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Fig. 1 shows a flowchart of a BMC IP obtaining method according to a first embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a BMC IP obtaining method according to a fourth embodiment of the disclosure;
fig. 3 is a schematic structural diagram of a BMC IP obtaining device according to a sixth embodiment of the disclosure;
fig. 4 shows a schematic diagram of a composition structure of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order to make the objects, features and advantages of the present disclosure more comprehensible, the technical solutions in the embodiments of the present disclosure will be clearly described in conjunction with the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, but not all embodiments. Based on the embodiments in this disclosure, all other embodiments that a person skilled in the art would obtain without making any inventive effort are within the scope of protection of this disclosure.
Fig. 1 shows a flow chart of a BMC IP obtaining method according to a first embodiment of the present disclosure, as shown in fig. 1, where the method mainly includes:
step S101, under the condition that the baseboard management controller BMC is connected with the current network segment, the communication test is carried out on the IP address of the Internet protocol in the current network segment, a first test result is obtained, and the IP address which indicates successful communication in the first test result is determined as a first address pool.
In this embodiment, first, a connectivity test is performed on an internet protocol (IP, internet Protocol) address in a current network segment under the condition that a baseboard management controller BMC can work normally and is connected with the current network segment, so as to obtain a first test result, and an IP address indicating successful connectivity in the first test result is determined as a first address pool, where if the BMC is connected with a network cable, the BMC is considered to be connected with the current network segment. Specifically, the plurality of IP addresses in the current network segment include the target IP address of the BMC, and since the BMC is connected to the current network segment, the target IP address is capable of being connected when the connectivity test is performed, and the IP address indicating successful connectivity in the plurality of first test results is determined as the first address pool, and the first address pool naturally includes the target IP address of the BMC.
In an implementation manner, an IP address in a current network segment may be subjected to a connectivity test by an nbtsacn command or a ping command, where, when the nbtsacn command performs the connectivity test, a NetBIOS (basic input output system on network) status query is sent to each IP address in the current network segment, and for each IP address responding to the NetBIOS status query, the nbtsacn command lists the corresponding IP address, netBIOS computer name, login user name, MAC address, and so on; when the ping command carries out the connection test, a test data packet is sent to each IP address in the current network segment, response data of the IP address for the test data packet is received, and the response time is counted, so that whether the IP addresses are connected or not is tested.
And step S102, under the condition that the BMC is disconnected from the current network segment, carrying out a connection test on the IP address in the current network segment to obtain a second test result, and determining the IP address which represents successful connection in the second test result as a second address pool.
In this embodiment, a connection test is further required to be performed on the IP address in the current network segment under the condition that the BMC is disconnected from the current network segment, so as to obtain a second test result, and an IP address that indicates that the connection is successful in the second test result is determined as a second address pool, where if the BMC is disconnected from the network cable, the BMC is considered to be disconnected from the current network segment. Specifically, although the plurality of IP addresses in the current network segment include the target IP address of the BMC, the BMC is disconnected from the current network segment, so that the target IP address cannot be connected when the connectivity test is performed, and if the IP address indicating successful connectivity in the plurality of second test results is determined as the second address pool, the second address pool does not include the target IP address of the BMC. Preferably, in step S102, the IP address in the current network segment may also be subjected to the connectivity test by an nbtsacn command or a ping command.
Step S103, performing difference comparison on the first address pool and the second address pool to obtain a target address pool, wherein the target address pool comprises different IP addresses in the first address pool and the second address pool.
Step S104, determining the target IP address of the BMC according to the target address pool.
In this embodiment, since the first address pool definitely includes the target IP address of the BMC and the second address pool definitely does not include the target IP address of the BMC, the difference between the first address pool and the second address pool is compared, and different IP addresses in the first address pool and the second address pool are determined as the target address pool, so that the target address pool definitely includes the target IP address of the BMC, and the target IP address of the BMC can be determined according to the target address pool.
In one embodiment, if there is only one IP address in the target address pool, the IP address may be determined to be the target IP address of the BMC; if there are multiple IP addresses in the target address pool, for each IP address in the target address pool, respectively performing a connectivity test on the IP address when the BMC is connected to the current network segment and when the BMC is disconnected from the current network segment, and if the IP address is successful in connectivity when the BMC is connected to the current network segment and fails in connectivity when the BMC is disconnected from the current network segment, determining the IP address as the target IP address of the BMC.
In the first embodiment of the present disclosure, the target IP address of the BMC is included in the first address pool obtained when the BMC is connected to the current network segment, the target IP address of the BMC is not included in the second address pool obtained when the BMC is disconnected from the current network segment, and the different IP addresses in the first address pool and the second address pool are used as the target address pools, that is, the target IP address of the BMC is included in the target address pools, so that the target IP address of the BMC can be finally determined according to the target address pools, thereby, when the target IP address of the BMC is obtained, no preparation of a serial port line of the BMC is required, and no opening of the chassis is required to check the MAC address on the motherboard and log in the DHCP server
In the second embodiment of the present disclosure, step S103 mainly includes:
generating a first file according to a first IP address in a first address pool; generating a second file according to a second IP address in the second address pool; and performing difference comparison on the first file and the second file according to the file comparison command to obtain a target address pool.
In this embodiment, when the difference comparison is performed between the first address pool and the second address pool, first, a first file including all the first IP addresses may be generated according to the first IP addresses in the first address pool, then, according to the second IP addresses in the second address pool, a second file including all the second IP addresses may be generated, finally, according to a file comparison command, the difference comparison is performed between the first file and the second file, and a target address pool is formed by different IP addresses in the first address pool and the second address pool.
In an embodiment, all the first IP addresses in the first address pool may be written into the file to obtain a first file, and the second IP addresses in the second address pool may be written into the file to obtain a second file.
In one embodiment, the file comparison command may be a vimdiff command or a grep command, where the vimdiff command may compare and highlight the differential portion of the first file and the second file; the grep command may compare the string data in the first file and the second file, and print out the strings having differences in the first file and the second file.
In the second embodiment of the disclosure, a first file is generated by a first IP address in a first address pool, a second file is generated by a second IP address in a second address pool, and the first file and the second file are subjected to difference comparison according to a file comparison command to obtain a target address pool, so that the efficiency of difference comparison of the first address pool and the second address pool can be improved.
In a third embodiment of the present disclosure, step S103 further includes:
performing difference comparison on the first address pool and the second address pool to obtain an initial address pool; judging whether the number of the IP addresses in the initial address pool meets a preset threshold value or not to obtain a judging result; the initial address pool is determined as a target address pool; if the judgment result is negative, carrying out communication test on the IP address in the current network segment under the condition that the BMC is disconnected from the current network segment again to obtain a third test result, determining the IP address which is indicated to be successfully communicated in the third test result as a third address pool, and carrying out difference comparison on the first address pool and the third address pool until the judgment result is positive.
In this embodiment, since there is only one target IP address of the BMC, in an ideal state, there should be only one IP address in the target address pool, but there may also be some interference factors when the BMC is connected to the current network segment, for example, when the BMC is connected to the current network segment, other devices are also connected to the current network segment, and when the BMC is disconnected from the current network segment, the other devices are just disconnected from the current network segment, so that when the IP address in the current network segment is connected to the test, the other devices may affect the number of IP addresses in the target address pool.
In this embodiment, in order to ensure that the number of IP addresses in the target address pool meets a preset threshold, firstly, performing difference comparison on the first address pool and the second address pool to obtain an initial address pool, then judging whether the number of IP addresses in the initial address pool meets the preset threshold, obtaining a judgment result, and if yes, determining the initial address pool as the target address pool; if the judgment result is negative, carrying out connection test on the IP address in the current network segment again under the condition that the BMC is disconnected from the current network segment to obtain a third test result, determining the IP address which is indicated to be successfully connected in the third test result as a third address pool, equivalently adjusting the IP address in the second address pool to obtain a third address pool, carrying out difference comparison on the first address pool and the third address pool until the judgment result is positive, and determining the corresponding initial address pool as a target address pool when the judgment result is positive. Specifically, the preset threshold may be set according to the actual situation, for example, the preset threshold may be 1 to 3.
In a third embodiment of the present disclosure, performing difference comparison on the first address pool and the second address pool to obtain an initial address pool, and judging whether the number of IP addresses in the initial address pool meets a preset threshold value, to obtain a judgment result, if so, determining the initial address pool as a target address pool; if the judgment result is negative, carrying out communication test on the IP address in the current network segment under the condition that the BMC is disconnected from the current network segment again to obtain a third test result, determining the IP address which is indicated to be successfully communicated in the third test result as a third address pool, and carrying out difference comparison on the first address pool and the third address pool until the judgment result is positive. Therefore, interference factors can be eliminated, the number of the IP addresses in the target address pool can meet a preset threshold, and the target IP address of the BMC can be conveniently and subsequently determined according to the target address pool.
Fig. 2 shows a flowchart of a BMC IP obtaining method according to a fourth embodiment of the present disclosure, as shown in fig. 2, step S104 mainly includes:
step S201, under the condition that the BMC is connected with the current network segment, the communication test is carried out on the test IP address, and a fourth test result is obtained. Wherein the test IP address is an IP address in the target address pool.
Step S202, the fourth test result represents that the connection of the test IP address is successful, and the connection test is carried out on the test IP address under the condition that the BMC is disconnected from the current network segment, so that a fifth test result is obtained.
In step S203, if the fifth test result indicates that the connection of the test IP address fails, the test IP address is determined as the target IP address.
And step S204, determining other IP addresses in the target address pool as test IP addresses if the fifth test result indicates that the test IP address is successfully communicated, and carrying out communication test on the test IP addresses under the condition that the BMC is connected with the current network segment until the fifth test result indicates that the test IP address is failed to be communicated.
Step S205, the fourth test result represents that the connection of the test IP address fails, other IP addresses in the target address pool are determined to be the test IP addresses, and the connection test is carried out on the test IP addresses under the condition that the BMC is connected with the current network segment until the fourth test result represents that the connection of the test IP address is successful.
In this embodiment, firstly, an IP address is selected from a target address pool as a test IP address, then, under the condition that the BMC is connected with a current network segment, a connection test is performed on the test IP address to obtain a fourth test result, if the fourth test result indicates that the connection of the test IP address is successful, under the condition that the BMC is disconnected with the current network segment, a connection test is performed on the test IP address to obtain a fifth test result, and the target IP address is determined according to the fifth test result; if the fourth test result indicates that the communication of the test IP address fails, determining other IP addresses in the target address pool as the test IP address, and carrying out the communication test on the test IP address again under the condition that the BMC is connected with the current network segment until the fourth test result indicates that the communication of the test IP address is successful.
In this embodiment, when the target IP address is determined according to the fifth test result, if the fifth test result indicates that the connection of the test IP address fails, it is proved that the test IP address can be connected when the BMC is connected to the current network segment, and cannot be connected when the BMC is disconnected from the current network segment, then the test IP address can be determined as the target IP address; if the fifth test result indicates that the connection of the test IP address is successful, and the test IP address is proved to be irrelevant to the network segment connection state of the BMC, and is not the target IP address, other IP addresses in the target address pool are determined to be the test IP addresses, and the connection test is conducted on the test IP addresses again under the condition that the BMC is connected with the current network segment until the fifth test result indicates that the connection of the test IP address fails.
In a fourth embodiment of the present disclosure, for each IP address in the target address pool, if the IP address is successfully connected in the case that the BMC is connected to the current network segment, and the IP address is failed in the case that the BMC is disconnected from the current network segment, the IP address is determined as the target IP address of the BMC, so that an accurate target IP address can be obtained from the target address pool.
In a fifth embodiment of the present disclosure, a BMC IP obtaining method further includes:
and sending a lighting command to the BMC according to the target IP address, and determining the target IP address as the correct IP address of the BMC when the BMC lights the positioning lamp according to the lighting command.
In this embodiment, after the target IP address of the BMC is obtained, a lighting instruction may be sent to the target IP address, and if the BMC lights its own positioning lamp according to the lighting instruction, the target IP address may be determined to be the correct IP address of the BMC, so that the target IP address of the BMC may be further verified, and it is ensured that the correct IP address is obtained.
Fig. 3 shows a schematic structural diagram of a BMC IP obtaining device according to a sixth embodiment of the disclosure, and as shown in fig. 3, the device mainly includes:
the first test module 10 is configured to perform a connectivity test on an IP address of an internet protocol in a current network segment under the condition that the baseboard management controller BMC is connected to the current network segment, obtain a first test result, and determine an IP address that indicates successful connectivity in the first test result as a first address pool; the second test module 11 is configured to perform a connectivity test on an IP address in the current network segment under the condition that the BMC is disconnected from the current network segment, obtain a second test result, and determine an IP address that indicates successful connectivity in the second test result as a second address pool; a comparison module 12, configured to perform differential comparison on the first address pool and the second address pool to obtain a target address pool, where the target address pool includes different IP addresses in the first address pool and the second address pool; the determining module 13 is configured to determine, according to the target address pool, a target IP address of the BMC.
In an embodiment, the first test module 10 and the second test module 11 are further configured to perform connectivity test on the IP address in the current network segment through an nbtsacn command or a ping command.
In one embodiment, the contrast module 12 includes: the first generation sub-module is used for generating a first file according to a first IP address in the first address pool; the second generating sub-module is used for generating a second file according to a second IP address in the second address pool; and the first comparison sub-module is used for performing difference comparison on the first file and the second file according to the file comparison command to obtain a target address pool.
In one embodiment, the contrast module 12 includes: the second comparison sub-module is used for performing difference comparison on the first address pool and the second address pool to obtain an initial address pool; the judging sub-module is used for judging whether the number of the IP addresses in the initial address pool meets a preset threshold value or not to obtain a judging result; the first determining submodule is used for determining the initial address pool as a target address pool if the judgment result is yes; and the second determining submodule is used for determining whether the result is negative, carrying out communication test on the IP address in the current network segment again under the condition that the BMC is disconnected from the current network segment to obtain a third test result, determining the IP address which is successfully communicated in the third test result as a third address pool, and carrying out difference comparison on the first address pool and the third address pool until the result is positive.
In one embodiment, the determining module 13 includes: the first testing sub-module is used for carrying out a communication test on the test IP address under the condition that the BMC is connected with the current network segment to obtain a fourth test result, wherein the test IP address is the IP address in the target address pool; the second testing sub-module is used for representing that the connection of the test IP address is successful according to the fourth testing result, and carrying out connection test on the test IP address under the condition that the BMC is disconnected from the current network segment to obtain a fifth testing result, and determining a target IP address according to the fifth testing result; and the third test sub-module is used for determining other IP addresses in the target address pool as test IP addresses when the fourth test result indicates that the test IP address is successfully communicated, and carrying out communication test on the test IP addresses until the fourth test result indicates that the test IP address is successfully communicated under the condition that the BMC is connected with the current network segment.
In an embodiment, the second test sub-module is further configured to: the fifth test result represents that the connection of the test IP address fails, and the test IP address is determined to be a target IP address; and determining other IP addresses in the target address pool as test IP addresses if the fifth test result indicates that the test IP address is successfully communicated, and performing a communication test on the test IP addresses under the condition that the BMC is connected with the current network segment until the fifth test result indicates that the test IP address is failed to be communicated.
In one embodiment, the apparatus further comprises: the sending module is used for sending a lighting instruction to the BMC according to the target IP address; and the second determining module is used for determining the target IP address as the correct IP address of the BMC under the condition that the BMC lights the positioning lamp according to the lighting instruction.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
Fig. 4 illustrates a schematic block diagram of an example electronic device 400 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 4, the apparatus 400 includes a computing unit 401 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 408 into a Random Access Memory (RAM) 403. In RAM 403, various programs and data required for the operation of device 400 may also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
Various components in device 400 are connected to I/O interface 405, including: an input unit 406 such as a keyboard, a mouse, etc.; an output unit 407 such as various types of displays, speakers, and the like; a storage unit 408, such as a magnetic disk, optical disk, etc.; and a communication unit 409 such as a network card, modem, wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 401 may be a variety of general purpose and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as a BMC IP acquisition method. For example, in some embodiments, a BMC IP acquisition method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 408. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 400 via the ROM 402 and/or the communication unit 409. When the computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of one BMC IP acquisition method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform a BMC IP acquisition method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present disclosure, the meaning of "a plurality" is two or more, unless explicitly defined otherwise.
The foregoing is merely specific embodiments of the disclosure, but the protection scope of the disclosure is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the disclosure, and it is intended to cover the scope of the disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
Claims (10)
1. A BMC IP acquisition method, the method comprising:
under the condition that the baseboard management controller BMC is connected with the current network segment, carrying out communication test on an Internet Protocol (IP) address in the current network segment to obtain a first test result, and determining an IP address which represents successful communication in the first test result as a first address pool;
under the condition that the BMC is disconnected from the current network segment, carrying out a connection test on the IP address in the current network segment to obtain a second test result, and determining the IP address which represents successful connection in the second test result as a second address pool;
performing difference comparison on the first address pool and the second address pool to obtain a target address pool, wherein the target address pool comprises different IP addresses in the first address pool and the second address pool;
and determining the target IP address of the BMC according to the target address pool.
2. The method of claim 1, wherein said performing connectivity testing on IP addresses within the current network segment comprises:
and carrying out connectivity test on the IP address in the current network segment through an nbtsacn command or a ping command.
3. The method of claim 1, wherein said performing a differential comparison of the first address pool and the second address pool to obtain a target address pool comprises:
generating a first file according to a first IP address in the first address pool;
generating a second file according to a second IP address in the second address pool;
and performing difference comparison on the first file and the second file according to the file comparison command to obtain the target address pool.
4. The method of claim 1, wherein said performing a differential comparison of the first address pool and the second address pool to obtain a target address pool comprises:
performing difference comparison on the first address pool and the second address pool to obtain an initial address pool;
judging whether the number of the IP addresses in the initial address pool meets a preset threshold value or not to obtain a judging result;
the judgment result is that the initial address pool is determined to be the target address pool;
and if the judgment result is negative, carrying out communication test on the IP address in the current network segment again under the condition that the BMC is disconnected from the current network segment to obtain a third test result, determining the IP address which is indicated to be successfully communicated in the third test result as a third address pool, and carrying out difference comparison on the first address pool and the third address pool until the judgment result is positive.
5. The method of claim 1, wherein determining the target IP address of the BMC from the target address pool comprises:
under the condition that the BMC is connected with the current network segment, carrying out a connection test on a test IP address to obtain a fourth test result, wherein the test IP address is the IP address in the target address pool;
the fourth test result represents that the connection of the test IP address is successful, and if the BMC is disconnected from the current network segment, the connection test is carried out on the test IP address to obtain a fifth test result, and the target IP address is determined according to the fifth test result;
and if the fourth test result indicates that the communication of the test IP address fails, determining other IP addresses in the target address pool as test IP addresses, and performing communication test on the test IP addresses under the condition that the BMC is connected with the current network segment until the fourth test result indicates that the communication of the test IP addresses is successful.
6. The method of claim 5, wherein said determining said target IP address based on said fifth test result comprises:
the fifth test result represents that the communication of the test IP address fails, and the test IP address is determined to be the target IP address;
and if the fifth test result indicates that the communication of the test IP address is successful, determining other IP addresses in the target address pool as test IP addresses, and performing communication test on the test IP addresses under the condition that the BMC is connected with the current network segment until the fifth test result indicates that the communication of the test IP addresses fails.
7. The method according to any one of claims 1 to 6, further comprising:
and sending a lighting instruction to the BMC according to the target IP address, and determining the target IP address as the correct IP address of the BMC when the BMC lights a positioning lamp according to the lighting instruction.
8. A BMC IP acquisition apparatus, the apparatus comprising:
the first test module is used for carrying out a connection test on an Internet Protocol (IP) address in a current network segment under the condition that the Baseboard Management Controller (BMC) is connected with the current network segment to obtain a first test result, and determining an IP address which represents successful connection in the first test result as a first address pool;
the second test module is used for carrying out communication test on the IP address in the current network segment under the condition that the BMC is disconnected with the current network segment to obtain a second test result, and determining the IP address which represents successful communication in the second test result as a second address pool;
the comparison module is used for performing difference comparison on the first address pool and the second address pool to obtain a target address pool, wherein the target address pool comprises different IP addresses in the first address pool and the second address pool;
and the determining module is used for determining the target IP address of the BMC according to the target address pool.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310199272.8A CN116192807A (en) | 2023-02-28 | 2023-02-28 | BMC IP acquisition method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310199272.8A CN116192807A (en) | 2023-02-28 | 2023-02-28 | BMC IP acquisition method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116192807A true CN116192807A (en) | 2023-05-30 |
Family
ID=86440325
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310199272.8A Pending CN116192807A (en) | 2023-02-28 | 2023-02-28 | BMC IP acquisition method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116192807A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105141449A (en) * | 2015-07-28 | 2015-12-09 | 中标软件有限公司 | Addition method and device for monitoring configuration |
CN107277193A (en) * | 2017-08-09 | 2017-10-20 | 郑州云海信息技术有限公司 | A kind of baseboard management controller address management method, device and system |
CN108228834A (en) * | 2018-01-04 | 2018-06-29 | 北京奇艺世纪科技有限公司 | The inquiry and storage method of Internet protocol address, device and electronic equipment |
-
2023
- 2023-02-28 CN CN202310199272.8A patent/CN116192807A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105141449A (en) * | 2015-07-28 | 2015-12-09 | 中标软件有限公司 | Addition method and device for monitoring configuration |
CN107277193A (en) * | 2017-08-09 | 2017-10-20 | 郑州云海信息技术有限公司 | A kind of baseboard management controller address management method, device and system |
CN108228834A (en) * | 2018-01-04 | 2018-06-29 | 北京奇艺世纪科技有限公司 | The inquiry and storage method of Internet protocol address, device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11044230B2 (en) | Dynamically opening ports for trusted application processes hosted in containers | |
CN112953938B (en) | Network attack defense method, device, electronic equipment and readable storage medium | |
CN115794257B (en) | System starting method, device, electronic equipment and storage medium | |
CN113766487B (en) | Cloud mobile phone information acquisition method, device, equipment and medium | |
CN111506473A (en) | Server monitoring system and server monitoring method | |
CN114389969A (en) | Client test method and device, electronic equipment and storage medium | |
CN117520195A (en) | Method, apparatus, device, storage medium and program product for testing interface | |
CN116192807A (en) | BMC IP acquisition method, device, equipment and storage medium | |
CN107704263B (en) | Database management method and device in cloud environment | |
US20220334744A1 (en) | Method, electronic device, and computer program product for processing data | |
CN116841850B (en) | Test method, test device, electronic equipment and storage medium | |
CN117520080B (en) | Server testing method, device, equipment and medium | |
CN117499161B (en) | Network security testing method and device, electronic equipment and storage medium | |
CN116304399B (en) | Visual processing method, device and system for test cases | |
CN117056150B (en) | Network attached storage detection method, device, equipment and storage medium | |
CN116886452B (en) | Method and system for judging host computer collapse | |
CN114647578B (en) | System testing method, device, equipment and storage medium | |
CN113596129B (en) | Restarting method, restarting device, restarting equipment and restarting storage medium of cloud mobile phone | |
CN115237695A (en) | Method, device, equipment and medium for detecting state of mainboard interface | |
CN116708362A (en) | Communication address processing method, device, equipment and storage medium | |
CN118503944A (en) | Authentication method, device, equipment and storage medium | |
CN117827312A (en) | Control method, device, equipment and storage medium | |
CN117729005A (en) | Network asset mapping method | |
CN116991737A (en) | Software testing method, system, electronic equipment and storage medium | |
CN118839344A (en) | Remote proving method, device, system, electronic equipment and storage 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 |