CN113709210A - Device discovery method, device, system, electronic device and storage medium - Google Patents

Device discovery method, device, system, electronic device and storage medium Download PDF

Info

Publication number
CN113709210A
CN113709210A CN202110873071.2A CN202110873071A CN113709210A CN 113709210 A CN113709210 A CN 113709210A CN 202110873071 A CN202110873071 A CN 202110873071A CN 113709210 A CN113709210 A CN 113709210A
Authority
CN
China
Prior art keywords
information
equipment
scanned
port
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110873071.2A
Other languages
Chinese (zh)
Inventor
胡汉顶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202110873071.2A priority Critical patent/CN113709210A/en
Publication of CN113709210A publication Critical patent/CN113709210A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/163In-band adaptation of TCP data exchange; In-band control procedures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/164Adaptation or special uses of UDP protocol

Abstract

The invention provides a device discovery method, a device discovery system, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: acquiring an IP address of equipment to be scanned; carrying out port scanning on the IP address, and determining a port used by equipment to be scanned; acquiring equipment information from equipment to be scanned by using a general interface of a port corresponding to a communication protocol and default configuration information of the communication protocol; updating the equipment information to a database; the invention can scan the port through the IP address of the equipment to be scanned, and simultaneously determine whether the equipment is on-line and the port used by the equipment; because the corresponding relation exists between the port and the communication protocol, the communication protocol supported by the equipment can be determined according to the port used by the equipment to be scanned, and then the equipment information capable of identifying the equipment is acquired from the equipment to be scanned by utilizing the universal interface and the default configuration information of the communication protocol, so that the automatic discovery and identification of the equipment to be scanned are finally realized, the operation and maintenance efficiency is effectively improved, and the operation and maintenance cost is reduced.

Description

Device discovery method, device, system, electronic device and storage medium
Technical Field
The present invention relates to the field of servers, and in particular, to a device discovery method, apparatus, system, electronic device, and storage medium.
Background
With the development of network technologies such as internet, cloud computing, big data and the like, the importance of a data center is gradually increased, and the number and the types of physical devices included in the data center are continuously increased, which not only increases the complexity of the internal network environment of the data center, but also provides a serious challenge for the management of the physical devices. In the related art, physical devices in a data center are easy to be added and replaced, but after the physical devices access an internal network, it is difficult to perform automatic discovery and automatic inclusion management on the physical devices, so how to implement automatic discovery on the physical devices in the data center is a technical problem to be faced by those skilled in the art.
Disclosure of Invention
The invention aims to provide a device discovery method, a device, a system, an electronic device and a storage medium, which can perform port scanning on an IP address of a device to be scanned, determine whether the device is online and a port used by the device, acquire device information from a physical device by using the port, further determine the accurate identity of the physical device by using the device information, realize automatic discovery of the physical device and effectively improve operation and maintenance efficiency.
In order to solve the above technical problem, the present invention provides an apparatus discovery method, including:
acquiring an IP address of equipment to be scanned;
carrying out port scanning on the IP address and determining a port used by the equipment to be scanned;
acquiring equipment information from the equipment to be scanned by using a general interface of a communication protocol corresponding to the port and default configuration information of the communication protocol;
and updating the equipment information to a database.
Optionally, when the port is UDP161, the obtaining, by using the common interface of the communication protocol corresponding to the port and the default configuration information of the communication protocol, device information from the device to be scanned includes:
acquiring a system object ID in a public MIB (management information base) of the equipment to be scanned by utilizing a common interface, default configuration information and a first preset object identifier of an SNMP (simple network management protocol), and acquiring serial number information in an entity MIB of the equipment to be scanned by utilizing the common interface, the default configuration information and a second preset object identifier; the default configuration information includes a default group name;
matching the preset equipment table with the system object ID to obtain manufacturer information and model information of the equipment to be scanned; a plurality of system object IDs, corresponding manufacturer information and model information are arranged in the preset equipment table;
and setting the manufacturer information, the model information and the serial number information as the equipment information.
Optionally, when the port is UDP623, the obtaining, by using the common interface of the communication protocol corresponding to the port and the default configuration information of the communication protocol, device information from the device to be scanned includes:
acquiring FRU information from the equipment to be scanned by using a universal interface of an IPMI protocol and default configuration information, and extracting the equipment information from the FRU information; the default configuration information includes a default username and a default password.
Optionally, when the port is TCP5989, the obtaining, by using a general interface of a communication protocol corresponding to the port and default configuration information of the communication protocol, device information from the device to be scanned includes:
acquiring CIM product information from the equipment to be scanned by using a universal interface of an SMI-S protocol and default configuration information, and extracting the equipment information from the CIM product information; the default configuration information includes a default username, a default password, and a default namespace.
Optionally, the acquiring the IP address of the device to be scanned includes:
receiving a preset IP address list issued by a configuration management device, and periodically acquiring the IP address from the preset IP address list;
correspondingly, after the device information is updated to the database, the method further comprises the following steps:
and moving the IP address out of the preset IP address list.
Optionally, the updating the device information to a database includes:
and sending the equipment information to an asset management device so that the asset management device adds the equipment information to the database when determining that the equipment to be identified is new equipment by using the equipment information.
The present invention also provides an apparatus for discovering devices, including:
the IP address acquisition module is used for acquiring the IP address of the equipment to be scanned;
a port scanning module, configured to perform port scanning on the IP address and determine a port used by the device to be scanned;
the equipment information acquisition module is used for acquiring equipment information from the equipment to be scanned by utilizing a general interface of a communication protocol corresponding to the port and default configuration information of the communication protocol;
and the equipment information updating module is used for updating the equipment information to a database.
The present invention also provides a device discovery system, including: a configuration management device, an equipment discovery device, an asset management device, and a database, wherein,
the configuration management device is used for configuring a preset IP address list and sending the preset IP address list to the equipment discovery equipment;
the device discovery apparatus is configured to perform the device discovery method as described above;
the asset management device is used for receiving the equipment information sent by the equipment discovery device and adding the equipment information to the database when the corresponding equipment to be identified is determined to be new equipment by using the equipment information;
the database is used for storing the equipment information.
The present invention also provides an electronic device comprising:
a memory for storing a computer program;
a processor for implementing the device discovery method as described above when executing the computer program.
The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are loaded and executed by a processor, the device discovery method as described above is implemented.
The invention provides a device discovery method, which comprises the following steps: acquiring an IP address of equipment to be scanned; carrying out port scanning on the IP address and determining a port used by the equipment to be scanned; acquiring equipment information from the equipment to be scanned by using a general interface of a communication protocol corresponding to the port and default configuration information of the communication protocol; and updating the equipment information to a database.
It can be seen that, the present invention firstly scans the port of the IP address of the device to be scanned, and the scanning operation can not only determine whether the device is on line, which is convenient for finding the on-line device in time, but also determine the port used by the device. Because the corresponding relation exists between the port and the communication protocol, the communication protocol supported by the equipment can be further determined according to the port used by the equipment to be scanned, and then the equipment information capable of uniquely identifying the equipment can be acquired from the equipment to be scanned by utilizing the universal interface and default configuration information of the communication protocol, so that the automatic discovery and automatic identification of the equipment to be scanned are finally realized, the working efficiency of operation and maintenance personnel can be effectively improved, and the operation and maintenance cost can be effectively reduced. The invention also provides a device scanning device, a system, an electronic device and a computer readable storage medium, which have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a device discovery method according to an embodiment of the present invention;
fig. 2 is a flowchart of another device discovery method according to an embodiment of the present invention;
fig. 3 is a block diagram of a device discovery apparatus according to an embodiment of the present invention;
fig. 4 is a block diagram of a device discovery system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
With the development of network technologies such as internet, cloud computing, big data and the like, the importance of a data center is gradually increased, and the number and the types of physical devices included in the data center are continuously increased, which not only increases the complexity of the internal network environment of the data center, but also provides a serious challenge for the management of the physical devices. In the related art, physical devices in a data center are easy to be added and replaced, but after the physical devices access an internal network, it is difficult to perform automatic discovery and automatic inclusion management on the physical devices, so how to implement automatic discovery on the physical devices in the data center is a technical problem to be faced by those skilled in the art. In view of this, the present invention provides an apparatus discovery method, which can scan a port of an IP address of an apparatus to be scanned, determine whether the apparatus is online and the port used by the apparatus, acquire apparatus information from a physical apparatus through the port, and further determine an accurate identity of the physical apparatus through the apparatus information, thereby implementing automatic discovery of the physical apparatus and effectively improving operation and maintenance efficiency. Referring to fig. 1, fig. 1 is a flowchart of a device discovery method according to an embodiment of the present invention, where the method includes:
s101, obtaining an IP address of the equipment to be scanned.
It should be noted that the embodiment of the present invention does not limit the source of the IP address of the device to be scanned, and for example, the source may be from a preset IP address field, or from a preset IP address list, and the source may be selected according to the actual application requirement. In view of the fact that the preset IP address list can accommodate more IP addresses, in the embodiment of the present invention, the IP address can be obtained from the preset IP address list. The embodiment of the present invention also does not limit the setting mode of the preset IP address list, and for example, the preset IP address list may be prestored in a memory of an apparatus discovery device executing the apparatus discovery method, or may be issued by a separate configuration management device, where the configuration management device is used to centrally manage IP addresses in an intranet environment of a data center, and issue IP addresses to be scanned for the apparatus discovery device. In consideration of the fact that the network environment in the data center is complex, the number of physical devices is large, and the types of physical devices are many, the IP addresses are managed and issued in a centralized mode by adopting the independent configuration management device, the configuration efficiency of the device discovery device can be effectively improved, the scanning range of the device discovery device is improved, and then the cost of operation and maintenance of the device is effectively reduced.
Furthermore, the embodiment of the present invention does not limit whether the device discovery apparatus periodically obtains the IP address from the preset IP address list, and when a single scan of the IP address can discover a sufficient amount of physical devices, that is, can meet the application requirements, the obtaining step does not need to be performed periodically; when flexibility of device discovery needs to be improved, and it is ensured that each online physical device can be effectively discovered, the IP address can be periodically obtained from the preset IP address list. In the embodiment of the invention, in order to ensure that each online physical device can be effectively discovered and recorded, the IP address can be periodically acquired from the preset IP address list. It should be noted that, the embodiment of the present invention does not limit the specific cycle value, and the cycle value may be set according to the actual application requirement.
In one possible scenario, acquiring an IP address of a device to be scanned includes:
step 11: and receiving a preset IP address list issued by the configuration management device, and periodically acquiring the IP address from the preset IP address list.
S102, carrying out port scanning on the IP address, and determining a port used by equipment to be scanned;
it should be noted that, the embodiments of the present invention do not limit the specific manner and process of port scanning, and refer to the related art of port scanning. It can be understood that, when the port opened by the device to be scanned is scanned, the response information returned by the device can be received, and the port used by the device to be scanned can be determined according to the information. The embodiment of the present invention does not limit the specific form of the response information, and reference may be made to the related art of port scanning. Of course, if the response information of the device to be scanned is not received, the device has no response, and at this time, there may be a case where the device is offline, crashed, or the port is not opened, and the device discovery process for the device may be exited. The embodiment of the present invention does not limit the specific step of determining that the device to be scanned does not respond, and for example, a preset time period may be set, and if the response time of the device to be scanned exceeds the preset time period, it is indicated that the device does not respond, and at this time, the device discovery process of the device may be exited. The embodiment of the invention does not limit the specific value of the preset time period, and can be set according to the actual application requirement.
Further, the embodiment of the present invention does not limit which ports of the IP address are scanned, and the scanning can be set according to specific application requirements. In particular, since the ports generally correspond to a communication protocol, the corresponding ports to be scanned may be determined according to the communication protocol commonly used by the physical devices in the data center. It can be understood that the equipment of the data center mainly consists of servers and disk array equipment. For the server, the device usually supports two communication protocols, i.e. an IPMI Protocol and an SNMP Protocol, where IPMI (Intelligent Platform Management Interface) is an industrial communication standard, the Protocol uses UDP623 port for communication, and UDP (User data Protocol) is a transmission Protocol; SNMP (Simple Network Management Protocol) is a standard Protocol specifically designed for managing Network nodes (servers, workstations, routers, switches, HUBS, etc.) in an IP Network, and the Protocol uses UDP161 port for communication, so if a server device needs to be identified, UDP623, UDP161, or a combination of UDP623 and UDP161 can be scanned; for the raid device, the device usually supports two communication protocols, i.e. an SNMP Protocol and an SMI-S Protocol, where SMI-S (Storage Management Initiative specification) is a standard Management Protocol for monitoring and managing the Storage device, the Protocol uses TCP5989 port for communication, and TCP (Transmission Control Protocol) is also a Transmission Protocol, so that if the raid device needs to be identified, TCP5989, UDP161, or a combination of TCP5989 and UDP161 may be scanned. Of course, if all servers and disk array devices need to be completely covered, the combination of the ports UDP623, UDP161, and TCP5989 may also be scanned, so as to ensure that the physical devices that have been brought online inside the data center are effectively discovered. S103, acquiring equipment information from the equipment to be scanned by using the general interface of the port corresponding to the communication protocol and the default configuration information of the communication protocol.
After the port used by the device to be scanned is determined, the specific device information can be acquired from the device to be scanned by using the universal interface of the communication protocol according to the corresponding relationship between the port and the communication protocol. It should be noted that the embodiment of the present invention does not limit how to obtain the device information from the device to be scanned by using the general interface of the communication protocol, and refer to the related technologies of IPMI, SNMP, and SMI-S. It can be understood that various communication protocols are provided with a security check mechanism, so that when the device information is acquired from the device to be scanned, the configuration information of the protocol needs to be carried. In the embodiment of the invention, the equipment information is acquired by adopting the default configuration information universally configured by the communication protocol, wherein the default configuration information is the configuration information carried by the physical equipment when the physical equipment leaves a factory or the communication protocol is initialized. It is understood that the default configuration information of different communication protocols is different, so that the corresponding default configuration information can be selected according to the specific communication protocol, for example, for the IPMI protocol, the default configuration information is usually a default user name and a default password; for the SNMP protocol, its default configuration information is typically the default Community name (Community); for the SMI-S protocol, the default configuration is usually a default user name, a default password and a default Namespace (Namespace), and the related technology of the corresponding protocol can be referred to for the specific content of the default protocol configuration of each protocol.
Further, if the device to be scanned communicates using the IPMI protocol, the device information of the device is usually stored in FRU information, where the FRU information includes device information such as device manufacturer, signal, serial number, and the like, so that the FRU information may be requested from the device to be scanned to extract the corresponding device information.
In a possible case, when the port is UDP623, acquiring device information from the device to be scanned by using a general interface of the port corresponding to the communication protocol and default configuration information of the communication protocol, which may include:
step 21: acquiring FRU information from the equipment to be scanned by using a universal interface of an IPMI protocol and default configuration information, and extracting equipment information from the FRU information; the default configuration information includes a default username and a default password.
It should be noted that the embodiment of the present invention does not limit the specific manner of acquiring FRU information, and reference may be made to the IPMI protocol and the technology related to ipmitool. The embodiment of the present invention also does not limit the specific content of the device information extracted from the FRU information, and may include, for example, information such as a device serial number, a device model, a device manufacturer, and the like, and may further include motherboard information, a device version, a device asset serial number, and the like, and may be selected according to information that can be provided by the FRU and in combination with specific application requirements.
Further, if the device to be scanned communicates using the SMI-S protocol, the device Information of the device is usually stored in CIM Product Information (CIM _ Product), where CIM (Common Information Model) is a standard used in the computer industry to define devices and application modes, and the CIM Product Information includes device Information such as device manufacturer, signal, serial number, etc., so that the CIM Product Information can be requested from the device to be scanned to extract the corresponding device Information.
In a possible case, when the port is TCP5989, acquiring device information from the device to be scanned by using a common interface of the port corresponding to the communication protocol and default configuration information of the communication protocol, including:
step 31: acquiring CIM product information from the equipment to be scanned by using a universal interface of an SMI-S protocol and default configuration information, and extracting equipment information from the CIM product information; the default configuration information includes a default username, a default password, and a default namespace.
It should be noted that the embodiment of the present invention does not limit the specific way of acquiring the FRU information, and reference may be made to the related art of the SMI-S protocol. The embodiment of the present invention also does not limit the specific content of the device information extracted from the CIM product information, and may include, for example, information such as a device serial number, a device model, a device manufacturer, and the like, and may further include a device name, a device profile, a device version, and the like, and may be selected according to information that can be provided by the CIM product information and in combination with specific application requirements.
Further, if the device to be scanned communicates using the SNMP protocol, the device Information of the device is usually stored in a MIB (Management Information Base), such as a common MIB (RFC-1213-MIB, which may also be referred to as MIB-II object group) and an Entity MIB (Entity MIB), where a System group (System group) of the common MIB stores a System object ID (sysobjectid) that is a unique identifier set by a manufacturer for each type of device, so that a device table may be preset, where a plurality of System object IDs and corresponding vendor Information and model Information are stored in the device table, and the vendor Information and model Information of the device to be scanned are matched in the device table by using the System object ID of the device to be scanned, so as to determine the vendor Information and model Information of the device; the actual MIB contains the device serial number (usually stored in the physical serial num field of the physical MIB). Since the MIB library generally uses an Object Identifier (Object Identifier) for data management, a preset Object Identifier may be used to obtain corresponding data in the MIB library. Specifically, in the common MIB, the OID, 1.3.6.1.2.1.1.3.0, is typically used to obtain the sysObjectId, while in the entity MIB, the OID, 1.3.6.1.2.1.47.1.1.1.1.11, is typically used to obtain the device serial number. Of course, since other device information, such as device version information, is also stored in the common MIB and the entity MIB, other device information may also be obtained from the MIB, and may be selected according to actual application requirements.
In a possible case, when the port is UDP161, acquiring device information from the device to be scanned by using a general interface of the port corresponding to the communication protocol and default configuration information of the communication protocol, including:
step 41: acquiring a system object ID in a public MIB (management information base) of equipment to be scanned by utilizing a general interface, default configuration information and a first preset object identifier of an SNMP (simple network management protocol), and acquiring serial number information in an entity MIB of the equipment to be scanned by utilizing the general interface, the default configuration information and a second preset object identifier; the default configuration information includes a default group name;
step 42: matching the preset equipment table with the system object ID to obtain manufacturer information and model information of the equipment to be scanned; a plurality of system object IDs, corresponding manufacturer information and model information are arranged in the preset equipment table;
step 43: and setting the manufacturer information, the model information and the serial number information as equipment information.
And S104, updating the equipment information to a database.
It should be noted that the device information updating operation may be performed by the device discovery apparatus, or may be performed by another separate asset management apparatus. In the embodiment of the present invention, in order to save the computing resources of the device discovery apparatus, in the embodiment of the present invention, the asset management apparatus may be used to update the device information, and the device discovery apparatus only needs to send the acquired device information to the asset management device. In order to improve the processing efficiency of the asset management device, a blocking queue can be arranged in the asset management device, and the device discovery device needs to send the device information to the blocking queue, so that the asset management device can extract the device information from the blocking queue and further execute a corresponding updating step. It should be noted that, the embodiment of the present invention does not limit the setting manner of the congestion queue, and reference may be made to related technologies. Also, to ensure that the asset management device properly processes the device information, the device information update may be performed using a single thread.
In one possible scenario, updating the device information to a database includes:
step 51: and sending the equipment information to the asset management device so that the asset management device adds the equipment information to the database when determining that the equipment to be identified is new equipment by using the equipment information.
It should be noted that, the embodiment of the present invention does not limit how to determine whether the device to be identified is a new device by using the device information, for example, the device serial number in the device information may be used for matching, if not, the device serial number is determined as the new device, of course, all information in the device information may be used for complete matching, and if not, the device serial number is determined as the new device, and the setting may be performed according to the actual application requirement.
Finally, if the device discovery apparatus obtains the IP address from the preset IP address list, in order to avoid repeated scanning, the device discovery apparatus may move the corresponding IP address out of the preset IP address list after the device information is updated to the database.
In one possible case, after updating the device information to the database, the method may further include:
step 61: and moving the IP address out of the preset IP address list.
Based on the above embodiment, the present invention firstly performs port scanning on the IP address of the device to be scanned, and the scanning operation can determine not only whether the device is online, which is convenient for finding the online device in time, but also determine the port used by the device. Because the corresponding relation exists between the port and the communication protocol, the communication protocol supported by the equipment can be further determined according to the port used by the equipment to be scanned, and then the equipment information capable of uniquely identifying the equipment can be acquired from the equipment to be scanned by utilizing the universal interface and default configuration information of the communication protocol, so that the automatic discovery and automatic identification of the equipment to be scanned are finally realized, the working efficiency of operation and maintenance personnel can be effectively improved, and the operation and maintenance cost can be effectively reduced.
The device discovery method described above is described below based on a specific flowchart. Referring to fig. 2, fig. 2 is a flowchart of another device routing method according to an embodiment of the present invention, where the method includes:
1. extracting an IP address from an IP list to be detected issued by a configuration management device; the IP list to be detected is obtained by dividing the configuration manager according to the network planning of the current data center;
2. carrying out port scanning on UDP623, UDP161 and TCP5989 ports of the IP address, and determining a port used by equipment to be scanned;
3. if the port is UDP623, acquiring FRU information from the equipment to be scanned by using a general interface, a default user name and a default password of an IPMI protocol, and extracting the equipment information from the FRU information;
4. if the port is TCP5989, acquiring CIM product information from the equipment to be scanned by using a universal interface, a default user name, a default password and a default name space of an SMI-S protocol, and extracting the equipment information from the CIM product information;
5. if the port is UDP161, a system object ID (sysobjectid) is obtained in a public MIB of the device to be scanned by using a common interface, a default group name, and a first preset object identifier (1.3.6.1.2.1.1.3.0) of an SNMP protocol, serial number information is obtained in an entity MIB of the device to be scanned by using the common interface, the default group name, and a second preset object identifier (1.3.6.1.2.1.47.1.1.1.1.11), and the vendor information and the model information of the device to be scanned are obtained by matching a preset device table with the system object ID, and the vendor information, the model information, and the serial number information are combined into device information.
6. And sending the equipment information to a data blocking queue of the asset management device so that the asset management device adds the equipment information to the database when determining that the equipment to be identified is new equipment by using the equipment serial number in the equipment information.
The device discovery apparatus, the system, the electronic device, and the computer-readable storage medium according to the embodiments of the present invention are introduced below, and the device discovery apparatus, the system, the electronic device, and the computer-readable storage medium described below may be referred to in correspondence with the device discovery method described above.
Referring to fig. 3, fig. 3 is a block diagram of a device discovery apparatus according to an embodiment of the present invention, where the apparatus may include:
an IP address obtaining module 301, configured to obtain an IP address of a device to be scanned;
a port scanning module 302, configured to perform port scanning on the IP address and determine a port used by a device to be scanned;
the device information acquiring module 303 is configured to acquire device information from a device to be scanned by using a general interface of a port corresponding to a communication protocol and default configuration information of the communication protocol;
and the device information updating module 304 is configured to update the device information to the database.
Optionally, the device information obtaining module 303 may include:
the first acquisition submodule is used for acquiring a system object ID from a public MIB of the equipment to be scanned by using a general interface, default configuration information and a first preset object identifier of an SNMP protocol, and acquiring serial number information from an entity MIB of the equipment to be scanned by using the general interface, the default configuration information and a second preset object identifier; the default configuration information includes a default group name;
the matching submodule is used for matching the preset equipment table with the system object ID to obtain manufacturer information and model information of the equipment to be scanned; a plurality of system object IDs, corresponding manufacturer information and model information are arranged in the preset equipment table;
and the setting submodule is used for setting the manufacturer information, the model information and the serial number information as the equipment information.
Optionally, the device information obtaining module 303 may include:
the second acquisition submodule is used for acquiring FRU information from the equipment to be scanned by using a general interface and default configuration information of the IPMI protocol and extracting the equipment information from the FRU information; the default configuration information includes a default username and a default password.
Optionally, the device information obtaining module 303 may include:
the third acquisition submodule is used for acquiring CIM product information from the equipment to be scanned by using the universal interface of the SMI-S protocol and default configuration information and extracting the equipment information from the CIM product information; the default configuration information includes a default username, a default password, and a default namespace.
Optionally, the IP address obtaining module 301 may include:
the IP address acquisition submodule is used for receiving a preset IP address list issued by the configuration management device and periodically acquiring an IP address from the preset IP address list;
accordingly, the apparatus may further include:
and the removing module is used for removing the IP address from the preset IP address list.
Optionally, the device information updating module 304 may include:
and the equipment information sending submodule is used for sending the equipment information to the asset management device so that the asset management device adds the equipment information to the database when determining that the equipment to be identified is new equipment by using the equipment information.
Referring to fig. 4, fig. 4 is a block diagram of a device discovery system according to an embodiment of the present invention, where the system may include: a configuration management means 401, a device discovery means 402, an asset management means 403 and a database 404, wherein,
a configuration management device 401, configured to configure a preset IP address list, and send the preset IP address list to the device discovery apparatus;
a device discovery apparatus 402, configured to perform the device discovery method according to the foregoing embodiment;
the asset management device 403 is configured to receive the device information sent by the device discovery device, and add the device information to the database when determining that the corresponding device to be identified is a new device by using the device information;
a database 404 for storing device information.
It should be noted that, the number of the device discovery apparatuses 402 is not limited in the embodiment of the present invention, and may be one or multiple, and may be set according to actual application requirements.
An embodiment of the present invention further provides an electronic device, including:
a memory for storing a computer program;
a processor for implementing the steps of the device discovery method as described above when executing the computer program.
Since the embodiment of the electronic device portion corresponds to the embodiment of the device discovery method portion, please refer to the description of the embodiment of the device discovery method portion for the embodiment of the electronic device portion, which is not repeated here.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the device discovery method according to any of the above embodiments are implemented.
Since the embodiment of the computer-readable storage medium portion corresponds to the embodiment of the server failure detection method portion, please refer to the description of the embodiment of the device discovery method portion for the embodiment of the storage medium portion, which is not repeated here.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above details are provided for a device discovery method, apparatus, system, electronic device and storage medium provided by the present invention. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (10)

1. A device discovery method, comprising:
acquiring an IP address of equipment to be scanned;
carrying out port scanning on the IP address and determining a port used by the equipment to be scanned;
acquiring equipment information from the equipment to be scanned by using a general interface of a communication protocol corresponding to the port and default configuration information of the communication protocol;
and updating the equipment information to a database.
2. The device discovery method according to claim 1, wherein when the port is UDP161, the obtaining device information from the device to be scanned by using a generic interface of a communication protocol corresponding to the port and default configuration information of the communication protocol includes:
acquiring a system object ID in a public MIB (management information base) of the equipment to be scanned by utilizing a common interface, default configuration information and a first preset object identifier of an SNMP (simple network management protocol), and acquiring serial number information in an entity MIB of the equipment to be scanned by utilizing the common interface, the default configuration information and a second preset object identifier; the default configuration information includes a default group name;
matching the preset equipment table with the system object ID to obtain manufacturer information and model information of the equipment to be scanned; a plurality of system object IDs, corresponding manufacturer information and model information are arranged in the preset equipment table;
and setting the manufacturer information, the model information and the serial number information as the equipment information.
3. The method according to claim 1, wherein when the port is UDP623, the obtaining device information from the device to be scanned by using a generic interface of a communication protocol corresponding to the port and default configuration information of the communication protocol includes:
acquiring FRU information from the equipment to be scanned by using a universal interface of an IPMI protocol and default configuration information, and extracting the equipment information from the FRU information; the default configuration information includes a default username and a default password.
4. The device discovery method according to claim 1, wherein when the port is TCP5989, the obtaining device information from the device to be scanned by using a generic interface of a communication protocol corresponding to the port and default configuration information of the communication protocol includes:
acquiring CIM product information from the equipment to be scanned by using a universal interface of an SMI-S protocol and default configuration information, and extracting the equipment information from the CIM product information; the default configuration information includes a default username, a default password, and a default namespace.
5. The device discovery method according to claim 1, wherein said obtaining the IP address of the device to be scanned comprises:
receiving a preset IP address list issued by a configuration management device, and periodically acquiring the IP address from the preset IP address list;
correspondingly, after the device information is updated to the database, the method further comprises the following steps:
and moving the IP address out of the preset IP address list.
6. The device discovery method of claim 1, wherein said updating said device information to a database comprises:
and sending the equipment information to an asset management device so that the asset management device adds the equipment information to the database when determining that the equipment to be identified is new equipment by using the equipment information.
7. An apparatus for discovering devices, comprising:
the IP address acquisition module is used for acquiring the IP address of the equipment to be scanned;
a port scanning module, configured to perform port scanning on the IP address and determine a port used by the device to be scanned;
the equipment information acquisition module is used for acquiring equipment information from the equipment to be scanned by utilizing a general interface of a communication protocol corresponding to the port and default configuration information of the communication protocol;
and the equipment information updating module is used for updating the equipment information to a database.
8. A device discovery system, comprising: a configuration management device, an equipment discovery device, an asset management device, and a database, wherein,
the configuration management device is used for configuring a preset IP address list and sending the preset IP address list to the equipment discovery equipment;
the device discovery apparatus configured to perform the device discovery method according to any one of claims 1 to 6;
the asset management device is used for receiving the equipment information sent by the equipment discovery device and adding the equipment information to the database when the corresponding equipment to be identified is determined to be new equipment by using the equipment information;
the database is used for storing the equipment information.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the device discovery method of any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium having stored thereon computer-executable instructions that, when loaded and executed by a processor, implement the device discovery method of any one of claims 1 to 6.
CN202110873071.2A 2021-07-30 2021-07-30 Device discovery method, device, system, electronic device and storage medium Pending CN113709210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110873071.2A CN113709210A (en) 2021-07-30 2021-07-30 Device discovery method, device, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110873071.2A CN113709210A (en) 2021-07-30 2021-07-30 Device discovery method, device, system, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN113709210A true CN113709210A (en) 2021-11-26

Family

ID=78651191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110873071.2A Pending CN113709210A (en) 2021-07-30 2021-07-30 Device discovery method, device, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113709210A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060074975A1 (en) * 2003-07-11 2006-04-06 Computer Associates Think, Inc. System and method for common storage object model
CN107566394A (en) * 2017-09-28 2018-01-09 小花互联网金融服务(深圳)有限公司 A kind of newly-increased automatic discovery of cloud platform example host and quick vulnerability scanning method
CN108769060A (en) * 2018-06-21 2018-11-06 曙光信息产业(北京)有限公司 The method, apparatus and cluster monitoring system of automatic addition server
CN111970146A (en) * 2020-07-25 2020-11-20 苏州浪潮智能科技有限公司 Monitoring platform and monitoring method for SRDC whole cabinet nodes
CN112688810A (en) * 2020-12-23 2021-04-20 苏州三六零智能安全科技有限公司 Network asset information acquisition method, equipment and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060074975A1 (en) * 2003-07-11 2006-04-06 Computer Associates Think, Inc. System and method for common storage object model
CN107566394A (en) * 2017-09-28 2018-01-09 小花互联网金融服务(深圳)有限公司 A kind of newly-increased automatic discovery of cloud platform example host and quick vulnerability scanning method
CN108769060A (en) * 2018-06-21 2018-11-06 曙光信息产业(北京)有限公司 The method, apparatus and cluster monitoring system of automatic addition server
CN111970146A (en) * 2020-07-25 2020-11-20 苏州浪潮智能科技有限公司 Monitoring platform and monitoring method for SRDC whole cabinet nodes
CN112688810A (en) * 2020-12-23 2021-04-20 苏州三六零智能安全科技有限公司 Network asset information acquisition method, equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王磊等: "基于SNMP的铁路信号监督系统网络拓扑发现方法", 《铁路计算机应用》 *

Similar Documents

Publication Publication Date Title
US9742639B1 (en) Intelligent network resource discovery and monitoring
CN110661669B (en) Network topology automatic discovery method of network equipment based on ICMP, TCP and UDP protocols
US8909758B2 (en) Physical server discovery and correlation
CN110247784B (en) Method and device for determining network topology structure
CN109802953B (en) Industrial control asset identification method and device
CN109951359B (en) Asynchronous scanning method and device for distributed network assets
US20070297349A1 (en) Method and System for Collecting Information Relating to a Communication Network
US11696110B2 (en) Distributed, crowdsourced internet of things (IoT) discovery and identification using Block Chain
CN109995582B (en) Asset equipment management system and method based on real-time state
US8364805B2 (en) Method and apparatus of matching monitoring sets to network devices
EP1695486B1 (en) Method and system for collecting information relating to a communication network
US11283816B2 (en) Hierarchical scanning of internet connected assets
CN114338068A (en) Multi-node vulnerability scanning method and device, electronic equipment and storage medium
CN109510729B (en) Implementation method for discovering application topological relation based on CMDB and Netstat
US20060071684A1 (en) Active storage area network discovery system and method
CN113098776B (en) Method, device, equipment and storage medium for determining network topology
JP5383927B2 (en) Method and management device for discovering communication devices connected to communication network
CN110505075B (en) Device management method and related device
WO2016091141A1 (en) Method and apparatus for information collection
CN113709210A (en) Device discovery method, device, system, electronic device and storage medium
CN111953532B (en) Equipment model identification method, device and equipment
US6763001B1 (en) Discovering non managed devices in a network such as a LAN using telnet
CN112685406A (en) Monitoring system for ascertaining use state of cloud platform assets in real time
JP3944214B2 (en) Device management system, apparatus and method
CN112448847B (en) Method and device for determining network asset location information

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211126