Disclosure of Invention
In order to solve the technical problems, the invention provides a monitoring data transmission method and a monitoring data transmission device, which can effectively realize the transmission of monitoring data and save network resources.
In order to achieve the object of the present invention, the present invention provides a monitoring data transmission method, including: acquiring network flow information of different network interfaces of a server;
and analyzing the load pressure of the network interface according to the obtained network flow information, and determining that the network interface with low load pressure is used for transmitting monitoring data.
The network interface comprises an IP network interface and a mainboard management controller BMC network interface.
The method also comprises the following steps: presetting a first monitoring period, and dividing the first monitoring period into a plurality of second monitoring periods;
the analyzing the load pressure of the network interface and the determining that the network interface with the small load pressure is used for transmitting the monitoring data specifically includes:
monitoring the network flow of the IP network interface and the BMC network interface according to a second monitoring period, and in a first monitoring period, if the flow value of the IP network interface/the BMC network interface is smaller than the network flow value of the BMC network interface/the IP network interface for a preset number of times, considering the first monitoring period as an effective monitoring period;
and if the plurality of first monitoring periods which are continuously preset and monitored are all effective monitoring periods, considering that the load pressure of the IP network interface/BMC network interface is small, and determining that the IP network interface/BMC network interface is used for transmitting monitoring data.
If the first monitoring period is not a valid monitoring period, the method further comprises: and continuing to execute the step of acquiring the network flow information of different network interfaces of the server.
The first monitoring period is 10 minutes, and the second monitoring period is 1 minute;
the preset times are 7 times;
the preset monitoring number is 3.
The invention also provides a monitoring data transmission device, which at least comprises a flow monitoring unit and a transmission processing unit; wherein,
the traffic monitoring unit is used for monitoring different network interfaces of the server and acquiring network traffic information;
and the transmission processing unit is used for analyzing the load pressure of the network interface according to the obtained network flow information and determining that the network interface with small load pressure is used for transmitting the monitoring data.
The network interface comprises an IP network interface and a BMC network interface.
In the transmission processing unit, a first monitoring period is preset, and the first monitoring period is divided into a plurality of second monitoring periods, and the transmission processing unit is specifically configured to:
monitoring the network flow of the IP network interface and the BMC network interface according to a second monitoring period, and in a first monitoring period, if the flow value of the IP network interface/the BMC network interface is smaller than the network flow value of the BMC network interface/the IP network interface for a preset number of times, considering the first monitoring period as an effective monitoring period;
and if the plurality of first monitoring periods which are continuously preset and monitored are all effective monitoring periods, considering that the load pressure of the IP network interface/BMC network interface is small, and determining that the IP network interface/BMC network interface is used for transmitting monitoring data.
The first monitoring period is not an effective monitoring period, and the transmission processing unit is further configured to notify the traffic monitoring unit to continue to acquire the network traffic information.
The apparatus also includes a monitoring data collection unit for receiving monitoring data via the determined network interface.
Compared with the prior art, the method at least comprises the steps of obtaining the network flow information of different network interfaces of the server; and analyzing the load pressure of the network interface according to the obtained network flow information, and determining that the network interface with low load pressure is used for transmitting monitoring data. According to the technical scheme provided by the invention, the network interface with low network load pressure is selected to transmit the monitoring data, so that the network interface with high network load pressure is avoided undoubtedly, the transmission of the monitoring data is effectively realized, the congestion of the network interface is avoided, and the network resource is saved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 1 is a flowchart of a monitoring data transmission method according to the present invention, as shown in fig. 1, including:
step 100: and acquiring network flow information of different network interfaces of the server.
The server in this step manages and includes one or more monitoring nodes.
The network interface in this step includes, but is not limited to, an IP network interface, and a Baseboard Management Controller (BMC) network interface. The IP network interface is a network port for installing an IP address of an operating system, and the BMC network interface is a management network port on the equipment mainboard.
Through the steps, the network flow of the IP network interface of the server and the network flow of the BMC network interface can be monitored, and the collected flow information is stored in the database. How to monitor the IP network interface and the BMC network interface of the server in this step is a common technical means of those skilled in the art, and the specific implementation thereof is not used to limit the protection scope of the present invention, and is not described herein again.
Step 101: and analyzing the load pressure of the network interface according to the obtained network flow information, and determining that the network interface with low load pressure is used for transmitting monitoring data.
Analyzing the load pressure of the network interface in this step, and determining that the network interface with the small load pressure is used for transmitting the monitoring data specifically includes:
presetting a first monitoring period, and dividing the first monitoring period into a plurality of second monitoring periods; the first monitoring period and the second monitoring period may be set according to an actual application scenario, for example, the first monitoring period is 10 minutes, and the second monitoring period is 1 minute.
Monitoring the network flow of the IP network interface and the BMC network interface according to a second monitoring period;
in a first monitoring period, if the flow value of the IP network interface is smaller than the network flow value of the BMC network interface for a preset number of times (such as 7 times or more than 7 times), the first monitoring period is considered to be an effective monitoring period; if the continuous preset monitoring number (for example, 3) of first monitoring periods are all effective monitoring periods, the load pressure of the IP network interface is considered to be small, and the IP network interface is determined to be used for transmitting monitoring data.
In a first monitoring period, if the flow value of the BMC network interface is smaller than the network flow value of the IP network interface for preset times (such as 7 times or more than 7 times), the first monitoring period is considered to be an effective monitoring period; if the continuous preset monitoring number (for example, 3) of first monitoring periods are all effective monitoring periods, the load pressure of the BMC network interface is considered to be small, and the BMC network interface is determined to be used for transmitting monitoring data.
If the first monitoring period is not a valid monitoring period, the method returns to step 100 to continue to acquire the network traffic information to continue to find a valid first monitoring period. That is to say, according to the technical scheme provided by the invention, the network interface for monitoring data transmission can be switched in real time according to the change of the load pressure, so that the network interface for subsequently monitoring data transmission is ensured to be the network interface with low current load pressure.
It should be noted that, when the IP network interface is used to transmit the monitoring data, the existing monitoring Agent uniformly collects the monitoring data of the monitoring node, such as software information and hardware information, and interacts with the monitoring information collection unit through the IP network interface to monitor the monitoring node;
when the BMC network interface is used for transmitting monitoring data, the existing monitoring Agent sends the collected software and hardware information to the BMC, and the BMC interacts with the monitoring information collection unit through the BMC network interface so as to monitor the monitoring node.
According to the technical scheme, the network interface with low network load pressure is selected to transmit the monitoring data, so that the network interface with high network load pressure is avoided undoubtedly, the transmission of the monitoring data is effectively realized, the congestion of the network interface is avoided, and the network resources are saved.
Fig. 2 is a schematic diagram of a structure of a monitoring data transmission device according to the present invention, as shown in fig. 2, which at least includes a flow monitoring unit and a transmission processing unit; wherein,
and the flow monitoring unit is used for monitoring different network interfaces of the server and acquiring network flow information. The server administration includes one or more monitoring nodes.
And the transmission processing unit is used for analyzing the load pressure of the network interface according to the obtained network flow information and determining that the network interface with small load pressure is used for transmitting the monitoring data.
Wherein, in the transmission processing unit, a first monitoring period is preset, and the first monitoring period is divided into a plurality of second monitoring periods, and the transmission processing unit is specifically configured to:
monitoring the network flow of the IP network interface and the BMC network interface according to a second monitoring period;
in a first monitoring period, if the flow value of the IP network interface is smaller than the network flow value of the BMC network interface for a preset number of times, the first monitoring period is considered to be an effective monitoring period; and if the continuous preset monitoring plurality of first monitoring periods are all effective monitoring periods, considering that the load pressure of the IP network interface is small, and determining that the IP network interface is used for transmitting the monitoring data.
If the flow value of the BMC network interface is smaller than the network flow value of the IP network interface for a preset number of times, the first monitoring period is considered to be an effective monitoring period; and if the plurality of first monitoring periods which are continuously preset and monitored are all effective monitoring periods, considering that the load pressure of the BMC network interface is small, and determining that the BMC network interface is used for transmitting monitoring data.
If the first monitoring period is not a valid monitoring period, the transmission processing unit is further configured to notify the traffic monitoring unit to continue to acquire the network traffic information.
The network interface in the invention includes but is not limited to an IP network interface and a BMC network interface.
The device also comprises a monitoring data collecting unit which is used for receiving the monitoring data through the determined network interface.
It should be noted that, when the IP network interface is used to transmit the monitoring data, the existing monitoring Agent uniformly collects the monitoring data of the monitoring node, such as software information and hardware information, and interacts with the monitoring information collection unit through the IP network interface to monitor the monitoring node;
when the BMC network interface is used for transmitting monitoring data, the existing monitoring Agent uniformly collects the monitoring data of the monitoring node, such as software information and hardware information, sends the monitoring data to the BMC, and then the BMC interacts with the monitoring information collection unit through the BMC network interface of the BMC so as to monitor the monitoring node.
Although the embodiments of the present invention have been described above, the above description is only for the convenience of understanding the present invention, and is not intended to limit the present invention. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.