CN111082996B - Automatic configuration method, device and medium for in-band monitoring software - Google Patents
Automatic configuration method, device and medium for in-band monitoring software Download PDFInfo
- Publication number
- CN111082996B CN111082996B CN201911386498.9A CN201911386498A CN111082996B CN 111082996 B CN111082996 B CN 111082996B CN 201911386498 A CN201911386498 A CN 201911386498A CN 111082996 B CN111082996 B CN 111082996B
- Authority
- CN
- China
- Prior art keywords
- address
- unit
- target
- monitoring software
- addresses
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 35
- 238000001514 detection method Methods 0.000 claims abstract description 67
- 230000004044 response Effects 0.000 claims abstract description 60
- 238000004590 computer program Methods 0.000 claims description 12
- 230000005540 biological transmission Effects 0.000 claims description 6
- 239000000523 sample Substances 0.000 abstract description 5
- 238000009434 installation Methods 0.000 abstract description 4
- 238000012544 monitoring process Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0876—Aspects of the degree of configuration automation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Automation & Control Theory (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例公开了一种带内监控软件的自动配置方法、装置和介质,检测到安装带内监控软件时,获取本地局域网的各IP地址;从所有IP地址中随机选取一个目标IP地址,并向目标IP地址发送地址探测包。判断接收到的响应信息中携带的IP地址是否为有效地址;若是,则可以向有效地址发送注册认证消息;并根据接收的配置信息,完成带内监控软件的配置。若否,则可以从剩余的IP地址中随机选取一个新的目标IP地址,并向新的目标IP地址发送地址探测包;直至接收到携带有效地址的响应信息则结束操作。采用基于同一个局域网内随机选取IP地址发送地址探测包的方法,可以有效的解决服务端地址变更无法与服务端建立连接的问题,提升了带内监控软件部署的成功率。
The embodiment of the present invention discloses an automatic configuration method, device and medium for in-band monitoring software. When the installation of the in-band monitoring software is detected, each IP address of a local area network is obtained; a target IP address is randomly selected from all IP addresses, And send an address probe packet to the target IP address. Determine whether the IP address carried in the received response information is a valid address; if so, send a registration authentication message to the valid address; and complete the configuration of the in-band monitoring software according to the received configuration information. If not, a new target IP address can be randomly selected from the remaining IP addresses, and an address detection packet is sent to the new target IP address; the operation is ended until a response message carrying a valid address is received. The method of sending address detection packets based on randomly selected IP addresses in the same local area network can effectively solve the problem that the server cannot establish a connection with the server when the address is changed, and improve the success rate of in-band monitoring software deployment.
Description
技术领域technical field
本发明涉及服务器监控技术领域,特别是涉及一种带内监控软件的自动配置方法、装置和计算机可读存储介质。The present invention relates to the technical field of server monitoring, in particular to an automatic configuration method, device and computer-readable storage medium of in-band monitoring software.
背景技术Background technique
随着计算机技术的快速发展,大规模的数据业务及数量不断增加,而服务器资源不断递增,监控不仅需要监控服务器带外信息,带内系统信息的监控也尤为重要。服务器带外信息包括服务器通过网线连接的外部设备的信息。服务器带内系统信息指的是归属于同一个服务端系统的信息。如何快速部署带内监控软件及实现带内监控软件的自动化部署配置,显得尤为重要。With the rapid development of computer technology, large-scale data services and quantities are increasing, and server resources are increasing. Monitoring not only requires monitoring server out-of-band information, but also in-band system information monitoring is particularly important. The out-of-band information of the server includes information of external devices connected to the server through a network cable. Server in-band system information refers to information belonging to the same server system. How to quickly deploy in-band monitoring software and realize automatic deployment and configuration of in-band monitoring software is particularly important.
现有常用的自动化部署配置方法则是针对网络中在线设备的方法,通过传输控制协议(Transmission Control Protocol,TCP)方式来检测端口是否开启,来确定服务端软件及其版本,该自动化部署配置方法主要是通过TCP与服务端进行建立连接,并以此来确定服务端版本,实现带内监控软件的部署。但是该方案在服务端地址发生变化时,对于未获知服务端地址的客户端将无法实现带内监控软件的部署。并且由于服务端需要同时对多个客户端提供服务,导致连接建立之后往往不能及时得到服务端的有效响应,导致带内监控软件的部署失败。The existing commonly used automatic deployment configuration method is a method for online devices in the network, and the transmission control protocol (Transmission Control Protocol, TCP) method is used to detect whether the port is open to determine the server software and its version. The automatic deployment configuration method It mainly establishes a connection with the server through TCP, and uses this to determine the server version and realize the deployment of in-band monitoring software. However, in this solution, when the address of the server changes, the deployment of the in-band monitoring software will not be possible for clients that do not know the address of the server. And because the server needs to provide services to multiple clients at the same time, it is often impossible to get an effective response from the server in time after the connection is established, resulting in the failure of the deployment of the in-band monitoring software.
可见,如何提升带内监控软件部署的成功率,是本领域技术人员需要解决的问题。It can be seen that how to improve the success rate of in-band monitoring software deployment is a problem to be solved by those skilled in the art.
发明内容SUMMARY OF THE INVENTION
本发明实施例的目的是提供一种带内监控软件的自动配置方法、装置和计算机可读存储介质,可以提升带内监控软件部署的成功率。The purpose of the embodiments of the present invention is to provide an automatic configuration method, device and computer-readable storage medium for in-band monitoring software, which can improve the success rate of in-band monitoring software deployment.
为解决上述技术问题,本发明实施例提供一种带内监控软件的自动配置方法,包括:In order to solve the above technical problems, an embodiment of the present invention provides an automatic configuration method for in-band monitoring software, including:
检测到安装带内监控软件时,获取本地局域网的各IP地址;When it is detected that the in-band monitoring software is installed, obtain each IP address of the local area network;
从所有IP地址中随机选取一个目标IP地址,并向所述目标IP地址发送地址探测包;A target IP address is randomly selected from all IP addresses, and an address detection packet is sent to the target IP address;
判断接收到的响应信息中携带的IP地址是否为有效地址;Determine whether the IP address carried in the received response information is a valid address;
若是,则向所述有效地址发送注册认证消息;并根据接收的配置信息,完成所述带内监控软件的配置;If so, send a registration authentication message to the effective address; and complete the configuration of the in-band monitoring software according to the received configuration information;
若否,则从剩余的IP地址中随机选取一个新的目标IP地址,并向所述新的目标IP地址发送地址探测包;直至接收到携带有效地址的响应信息则结束操作。If not, a new target IP address is randomly selected from the remaining IP addresses, and an address detection packet is sent to the new target IP address; the operation is ended until a response message carrying a valid address is received.
可选地,在所述从剩余的IP地址中随机选取一个新的目标IP地址之前还包括:Optionally, before randomly selecting a new target IP address from the remaining IP addresses, it also includes:
判断向所述目标IP地址发送地址探测包的次数是否超过预设阈值;Determine whether the number of times of sending address detection packets to the target IP address exceeds a preset threshold;
若是,则执行所述从剩余的IP地址中随机选取一个新的目标IP地址的步骤;If so, then execute the described step of randomly selecting a new target IP address from the remaining IP addresses;
若否,则重新向所述目标IP地址发送地址探测包。If not, send an address detection packet to the target IP address again.
可选地,还包括:Optionally, also include:
当接收到其它客户端发送的地址探测包时,检测自身是否已经获取到服务端IP地址;When receiving the address detection packet sent by other clients, check whether it has obtained the server IP address;
若是,则向发送所述地址探测包的客户端反馈携带有所述服务端IP地址的响应信息;If so, feeding back the response information carrying the IP address of the server to the client that sent the address detection packet;
若否,则向发送所述地址探测包的客户端反馈携带空地址的响应信息。If not, the response information carrying the null address is fed back to the client that sent the address detection packet.
可选地,当接收到的响应信息中携带的IP地址为有效地址时还包括:Optionally, when the IP address carried in the received response information is a valid address, it also includes:
向除所述目标IP地址以及所述有效地址外的其它IP地址发送携带有所述有效地址的数据包。Send a data packet carrying the effective address to other IP addresses except the target IP address and the effective address.
可选地,在获取本地局域网的各IP地址之前还包括:Optionally, before acquiring each IP address of the local area network, the method further includes:
监听预设端口是否接收到携带有效地址的数据包;Monitor whether the preset port receives a data packet with a valid address;
若是,则解析所述数据包中携带的有效地址,并向所述有效地址发送注册认证消息;If so, parse the valid address carried in the data packet, and send a registration authentication message to the valid address;
若否,则执行所述获取本地局域网的各IP地址的步骤。If not, execute the step of obtaining each IP address of the local area network.
本发明实施例还提供了一种带内监控软件的自动配置装置,包括获取单元、选取单元、发送单元、判断单元和配置单元;The embodiment of the present invention also provides an automatic configuration device for in-band monitoring software, including an acquisition unit, a selection unit, a transmission unit, a judgment unit, and a configuration unit;
所述获取单元,用于检测到安装带内监控软件时,获取本地局域网的各IP地址;The obtaining unit is used to obtain each IP address of the local area network when detecting that the in-band monitoring software is installed;
所述选取单元,用于从所有IP地址中随机选取一个目标IP地址;Described selecting unit, is used for randomly selecting a target IP address from all IP addresses;
所述发送单元,用于向所述目标IP地址发送地址探测包;the sending unit, configured to send an address detection packet to the target IP address;
所述判断单元,用于判断接收到的响应信息中携带的IP地址是否为有效地址;The judging unit is used to judge whether the IP address carried in the received response information is a valid address;
所述发送单元还用于当接收到的响应信息中携带的IP地址为有效地址时,则向所述有效地址发送注册认证消息;The sending unit is further configured to send a registration authentication message to the valid address when the IP address carried in the received response information is an effective address;
所述配置单元,用于根据接收的配置信息,完成所述带内监控软件的配置;the configuration unit, configured to complete the configuration of the in-band monitoring software according to the received configuration information;
所述选取单元还用于当接收到的响应信息中携带的IP地址不是有效地址时,从剩余的IP地址中随机选取一个新的目标IP地址,并触发所述发送单元向所述新的目标IP地址发送地址探测包;直至接收到携带有效地址的响应信息则结束操作。The selection unit is also used for randomly selecting a new target IP address from the remaining IP addresses when the IP address carried in the received response information is not an effective address, and triggering the sending unit to the new target The IP address sends an address detection packet; the operation ends until a response message carrying a valid address is received.
可选地,还包括次数判断单元;Optionally, it also includes a number of times judgment unit;
所述次数判断单元,用于在所述从剩余的IP地址中随机选取一个新的目标IP地址之前,判断向所述目标IP地址发送地址探测包的次数是否超过预设阈值;The number of times judgment unit is used to judge whether the number of times that the address detection packet is sent to the target IP address exceeds a preset threshold before the described random selection of a new target IP address from the remaining IP addresses;
若是,则触发所述选取单元所述从剩余的IP地址中随机选取一个新的目标IP地址;If so, then trigger the described selection unit to randomly select a new target IP address from the remaining IP addresses;
若否,则触发所述发送单元重新向所述目标IP地址发送地址探测包。If not, trigger the sending unit to send an address detection packet to the target IP address again.
可选地,还包括检测单元、第一反馈单元和第二反馈单元;Optionally, further comprising a detection unit, a first feedback unit and a second feedback unit;
所述检测单元,用于当接收到其它客户端发送的地址探测包时,检测自身是否已经获取到服务端IP地址;若是,则触发所述第一反馈单元;若否,则触发所述第二反馈单元;The detection unit is used to detect whether it has acquired the server IP address when receiving the address detection packet sent by other clients; if so, trigger the first feedback unit; if not, trigger the first feedback unit. Two feedback units;
所述第一反馈单元,用于向发送所述地址探测包的客户端反馈携带有所述服务端IP地址的响应信息;the first feedback unit, configured to feed back the response information carrying the IP address of the server to the client sending the address detection packet;
所述第二反馈单元,用于向发送所述地址探测包的客户端反馈携带空地址的响应信息。The second feedback unit is configured to feed back response information carrying a null address to the client that sends the address detection packet.
可选地,所述发送单元还用于当接收到的响应信息中携带的IP地址为有效地址时,向除所述目标IP地址以及所述有效地址外的其它IP地址发送携带有所述有效地址的数据包。Optionally, the sending unit is further configured to send an IP address carrying the valid address to other IP addresses except the target IP address and the valid address when the IP address carried in the received response information is a valid address. address packets.
可选地,还包括监听单元和解析单元;Optionally, it also includes a monitoring unit and a parsing unit;
所述监听单元,用于监听预设端口是否接收到携带有效地址的数据包;若是,则触发所述解析单元;若否,则触发所述获取单元执行获取本地局域网的各IP地址的步骤;The monitoring unit is used to monitor whether the preset port receives a data packet carrying an effective address; if so, trigger the parsing unit; if not, trigger the acquiring unit to perform the steps of acquiring each IP address of the local area network;
所述解析单元,用于解析所述数据包中携带的有效地址,并向所述有效地址发送注册认证消息。The parsing unit is configured to parse the valid address carried in the data packet, and send a registration authentication message to the valid address.
本发明实施例还提供了一种带内监控软件的自动配置装置,包括:The embodiment of the present invention also provides an automatic configuration device for in-band monitoring software, including:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行所述计算机程序以实现如上述任意一项所述带内监控软件的自动配置方法的步骤。The processor is configured to execute the computer program to implement the steps of the automatic configuration method of the in-band monitoring software according to any one of the above.
本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上述任一项所述带内监控软件的自动配置方法的步骤。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, implements the in-band monitoring software according to any one of the above. Steps for an automatic configuration method.
由上述技术方案可以看出,检测到安装带内监控软件时,获取本地局域网的各IP地址;从所有IP地址中随机选取一个目标IP地址,并向目标IP地址发送地址探测包。通过随机选取IP地址,可以有效的解决所有客户端均向同一个服务端发送请求,造成请求响应的不及时的问题。判断接收到的响应信息中携带的IP地址是否为有效地址;当响应信息中携带的IP地址为有效地址时,则可以向有效地址发送注册认证消息;并根据接收的配置信息,完成带内监控软件的配置。当响应信息中携带的IP地址为无效地址时,则可以从剩余的IP地址中随机选取一个新的目标IP地址,并向新的目标IP地址发送地址探测包;直至接收到携带有效地址的响应信息则结束操作。采用基于同一个局域网内随机选取IP地址发送地址探测包的方法,可以有效的解决服务端地址变更无法与服务端建立连接的问题,提升了带内监控软件部署的成功率。It can be seen from the above technical solutions that when the installation of the in-band monitoring software is detected, each IP address of the local area network is obtained; a target IP address is randomly selected from all IP addresses, and an address detection packet is sent to the target IP address. By randomly selecting an IP address, it can effectively solve the problem that all clients send requests to the same server, resulting in untimely request responses. Determine whether the IP address carried in the received response information is a valid address; when the IP address carried in the response information is a valid address, a registration authentication message can be sent to the valid address; and according to the received configuration information, complete in-band monitoring software configuration. When the IP address carried in the response information is an invalid address, a new target IP address can be randomly selected from the remaining IP addresses, and an address detection packet is sent to the new target IP address; until a response carrying a valid address is received The message ends the operation. The method of sending address detection packets based on randomly selected IP addresses in the same local area network can effectively solve the problem that the server cannot establish a connection with the server when the address is changed, and improve the success rate of in-band monitoring software deployment.
附图说明Description of drawings
为了更清楚地说明本发明实施例,下面将对实施例中所需要使用的附图做简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention more clearly, the following will briefly introduce the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention, which are not relevant to ordinary skills in the art. As far as personnel are concerned, other drawings can also be obtained from these drawings on the premise of no creative work.
图1为本发明实施例提供的一种带内监控软件的自动配置方法的流程图;1 is a flowchart of an automatic configuration method for in-band monitoring software provided by an embodiment of the present invention;
图2为本发明实施例提供的一种带内监控软件的自动配置装置的结构示意图;2 is a schematic structural diagram of an automatic configuration device for in-band monitoring software provided by an embodiment of the present invention;
图3为本发明实施例提供的一种带内监控软件的自动配置装置的硬件结构示意图。FIG. 3 is a schematic diagram of a hardware structure of an apparatus for automatically configuring in-band monitoring software according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本发明保护范围。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. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present invention.
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。In order to make those skilled in the art better understand the solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
接下来,详细介绍本发明实施例所提供的一种带内监控软件的自动配置方法。图1为本发明实施例提供的一种带内监控软件的自动配置方法的流程图,该方法包括:Next, an automatic configuration method for in-band monitoring software provided by an embodiment of the present invention is introduced in detail. 1 is a flowchart of an automatic configuration method for in-band monitoring software provided by an embodiment of the present invention, and the method includes:
S101:检测到安装带内监控软件时,获取本地局域网的各IP地址。S101: When it is detected that the in-band monitoring software is installed, obtain each IP address of the local area network.
在一个局域网内包含有多个客户端,以及一个用于对所有客户端进行管理的服务端。There are multiple clients in a local area network, and a server for managing all clients.
当客户端安装带内监控软件时,需要在服务端上进行认证注册,根据服务端反馈的配置信息,从而完成对带内监控软件的配置。因此,客户端上安装带内监控软件时,客户端需要获取服务端IP地址,以便于实现带内监控软件的配置。When the client installs the in-band monitoring software, it needs to perform authentication and registration on the server, and complete the configuration of the in-band monitoring software according to the configuration information fed back by the server. Therefore, when the in-band monitoring software is installed on the client, the client needs to obtain the IP address of the server to facilitate the configuration of the in-band monitoring software.
初始状态下,客户端并不知道服务端IP地址,因此客户端可以获取本地局域网的所有IP地址。In the initial state, the client does not know the IP address of the server, so the client can obtain all the IP addresses of the local area network.
S102:从所有IP地址中随机选取一个目标IP地址,并向目标IP地址发送地址探测包。S102: Randomly select a target IP address from all IP addresses, and send an address detection packet to the target IP address.
在本发明实施例中,客户端可以基于用户数据报协议(User Datagram Protocol,UDP)发送地址探测包。In this embodiment of the present invention, the client may send an address detection packet based on a User Datagram Protocol (User Datagram Protocol, UDP).
为了便于和其它IP地址区分,可以将选取出的IP地址称作目标IP地址。In order to be easily distinguished from other IP addresses, the selected IP address may be called a target IP address.
S103:判断接收响应信息中携带的IP地址是否为有效地址。S103: Determine whether the IP address carried in the received response information is a valid address.
目标IP地址所对应的设备可能是其它客户端,也可能是服务端。当目标IP地址对应的设备为服务端时,此时服务端会向发送地址探测包的客户端反馈携带有自身IP地址的响应信息,此时该IP地址为有效地址。The device corresponding to the target IP address may be other clients or servers. When the device corresponding to the target IP address is the server, the server will feed back the response information carrying its own IP address to the client that sent the address detection packet, and the IP address is a valid address at this time.
当目标IP地址对应的设备为其它客户端时,其它客户端可以检测自身是否已经获取到服务端IP地址。其它客户端如果已经获知服务端IP地址,则可以向发送地址探测包的客户端反馈携带有服务端IP地址的响应信息。其它客户端如果未获知服务端IP地址,则向发送地址探测包的客户端反馈携带空地址的响应信息。When the device corresponding to the target IP address is another client, the other client can detect whether it has obtained the server IP address. If other clients have already learned the IP address of the server, they can feed back response information carrying the IP address of the server to the client that sent the address detection packet. If other clients do not know the IP address of the server, they will feed back response information carrying an empty address to the client that sent the address detection packet.
当客户端接收到的响应信息中携带的IP地址为有效地址时,可以依赖于该有效地址实现与服务端的连接,即执行S104。When the IP address carried in the response information received by the client is an effective address, the connection with the server can be realized by relying on the effective address, that is, S104 is performed.
当客户端接收到的响应信息中携带的IP地址为无效地址时,则说明反馈响应信息的客户端并不知道服务端IP地址,此时可以重新向其它IP发送地址探测包,即执行S105。When the IP address carried in the response information received by the client is an invalid address, it means that the client that feeds back the response information does not know the IP address of the server. At this time, the address detection packet can be re-sent to other IPs, that is, S105 is executed.
S104:向有效地址发送注册认证消息;并根据接收的配置信息,完成带内监控软件的配置。S104: Send a registration authentication message to a valid address; and complete the configuration of the in-band monitoring software according to the received configuration information.
客户端获取到有效地址之后,该有效地址即为服务端IP地址,此时客户端可以根据该有效地址建立与服务端的通信连接,从而向服务端发送注册认证消息。相应的,服务端会向客户端反馈配置信息,以便于客户端根据该配置信息,自动化完成对带内监控软件的配置。After the client obtains the valid address, the valid address is the IP address of the server. At this time, the client can establish a communication connection with the server according to the valid address, thereby sending a registration authentication message to the server. Accordingly, the server will feed back the configuration information to the client, so that the client can automatically complete the configuration of the in-band monitoring software according to the configuration information.
S105:从剩余的IP地址中随机选取一个新的目标IP地址,并向新的目标IP地址发送地址探测包;直至接收到携带有效地址的响应信息则结束操作。S105: Randomly select a new target IP address from the remaining IP addresses, and send an address detection packet to the new target IP address; the operation is ended until a response message carrying a valid address is received.
当目标IP地址所对应的设备反馈的是无效地址时,此时客户端可以重新选取新的目标IP地址,以便于最终获取到服务端的有效地址。When the device corresponding to the target IP address feeds back an invalid address, the client can re-select a new target IP address, so as to finally obtain the valid address of the server.
需要说明的是,在实际应用中,客户端也可能会接收不到响应信息,在本发明实施例中,可以将未接收到响应信息的情况归属于响应信息中携带的为无效地址,此时可以执行S105的操作。It should be noted that, in practical applications, the client may not receive the response information. In this embodiment of the present invention, the situation of not receiving the response information can be attributed to the invalid address carried in the response information. At this time The operation of S105 can be performed.
由上述技术方案可以看出,检测到安装带内监控软件时,获取本地局域网的各IP地址;从所有IP地址中随机选取一个目标IP地址,并向目标IP地址发送地址探测包。通过随机选取IP地址,可以有效的解决所有客户端均向同一个服务端发送请求,造成请求响应的不及时的问题。判断接收到的响应信息中携带的IP地址是否为有效地址;当响应信息中携带的IP地址为有效地址时,则可以向有效地址发送注册认证消息;并根据接收的配置信息,完成带内监控软件的配置。当响应信息中携带的IP地址为无效地址时,则可以从剩余的IP地址中随机选取一个新的目标IP地址,并向新的目标IP地址发送地址探测包;直至接收到携带有效地址的响应信息则结束操作。采用基于同一个局域网内随机选取IP地址发送地址探测包的方法,可以有效的解决服务端地址变更无法与服务端建立连接的问题,提升了带内监控软件部署的成功率。It can be seen from the above technical solutions that when the installation of the in-band monitoring software is detected, each IP address of the local area network is obtained; a target IP address is randomly selected from all IP addresses, and an address detection packet is sent to the target IP address. By randomly selecting an IP address, it can effectively solve the problem that all clients send requests to the same server, resulting in untimely request responses. Determine whether the IP address carried in the received response information is a valid address; when the IP address carried in the response information is a valid address, a registration authentication message can be sent to the valid address; and according to the received configuration information, complete in-band monitoring software configuration. When the IP address carried in the response information is an invalid address, a new target IP address can be randomly selected from the remaining IP addresses, and an address detection packet is sent to the new target IP address; until a response carrying a valid address is received The message ends the operation. The method of sending address detection packets based on randomly selected IP addresses in the same local area network can effectively solve the problem that the server cannot establish a connection with the server when the address is changed, and improve the success rate of in-band monitoring software deployment.
考虑到地址探测包传输的不稳定性,客户端可以多次向目标IP地址发送数据探测包,具体的,当客户端在从剩余的IP地址中随机选取一个新的目标IP地址之前,可以判断向目标IP地址发送地址探测包的次数是否超过预设阈值。Considering the instability of address probe packet transmission, the client can send data probe packets to the target IP address multiple times. Specifically, when the client randomly selects a new target IP address from the remaining IP addresses, it can determine Whether the number of times of sending address probe packets to the target IP address exceeds the preset threshold.
其中,预设阈值的取值可以根据实际需求设定,在此不做限定,例如,可以将预设阈值设定为5次。The value of the preset threshold may be set according to actual requirements, which is not limited here. For example, the preset threshold may be set to 5 times.
当向目标IP地址发送地址探测包的次数超过预设阈值时,则执行从剩余的IP地址中随机选取一个新的目标IP地址的步骤。当向目标IP地址发送地址探测包的次数未超过预设阈值时,则重新向目标IP地址发送地址探测包。When the number of times of sending address detection packets to the target IP address exceeds the preset threshold, the step of randomly selecting a new target IP address from the remaining IP addresses is performed. When the number of times that the address detection packet is sent to the target IP address does not exceed the preset threshold, the address detection packet is sent to the target IP address again.
通过多次向同一个目标IP地址发送数据探测包,可以有效的降低网络不稳定等因素造成数据探测包发送失败的情况发生。并且对发送数据探测包的次数进行限定,可以避免一直向未获知服务端IP地址的设备重复发送数据探测包。By sending data detection packets to the same target IP address multiple times, the failure to send data detection packets caused by factors such as network instability can be effectively reduced. In addition, the number of times of sending data detection packets is limited, so as to avoid repeatedly sending data detection packets to devices that do not know the IP address of the server.
在本发明实施例中,为了有效的节省局域网内其它客户端发现服务端IP地址所耗费的时间,当前客户端接收到的响应信息中携带的IP地址为有效地址时,可以向除目标IP地址以及有效地址外的其它IP地址发送携带有有效地址的数据包,以便于其它客户端可以及时获知到服务端IP地址。In this embodiment of the present invention, in order to effectively save the time it takes for other clients in the local area network to discover the IP address of the server, when the IP address carried in the response information received by the current client is a valid address, the destination IP address can be sent to the destination IP address. and other IP addresses other than the effective address to send data packets carrying the effective address, so that other clients can learn the IP address of the server in time.
在当前客户端获知到服务端IP地址时,通过向其它客户端发送服务端IP地址,可以有效的节省其它客户端发现服务端IP地址的时间,提升了局域网内各客户端配置带内监控软件的效率。When the current client learns the IP address of the server, by sending the IP address of the server to other clients, it can effectively save the time for other clients to discover the IP address of the server, and improve the configuration of in-band monitoring software for each client in the local area network. s efficiency.
结合上述介绍可知,客户端除了主动向目标IP地址发送地址探测包之外,也可能会接收到其它客户端主动反馈的携带有效地址的数据包,因此,在本发明实施例中,客户端在获取本地局域网的各IP地址之前,可以监听预设端口是否接收到携带有效地址的数据包;Based on the above introduction, it can be seen that in addition to actively sending address detection packets to the target IP address, the client may also receive data packets carrying valid addresses that are actively fed back by other clients. Therefore, in this embodiment of the present invention, the client is in the Before obtaining each IP address of the local area network, you can monitor whether the preset port receives a data packet with a valid address;
当监听到预设端口接收到携带有效地址的数据包,此时则无需再向目标IP地址发送地址探测包,客户端直接解析数据包中携带的有效地址,并向有效地址发送注册认证消息即可。When monitoring the preset port to receive a data packet with a valid address, there is no need to send an address detection packet to the target IP address. The client directly parses the valid address carried in the data packet and sends a registration authentication message to the valid address. Can.
当预设端口未接收到携带有效地址的数据包时,则执行获取本地局域网的各IP地址的步骤。When the preset port does not receive the data packet carrying the valid address, the step of acquiring each IP address of the local area network is performed.
其中,预设端口可以是各客户端预先设定的用于收发有效地址的端口。The preset port may be a port preset by each client for sending and receiving valid addresses.
客户端获取到有效地址即服务端IP地址之后,通过向其它客户端的预设端口传输该有效地址,可以实现各客户端对有效地址的共享,从而进一步提升了局域网内各客户端配置带内监控软件的效率。After the client obtains the effective address, that is, the IP address of the server, by transmitting the effective address to the preset ports of other clients, each client can share the effective address, thereby further improving the configuration of in-band monitoring of each client in the local area network. software efficiency.
图2为本发明实施例提供的一种带内监控软件的自动配置装置的结构示意图,包括获取单元21、选取单元22、发送单元23、判断单元24和配置单元25;2 is a schematic structural diagram of an automatic configuration device for in-band monitoring software provided by an embodiment of the present invention, including an acquisition unit 21, a
获取单元21,用于检测到安装带内监控软件时,获取本地局域网的各IP地址;The obtaining unit 21 is used for obtaining each IP address of the local area network when detecting that the in-band monitoring software is installed;
选取单元22,用于从所有IP地址中随机选取一个目标IP地址;
发送单元23,用于向目标IP地址发送地址探测包;The sending unit 23 is used to send the address detection packet to the target IP address;
判断单元24,用于判断接收到的响应信息中携带的IP地址是否为有效地址;Judging unit 24, for judging whether the IP address carried in the received response information is a valid address;
发送单元23还用于当接收到的响应信息中携带的IP地址为有效地址时,则向有效地址发送注册认证消息;The sending unit 23 is further configured to send a registration authentication message to the valid address when the IP address carried in the received response information is an effective address;
配置单元25,用于根据接收的配置信息,完成带内监控软件的配置;The configuration unit 25 is used to complete the configuration of the in-band monitoring software according to the received configuration information;
选取单元22还用于当接收到的响应信息中携带的IP地址不是有效地址时,从剩余的IP地址中随机选取一个新的目标IP地址,并触发发送单元23向新的目标IP地址发送地址探测包;直至接收到携带有效地址的响应信息则结束操作。The
可选地,还包括次数判断单元;Optionally, it also includes a number of times judgment unit;
次数判断单元,用于在从剩余的IP地址中随机选取一个新的目标IP地址之前,判断向目标IP地址发送地址探测包的次数是否超过预设阈值;The times judgment unit is used to judge whether the times of sending the address detection packet to the target IP address exceeds a preset threshold before randomly selecting a new target IP address from the remaining IP addresses;
若是,则触发选取单元从剩余的IP地址中随机选取一个新的目标IP地址;If so, then trigger the selection unit to randomly select a new target IP address from the remaining IP addresses;
若否,则触发发送单元重新向目标IP地址发送地址探测包。If not, trigger the sending unit to send the address detection packet to the target IP address again.
可选地,还包括检测单元、第一反馈单元和第二反馈单元;Optionally, further comprising a detection unit, a first feedback unit and a second feedback unit;
检测单元,用于当接收到其它客户端发送的地址探测包时,检测自身是否已经获取到服务端IP地址;若是,则触发第一反馈单元;若否,则触发第二反馈单元;The detection unit is used to detect whether it has obtained the server IP address when receiving the address detection packet sent by other clients; if so, trigger the first feedback unit; if not, trigger the second feedback unit;
第一反馈单元,用于向发送地址探测包的客户端反馈携带有服务端IP地址的响应信息;a first feedback unit, configured to feed back the response information carrying the IP address of the server to the client sending the address detection packet;
第二反馈单元,用于向发送地址探测包的客户端反馈携带空地址的响应信息。The second feedback unit is configured to feed back response information carrying a null address to the client that sends the address detection packet.
可选地,发送单元还用于当接收到的响应信息中携带的IP地址为有效地址时,向除目标IP地址以及有效地址外的其它IP地址发送携带有有效地址的数据包。Optionally, the sending unit is further configured to send a data packet carrying a valid address to other IP addresses except the target IP address and the valid address when the IP address carried in the received response information is a valid address.
可选地,还包括监听单元和解析单元;Optionally, it also includes a monitoring unit and a parsing unit;
监听单元,用于监听预设端口是否接收到携带有效地址的数据包;若是,则触发解析单元;若否,则触发获取单元执行获取本地局域网的各IP地址的步骤;a monitoring unit for monitoring whether the preset port receives a data packet carrying a valid address; if so, triggering the parsing unit; if not, triggering the obtaining unit to execute the steps of obtaining each IP address of the local area network;
解析单元,用于解析数据包中携带的有效地址,并向有效地址发送注册认证消息。The parsing unit is used to parse the valid address carried in the data packet, and send a registration authentication message to the valid address.
图2所对应实施例中特征的说明可以参见图1所对应实施例的相关说明,这里不再一一赘述。For the description of the features in the embodiment corresponding to FIG. 2 , reference may be made to the relevant description of the embodiment corresponding to FIG. 1 , which will not be repeated here.
由上述技术方案可以看出,检测到安装带内监控软件时,获取本地局域网的各IP地址;从所有IP地址中随机选取一个目标IP地址,并向目标IP地址发送地址探测包。通过随机选取IP地址,可以有效的解决所有客户端均向同一个服务端发送请求,造成请求响应的不及时的问题。判断接收到的响应信息中携带的IP地址是否为有效地址;当响应信息中携带的IP地址为有效地址时,则可以向有效地址发送注册认证消息;并根据接收的配置信息,完成带内监控软件的配置。当响应信息中携带的IP地址为无效地址时,则可以从剩余的IP地址中随机选取一个新的目标IP地址,并向新的目标IP地址发送地址探测包;直至接收到携带有效地址的响应信息则结束操作。采用基于同一个局域网内随机选取IP地址发送地址探测包的方法,可以有效的解决服务端地址变更无法与服务端建立连接的问题,提升了带内监控软件部署的成功率。It can be seen from the above technical solutions that when the installation of the in-band monitoring software is detected, each IP address of the local area network is obtained; a target IP address is randomly selected from all IP addresses, and an address detection packet is sent to the target IP address. By randomly selecting an IP address, it can effectively solve the problem that all clients send requests to the same server, resulting in untimely request responses. Determine whether the IP address carried in the received response information is a valid address; when the IP address carried in the response information is a valid address, a registration authentication message can be sent to the valid address; and according to the received configuration information, complete in-band monitoring software configuration. When the IP address carried in the response information is an invalid address, a new target IP address can be randomly selected from the remaining IP addresses, and an address detection packet is sent to the new target IP address; until a response carrying a valid address is received The message ends the operation. The method of sending address detection packets based on randomly selected IP addresses in the same local area network can effectively solve the problem that the server cannot establish a connection with the server when the address is changed, and improve the success rate of in-band monitoring software deployment.
图3为本发明实施例提供的一种带内监控软件的自动配置装置30的硬件结构示意图,包括:3 is a schematic diagram of the hardware structure of an
存储器31,用于存储计算机程序;
处理器32,用于执行计算机程序以实现如上任意实施例所述的带内监控软件的自动配置方法的步骤。The
本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上任意实施例所述的带内监控软件的自动配置方法的步骤。Embodiments of the present invention further provide 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 automatic configuration method of the in-band monitoring software described in any of the above embodiments is implemented. step.
以上对本发明实施例所提供的一种带内监控软件的自动配置方法、装置和计算机可读存储介质进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The method, device, and computer-readable storage medium for automatic configuration of in-band monitoring software provided by the embodiments of the present invention have been described in detail above. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method. It should be pointed out that for those skilled in the art, without departing from the principle of the present invention, several improvements and modifications can also be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals may further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two, in order to clearly illustrate the possibilities of hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of functionality. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in conjunction with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two. A software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911386498.9A CN111082996B (en) | 2019-12-29 | 2019-12-29 | Automatic configuration method, device and medium for in-band monitoring software |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911386498.9A CN111082996B (en) | 2019-12-29 | 2019-12-29 | Automatic configuration method, device and medium for in-band monitoring software |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111082996A CN111082996A (en) | 2020-04-28 |
CN111082996B true CN111082996B (en) | 2022-05-27 |
Family
ID=70319183
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911386498.9A Active CN111082996B (en) | 2019-12-29 | 2019-12-29 | Automatic configuration method, device and medium for in-band monitoring software |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111082996B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113704060B (en) * | 2021-08-21 | 2024-06-07 | 郑州浪潮数据技术有限公司 | Resource monitoring method, system, storage medium and equipment |
CN114996089A (en) * | 2022-05-31 | 2022-09-02 | 济南浪潮数据技术有限公司 | Method, device, system and medium for supervising server in-band acquisition software |
CN115001958B (en) * | 2022-05-31 | 2024-06-14 | 郑州浪潮数据技术有限公司 | Data transmission method, server in-band device and server management device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106059888A (en) * | 2016-07-29 | 2016-10-26 | 浪潮(北京)电子信息产业有限公司 | IP (Internet Protocol) address assignment method and device based on open network operating system |
CN106897191A (en) * | 2017-02-25 | 2017-06-27 | 郑州云海信息技术有限公司 | A kind of method and apparatus being monitored to system |
CN108632221A (en) * | 2017-03-22 | 2018-10-09 | 华为技术有限公司 | Position method, equipment and the system of the compromised slave in Intranet |
CN109981365A (en) * | 2019-03-26 | 2019-07-05 | 深圳市科力锐科技有限公司 | Data decryptor method, apparatus, user equipment and storage medium |
CN110417789A (en) * | 2019-08-01 | 2019-11-05 | 深圳市网心科技有限公司 | Server connection method, electronic device, system and medium |
-
2019
- 2019-12-29 CN CN201911386498.9A patent/CN111082996B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106059888A (en) * | 2016-07-29 | 2016-10-26 | 浪潮(北京)电子信息产业有限公司 | IP (Internet Protocol) address assignment method and device based on open network operating system |
CN106897191A (en) * | 2017-02-25 | 2017-06-27 | 郑州云海信息技术有限公司 | A kind of method and apparatus being monitored to system |
CN108632221A (en) * | 2017-03-22 | 2018-10-09 | 华为技术有限公司 | Position method, equipment and the system of the compromised slave in Intranet |
CN109981365A (en) * | 2019-03-26 | 2019-07-05 | 深圳市科力锐科技有限公司 | Data decryptor method, apparatus, user equipment and storage medium |
CN110417789A (en) * | 2019-08-01 | 2019-11-05 | 深圳市网心科技有限公司 | Server connection method, electronic device, system and medium |
Also Published As
Publication number | Publication date |
---|---|
CN111082996A (en) | 2020-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9942111B2 (en) | Method for remotely acquiring in real time log | |
CN111082996B (en) | Automatic configuration method, device and medium for in-band monitoring software | |
US8543692B2 (en) | Network system | |
CN102075508B (en) | Vulnerability disclosure system and method aiming at network protocol | |
CN112165447B (en) | WAF equipment-based network security monitoring method, system and electronic device | |
US20130136131A1 (en) | Relay device and activation method of electronic device | |
CN114629822B (en) | Link detection method, device, electronic equipment and storage medium | |
CN106470136B (en) | Platform testing method and platform testing system | |
US7363483B2 (en) | System for rebooting relay apparatus based on detection of completely no communication establishment data presence | |
CN112637344A (en) | Monitoring method, equipment and device of Internet of things equipment and storage medium | |
CN112466303B (en) | Device discovery method, device, storage medium, and electronic apparatus | |
KR101139836B1 (en) | Method and system for two-phase mechanism for discovering web services based management service | |
US9043472B1 (en) | Method and system for providing transmission control protocol dead connection detection | |
US9560141B2 (en) | Method and apparatus of performing peer-to-peer communication establishment | |
CN107484227B (en) | Wifi networking multi-hot-spot control communication method | |
CN104570967B (en) | Long-range control method and system based on android system | |
CN113810427A (en) | Penetration testing method, terminal equipment and storage medium | |
CN118764408A (en) | Network connectivity detection method, device, server and storage medium | |
CN116455868B (en) | Integrated service system based on universal domain name resolution and private protocol intranet penetration | |
CN117118936A (en) | Message processing method, device, equipment and readable storage medium | |
EP1921799A1 (en) | A method for detecting the ipv6 network application layer protocol | |
CN103501240B (en) | A kind of method of discovering device, apparatus and system | |
CN113676369B (en) | Network quality analysis method, data receiving server and storage medium | |
JP5381247B2 (en) | Load distribution device, load distribution method, load distribution program, and load distribution system | |
KR20090071542A (en) | Host impersonation network device and its method |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |