CN114500246A - Network connection state monitoring method and device, computer equipment and storage medium - Google Patents

Network connection state monitoring method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114500246A
CN114500246A CN202210138698.8A CN202210138698A CN114500246A CN 114500246 A CN114500246 A CN 114500246A CN 202210138698 A CN202210138698 A CN 202210138698A CN 114500246 A CN114500246 A CN 114500246A
Authority
CN
China
Prior art keywords
directory
container
name
monitoring
label
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.)
Granted
Application number
CN202210138698.8A
Other languages
Chinese (zh)
Other versions
CN114500246B (en
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.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities 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 Ping An Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202210138698.8A priority Critical patent/CN114500246B/en
Publication of CN114500246A publication Critical patent/CN114500246A/en
Application granted granted Critical
Publication of CN114500246B publication Critical patent/CN114500246B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0677Localisation of faults
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/301Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is a virtual computing platform, e.g. logically partitioned systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/04Processing captured monitoring data, e.g. for logfile generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Environmental & Geological Engineering (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention relates to the technical field of artificial intelligence, and discloses a network connection state monitoring method, a network connection state monitoring device, computer equipment and a storage medium, wherein the method comprises the steps of acquiring a state information list corresponding to each monitoring node in a cluster to be monitored; determining a target process directory from a preset directory storage area, and performing regular judgment on the target process directory to determine a container process directory from all the target process directories; one container process directory corresponds to one process label; determining a container name, a space name and a combined name corresponding to the process label from the state information list, and generating a data acquisition label corresponding to the process label according to the container name, the space name and the combined name corresponding to the process label; and acquiring state monitoring data from the cluster to be monitored according to the data acquisition tag, and determining the network connection state of the cluster to be monitored according to the state monitoring data. The invention improves the efficiency and the accuracy of monitoring the network connection state.

Description

Network connection state monitoring method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of network monitoring technologies, and in particular, to a method and an apparatus for monitoring a network connection status, a computer device, and a storage medium.
Background
The network connection state is important data for health monitoring and troubleshooting of the system and the application, and fault location can be rapidly carried out on the system and the application by collecting the data of the network connection state, so that the fault recovery speed of the system is improved.
When fault location is performed for an application or system in some clusters, data of a network connection state is lacked. In the prior art, query commands are often required to be created, and then data query is performed by executing the query commands in a specified container, and the method cannot directly perform fault location through data in a network connection state, so that the execution efficiency is low, and the fault recovery efficiency of the system is low.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for monitoring a network connection state, a computer device, and a storage medium, so as to solve the problem in the prior art that a network connection state fault location execution efficiency is low, thereby resulting in a low fault recovery efficiency.
A network connection state monitoring method comprises the following steps:
receiving a monitoring instruction of a cluster to be monitored; the cluster to be monitored comprises at least one monitoring node;
acquiring a state information list corresponding to each monitoring node; wherein, one monitoring node corresponds to one state information list;
determining a target process directory from a preset directory storage area, and performing regular judgment on the target process directory to determine a container process directory from all the target process directories; one of the container process directories corresponds to one of the process labels;
determining a container name, a space name and a combined name corresponding to the process label from the state information list, and generating a data acquisition label corresponding to the process label according to the container name, the space name and the combined name corresponding to the process label;
and acquiring state monitoring data from the cluster to be monitored according to the data acquisition label, and determining the network connection state of the cluster to be monitored according to the state monitoring data.
A network connection status monitoring apparatus comprising:
the monitoring instruction receiving module is used for receiving a monitoring instruction of a cluster to be monitored; the cluster to be monitored comprises at least one monitoring node;
a status information list acquisition module, configured to acquire a status information list corresponding to each monitoring node; wherein, one monitoring node corresponds to one state information list;
the process directory screening module is used for determining a target process directory from a preset directory storage area and performing regular judgment on the target process directory so as to determine a container process directory from all the target process directories; one of the container process directories corresponds to one of the process labels;
the data acquisition label generation module is used for determining a container name, a space name and a combined name corresponding to the process label from the state information list and generating a data acquisition label corresponding to the process label according to the container name, the space name and the combined name corresponding to the same process label;
and the network connection state monitoring module is used for acquiring state monitoring data from the cluster to be monitored according to the data acquisition label and determining the network connection state of the cluster to be monitored according to the state monitoring data.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the network connection status monitoring method when executing the computer program.
A computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described network connection state monitoring method.
The method comprises the steps of receiving a monitoring instruction of a cluster to be monitored; the cluster to be monitored comprises at least one monitoring node; acquiring a state information list corresponding to the monitoring node; wherein, one monitoring node corresponds to one state information list; determining a target process directory from a preset directory storage area, and performing regular judgment on the target process directory to determine a container process directory from all the target process directories; one of the container process directories corresponds to one of the process labels; determining a container name, a space name and a combined name corresponding to the process label from the state information list, and generating a data acquisition label corresponding to the process label according to the container name, the space name and the combined name corresponding to the process label; and acquiring state monitoring data from the cluster to be monitored according to the data acquisition tags corresponding to the process tags, and determining the network connection state of the cluster to be monitored according to the state monitoring data.
According to the invention, only one preset data acquisition end is arranged in each monitoring node, so that one monitoring node only corresponds to one state information list, and further, the network information files of each process label, such as the container name, the space name, the combination name and the like, can be determined through the state information list, so that the corresponding data acquisition label is generated according to the network information files, and further, the state monitoring data can be obtained according to the data acquisition label, therefore, the purpose of directly obtaining the state monitoring data to monitor the network connection state of the cluster to be monitored is achieved, and the efficiency and the accuracy of network connection state monitoring are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic diagram of an application environment of a network connection status monitoring method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for monitoring the status of network connections according to an embodiment of the present invention;
FIG. 3 is a schematic block diagram of a network connection status monitoring apparatus according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
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, 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.
The network connection state monitoring method provided by the embodiment of the invention can be applied to the application environment shown in fig. 1. Specifically, the network connection state monitoring method is applied to a network connection state monitoring system, the network connection state monitoring system comprises a client and a server shown in fig. 1, and the client and the server communicate through a network to solve the problem that in the prior art, the network connection state fault location execution efficiency is low, so that the fault recovery efficiency is low. The client is also called a user side, and refers to a program corresponding to the server and providing local services for the client. The client may be installed on, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform.
In an embodiment, as shown in fig. 2, a network connection status monitoring method is provided, which is described by taking the server in fig. 1 as an example, and includes the following steps:
s10: receiving a monitoring instruction of a cluster to be monitored; the cluster to be monitored comprises at least one monitoring node.
It can be understood that, in the kubernets cluster to be monitored proposed in this embodiment, a plurality of monitoring nodes exist in the cluster to be monitored. The monitoring nodes may be nodes arranged in different applications in the cluster to be monitored.
S20: acquiring a state information list corresponding to each monitoring node; wherein one monitoring node corresponds to one status information list.
It can be understood that, in this embodiment, deployment is performed first by using kubernets daemon resources, and a host directory of monitoring nodes is mounted and mapped to a preset directory storage area, so that each monitoring node has only one preset data acquisition end, that is, it is characterized that one monitoring node can acquire one state information list only through the corresponding preset data acquisition end. The state information list is a pod information list, the state information list includes a network information file of at least one process label, and the network information file includes data such as a container name corresponding to the process label, a container label corresponding to the container name, and a space name.
Specifically, it is indicated in the above description that there is only one preset data acquisition end for one monitoring node, and then data acquisition can be performed through the preset data acquisition end, so that a pod information list corresponding to the monitoring node is screened out by screening the acquired data, that is, the pod information list is a state information list.
S30: determining a target process directory from a preset directory storage area, and performing regular judgment on the target process directory to determine a container process directory from all the target process directories; one of the container process directories corresponds to one of the process tags.
It should be understood that, in the above description, it is indicated that the mount of the host directory of the monitoring node is mapped into the preset directory storage area, and the preset directory storage area includes the host directory of the monitoring node. And a plurality of directories exist in the preset directory storage area, and further, the target process directory needs to be screened out by traversing all the directories in the preset directory storage area and according to the directory names of the directories. The target process directory is a directory that may contain process tags.
Further, in this embodiment, the purpose of performing the regular judgment on the target process directory is to determine whether the target process directory represents a container process, and then, by setting a preset regular expression, matching fields in the target process directory with fields of the regular expression, further, screen out a container process directory from all the target process directories. Wherein, a container process directory corresponds to a process label, wherein the process label can be determined according to the directory name of the container process directory.
S40: and determining a container name, a space name and a combined name corresponding to the process label from the state information list, and generating a data acquisition label corresponding to the process label according to the container name, the space name and the combined name corresponding to the process label.
Specifically, in the above description, it is indicated that the state information list includes data such as a container name, a container label corresponding to the container name, and a space name, and then, after the target process directory is judged regularly to determine the container process directory from all the target process directories, the container label is extracted from the container process directory, and then the container label is matched with fields in the state information list, so as to determine the container name corresponding to the container process directory, and further associate the process label corresponding to the container process directory with the container name, and further, by collecting and analyzing the state information list periodically in a set collection period, information such as a space name or a combination name corresponding to the process label can be obtained from the state information list, and further, according to the container name corresponding to the same process label, and generating a data acquisition label corresponding to the process label by the space name and the combined name.
S50: and acquiring state monitoring data from the cluster to be monitored according to the data acquisition label, and determining the network connection state of the cluster to be monitored according to the state monitoring data.
It can be understood that, in the above description, deployment is performed by using kubernetes daemon resource, and a host directory of monitoring nodes is mounted and mapped into a preset directory storage area, so that each monitoring node has only one preset data acquisition end, and meanwhile, the kubernetes daemon resource is also exposed in a cluster to be monitored as a server, and a corresponding server monitor resource is created, and further, in the status information list, a container name, a space name and a combination name corresponding to the process tag are determined, and after a data acquisition tag corresponding to the process tag is generated according to the container name, the space name and the combination name corresponding to the same process tag, status monitoring data corresponding to each process tag is acquired from the cluster to be monitored by a collector inside a data acquisition program according to the data acquisition tag exposed in the cluster to be monitored by the process tag, therefore, the network connection state of the cluster to be monitored is determined according to the acquired state monitoring data.
In this embodiment, each monitoring node is provided with and only deploys one preset data acquisition end, so that one monitoring node corresponds to only one state information list, and then the network information file of each process label can be determined through the state information list, such as the above container name, space name, combination name, and the like, so as to generate a corresponding data acquisition label according to the network information file, and further obtain state monitoring data according to the data acquisition label, thereby achieving the purpose of directly obtaining the state monitoring data to monitor the network connection state of the cluster to be monitored, and improving the efficiency and accuracy of network connection state monitoring.
In an embodiment, before the step S20, that is, before the obtaining the status information list corresponding to each monitoring node, the method further includes:
and carrying out process data acquisition on the management interface of the cluster to be monitored through a preset data acquisition end to obtain interface acquisition data.
It can be understood that, in the above description, it indicates that there is only one preset data acquisition end in one monitoring node, and therefore the preset data acquisition end of each monitoring node can perform process data acquisition on the management interface of the cluster to be monitored, but the acquired interface acquisition data is not necessarily all corresponding to the monitoring node corresponding to the preset data acquisition end, and therefore the interface acquisition data needs to be screened. The management interface in the cluster to be monitored is an interface server in the cluster to be monitored, and the interface server stores process data (such as a process tag and running data corresponding to the process tag) of each interface object (such as the monitoring node) in the cluster to be monitored.
Acquiring host name labels corresponding to the monitoring nodes; wherein one of the monitoring nodes is associated with a host name tag.
It can be understood that each monitoring node has a host name tag, that is, each monitoring node belongs to a unique host, and the host name tag is a unique identifier of the monitoring node.
And screening out node process data corresponding to each monitoring node from the interface collected data according to the host name label, and generating a state information list according to the node process data corresponding to each monitoring node.
Specifically, after the host name tags corresponding to the monitoring nodes are obtained, the interface collected data can be screened according to the host name tags corresponding to the monitoring nodes, and then the node process data corresponding to the monitoring nodes are screened from the interface collected data, so that a state information list is generated according to the node process data corresponding to the monitoring nodes in the interface collected data.
Furthermore, in the running process of the application program in the cluster to be monitored, real-time data acquisition can be performed on the management interface of the cluster to be monitored through the preset data acquisition end, so that the acquired interface acquisition data can be continuously updated, errors caused by the interface acquisition data when the network connection state is disconnected at a certain moment to the network connection state of the subsequent cluster to be monitored can be avoided, and the accuracy of judging the network connection state of the cluster to be monitored is further improved.
In an embodiment, the step S30, namely, the determining the target process directory from the preset directory storage area, includes:
acquiring all the directories to be screened from the preset directory storage area; one of the directories to be screened corresponds to one directory name.
It can be understood that, in the above description, it is indicated that the preset directory storage area includes the host directories of each monitoring node, the host directory is the directory to be screened, and one directory to be screened has a directory name, and the directory name can perform directory name identification on the directory to be screened, and then perform field extraction on the field located at the directory name position, so as to obtain the directory name corresponding to each directory to be screened.
And traversing each directory to be screened to determine whether the directory name of the directory to be screened conforms to a preset directory name format.
Specifically, after all the directories to be screened are acquired from the preset directory storage area, directory name traversal can be performed on all the directories to be screened, so that whether the directory names of the directories to be screened conform to the preset directory name format or not is determined. It can be understood that the preset directory name format in this embodiment refers to an integer digital format, that is, after the directory name of the directory to be screened is obtained, it is determined whether the directory name of each directory to be screened is in the integer digital format, and if the directory name of the directory to be screened is in the integer digital format, the directory to be screened is recorded as the target process directory; and if the format of the directory name of the directory to be screened is not the integer number format, representing that the directory to be screened is not the target process directory.
And recording the directory to be screened corresponding to the directory name conforming to the preset directory name format as the target process directory.
Specifically, after traversing each directory to be filtered to determine whether the directory name of the directory to be filtered conforms to the preset directory name format, recording the directory to be filtered corresponding to the directory name conforming to the preset directory name format as the target process directory.
In an embodiment, in step S30, that is, the performing a regular judgment on the target process directory to determine the container process directory from all the target process directories includes:
and acquiring a target process file in each target process directory, and performing file analysis on the target process file to acquire a target process field in the target process file.
It can be understood that each target process directory has a corresponding target process file, the target process file is a cmdline file in the target process directory, and after the target process file in the target process directory is acquired, the target process file can be subjected to file analysis, so that a field of the analyzed target process file is extracted, that is, a target process field.
And acquiring a preset sample regular field, and matching each target process field with the preset sample regular field.
Illustratively, the sample regular field may be, for example, "container-shim-namespace moby-workdir/var/lib/container/io. container.runtime. v.1. linux/moby/(
-address "; the preset sample regular field can be adjusted according to different clusters to be monitored. Specifically, after the target process file is subjected to file analysis to obtain the target process field in the target process file, a preset sample regular field is obtained, and then each target process field is matched with the preset sample regular field.
And recording a target process directory corresponding to the target process field matched with the preset sample regular field as the container process directory.
Specifically, after each target process field is matched with the preset sample regular field, if the target process field is successfully matched with the preset sample regular field, the target process directory corresponding to the target process field matched with the preset sample regular field is recorded as the container process directory.
In an embodiment, after the recording the target process directory corresponding to the target process field matched with the preset sample regular field as the container process directory, the method further includes:
and performing character recognition on a target process field of the container process directory to determine whether the target process field contains a target character.
It is to be understood that the target characters in this implementation refer to parenthesized characters. Specifically, after the target process directory corresponding to the target process field matched with the preset sample regular field is recorded as the container process directory, character recognition is performed on the target process field of the container process directory, so as to determine whether the target process field contains a target character, that is, whether the target process field contains a bracket character.
And when the target process field contains a target character, detecting target position information of the target character in the target process field.
Specifically, after character recognition is performed on a target process field of the container process directory to determine whether the target process field contains a target character, if the target process field contains the target character, target position information of the target character in the target process field is detected. It is to be understood that the target character is indicated as a bracket character in the above description, and therefore, the position information of the left bracket character and the position information of the right bracket character among the bracket characters need to be determined from the target process field.
Further, if the target process field does not contain the target character, the target process field is sent to a preset receiver, so that the preset receiver determines the container label from the target process field and returns the container label. The preset receiver may be a sender of the monitoring instruction.
And extracting fields of the target process fields according to the target position information, and recording the extracted fields as container labels corresponding to the container process directory.
Specifically, after the target position information of the target character in the target process field is detected, according to the target position information, that is, according to the position information of the left bracket character and the position information of the right bracket character, a field between the position information of the left bracket character and the position information of the right bracket character is extracted from the target process field, and the extracted field is recorded as a container tag corresponding to a container process directory.
In an embodiment, the step S40, that is, determining the container name corresponding to the process tag from the status information list, includes:
acquiring all list tags in the state information list; one of the state information lists comprises at least one list tag, and one list tag corresponds to one list name.
It should be understood that, in the above description, the status information list refers to a pod information list, and the status information list includes a network information file of at least one process tag, and the network information file includes a container name corresponding to the process tag, a container tag corresponding to the container name, a space name, and other data.
Acquiring a container label corresponding to the container process directory, and matching the container label with each list label; one of the list tags is associated with a list name.
Specifically, in the above step, field extraction is performed on the target process field according to the target location information, and the extracted field is recorded as a container tag corresponding to the container process directory, that is, it indicates that one container process directory corresponds to one container tag, so that the container tag corresponding to the container process directory can be matched with each list tag, so as to query the list tag corresponding to the container tag in the state information list.
When the list tag matched with the container tag exists, recording a list name corresponding to the list tag matched with the container tag as the container name.
Specifically, after the container label is matched with each of the list labels, if there is a list label matching the container label, the list name corresponding to the list label matching the container label is recorded as the container name. It is to be understood that, in the above description, it is indicated that one container process directory corresponds to one container tag, and one container process directory corresponds to one process tag, so that the container name corresponds to the process tag, and furthermore, the network information file including at least one process tag in the state information list includes data such as a container name corresponding to the process tag, a container tag corresponding to the container name, a space name, and the like, so that after the container name corresponding to the process tag is determined, the space name, the combination name corresponding to the process tag corresponding to the container name can be determined from the state information list.
In an embodiment, after matching the container label with each of the list labels, the method further includes:
and when the container label is not matched with all the list labels, generating a matching failure instruction containing the container label, and sending the matching failure instruction to a preset receiver.
Specifically, after the container tag is matched with each list tag, if the container tag is not matched with all the list tags, because the container tag corresponds to the container process directory, when the target process directory is the container process directory, the target process directory inevitably has the list tag matched with the corresponding container tag in the state information list, and if the target process directory does not exist, the target process directory corresponding to the container tag is determined as the container process directory by mistake or the container tag is extracted by mistake, so that a matching failure instruction including the container tag is generated, and the matching failure instruction is sent to a preset receiver, so that the preset receiver determines the accuracy of the container tag.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a network connection status monitoring apparatus is provided, and the network connection status monitoring apparatus corresponds to the network connection status monitoring methods in the above embodiments one to one. As shown in fig. 3, the network connection status monitoring apparatus includes a monitoring instruction receiving module 10, a status information list obtaining module 20, a process directory screening module 30, a data collection tag generating module 40, and a network connection status monitoring module 50. The functional modules are explained in detail as follows:
a monitoring instruction receiving module 10, configured to receive a monitoring instruction of a cluster to be monitored; the cluster to be monitored comprises at least one monitoring node;
a status information list obtaining module 20, configured to obtain a status information list corresponding to each monitoring node; wherein, one monitoring node corresponds to one state information list;
the process directory screening module 30 is configured to determine a target process directory from a preset directory storage area, and perform regular judgment on the target process directory to determine a container process directory from all the target process directories; one of the container process directories corresponds to one of the process labels;
a data acquisition tag generation module 40, configured to determine, from the state information list, a container name, a space name, and a combination name corresponding to the process tag, and generate a data acquisition tag corresponding to the process tag according to the container name, the space name, and the combination name corresponding to the process tag;
and the network connection state monitoring module 50 is configured to collect state monitoring data from the cluster to be monitored according to the data collection tag, and determine a network connection state of the cluster to be monitored according to the state monitoring data.
Preferably, the network connection status monitoring apparatus further includes:
the data acquisition module is used for acquiring data of the management interface of the cluster to be monitored through a preset data acquisition end to obtain interface acquisition data;
a host name tag obtaining module, configured to obtain a host name tag corresponding to each monitoring node; wherein one of the monitoring nodes is associated with a host name tag;
and the data matching module is used for screening out a state information list corresponding to each monitoring node from the interface collected data according to each host name label.
Preferably, the process catalog filtering module 30 includes:
the to-be-screened directory acquiring unit is used for acquiring all the to-be-screened directories from the preset directory storage area; one directory to be screened corresponds to one directory name;
the directory traversal unit is used for traversing each directory to be screened so as to determine whether the directory name of the directory to be screened conforms to a preset directory name format;
and the target process directory determining unit is used for recording the directory to be screened corresponding to the directory name conforming to the preset directory name format as the target process directory.
Preferably, the process catalog filtering module 30 further includes:
the file analysis unit is used for acquiring a target process file in each target process directory and performing file analysis on the target process file to acquire a target process field in the target process file;
the field matching unit is used for acquiring a preset sample regular field and matching each target process field with the preset sample regular field;
and the container process directory determining unit is used for recording the target process directory corresponding to the target process field matched with the preset sample regular field as the container process directory.
Preferably, the network connection status monitoring apparatus further includes:
the character recognition module is used for carrying out character recognition on a target process field of the container process directory so as to determine whether the target process field contains a target character;
a position information detection module, configured to detect, when the target process field includes a target character, target position information of the target character in the target process field;
and the field extraction module is used for carrying out field extraction on the target process field according to the target position information and recording the extracted field as a container label corresponding to the container process directory.
Preferably, the data collection tag generation module 40 includes:
a list tag obtaining unit, configured to obtain all list tags in the status information list; one state information list comprises at least one list label, and one list label corresponds to one list name;
a container label matching unit, configured to obtain a container label corresponding to the container process directory, and match the container label with each list label; one of said list tags being associated with a list name;
a container name determining unit, configured to record, as the container name, a list name corresponding to a list tag matching the container tag when the list tag matching the container tag exists.
Preferably, the data collection tag generation module 40 further includes:
and the matching failure instruction sending unit is used for generating a matching failure instruction containing the container label when the container label is not matched with all the list labels, and sending the matching failure instruction to a preset receiver.
For specific limitations of the network connection status monitoring apparatus, reference may be made to the above limitations of the network connection status monitoring method, which is not described herein again. The modules in the network connection status monitoring apparatus may be implemented wholly or partially by software, hardware, or a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 4. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing data used in the network connection state monitoring method in the above embodiment. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a network connection status monitoring method.
In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the network connection status monitoring method in the above embodiments is implemented.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the network connection status monitoring method in the above-described embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A method for monitoring a network connection status, comprising:
receiving a monitoring instruction of a cluster to be monitored; the cluster to be monitored comprises at least one monitoring node;
acquiring a state information list corresponding to the monitoring node; wherein, one monitoring node corresponds to one state information list;
determining a target process directory from a preset directory storage area, and performing regular judgment on the target process directory to determine a container process directory from all the target process directories; one of the container process directories corresponds to one of the process labels;
determining a container name, a space name and a combined name corresponding to the process label from the state information list, and generating a data acquisition label corresponding to the process label according to the container name, the space name and the combined name corresponding to the process label;
and acquiring state monitoring data from the cluster to be monitored according to the data acquisition label, and determining the network connection state of the cluster to be monitored according to the state monitoring data.
2. The method for monitoring network connection status according to claim 1, wherein before the obtaining the status information list corresponding to each monitoring node, the method further comprises:
process data acquisition is carried out on the management interface of the cluster to be monitored through a preset data acquisition end to obtain interface acquisition data;
acquiring host name labels corresponding to the monitoring nodes; wherein one of the monitoring nodes is associated with a host name tag;
and screening out node process data corresponding to each monitoring node from the interface collected data according to the host name label, and generating a state information list according to the node process data corresponding to each monitoring node.
3. The method for monitoring network connection status according to claim 1, wherein the determining a target process directory from the preset directory storage area comprises:
acquiring all the directories to be screened from the preset directory storage area; one directory to be screened corresponds to one directory name;
traversing each directory to be screened to determine whether the directory name of the directory to be screened conforms to a preset directory name format;
and recording the directory to be screened corresponding to the directory name conforming to the preset directory name format as the target process directory.
4. The method for monitoring network connection status according to claim 1, wherein the performing a regular judgment on the target process directory to determine a container process directory from all target process directories comprises:
acquiring a target process file in each target process directory, and performing file analysis on the target process file to acquire a target process field in the target process file;
acquiring a preset sample regular field, and matching each target process field with the preset sample regular field;
and recording a target process directory corresponding to the target process field matched with the preset sample regular field as the container process directory.
5. The method according to claim 4, wherein after recording a target process directory corresponding to a target process field matched with the preset sample regular field as the container process directory, the method further comprises:
performing character recognition on a target process field of the container process directory to determine whether the target process field contains a target character;
when the target process field contains a target character, detecting target position information of the target character in the target process field;
and extracting fields of the target process field according to the target position information, and recording the extracted fields as container labels corresponding to the container process directory.
6. The method for monitoring network connection status according to claim 1, wherein the determining the container name corresponding to the process tag from the status information list comprises:
acquiring all list tags in the state information list; one state information list comprises at least one list label, and one list label corresponds to one list name;
acquiring a container label corresponding to the container process directory, and matching the container label with each list label; one of said list tags being associated with a list name;
when the list tag matched with the container tag exists, recording a list name corresponding to the list tag matched with the container tag as the container name.
7. The network connection status monitoring method of claim 6, wherein after matching the container label with each of the list labels, further comprising:
and when the container label is not matched with all the list labels, generating a matching failure instruction containing the container label, and sending the matching failure instruction to a preset receiver.
8. A network connection status monitoring apparatus, comprising:
the monitoring instruction receiving module is used for receiving a monitoring instruction of a cluster to be monitored; the cluster to be monitored comprises at least one monitoring node;
a status information list acquisition module, configured to acquire a status information list corresponding to each monitoring node; wherein, one monitoring node corresponds to one state information list;
the process directory screening module is used for determining a target process directory from a preset directory storage area and performing regular judgment on the target process directory so as to determine a container process directory from all the target process directories; one of the container process directories corresponds to one of the process labels;
the data acquisition label generation module is used for determining a container name, a space name and a combined name corresponding to the process label from the state information list and generating a data acquisition label corresponding to the process label according to the container name, the space name and the combined name corresponding to the process label;
and the network connection state monitoring module is used for acquiring state monitoring data from the cluster to be monitored according to the data acquisition label and determining the network connection state of the cluster to be monitored according to the state monitoring data.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the network connection status monitoring method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the network connection status monitoring method according to any one of claims 1 to 7.
CN202210138698.8A 2022-02-15 2022-02-15 Network connection state monitoring method and device, computer equipment and storage medium Active CN114500246B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210138698.8A CN114500246B (en) 2022-02-15 2022-02-15 Network connection state monitoring method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210138698.8A CN114500246B (en) 2022-02-15 2022-02-15 Network connection state monitoring method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114500246A true CN114500246A (en) 2022-05-13
CN114500246B CN114500246B (en) 2023-09-01

Family

ID=81480637

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210138698.8A Active CN114500246B (en) 2022-02-15 2022-02-15 Network connection state monitoring method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114500246B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111130925A (en) * 2019-11-29 2020-05-08 广州文远知行科技有限公司 Resource monitoring method and device, computer equipment and storage medium
CN111277460A (en) * 2020-01-17 2020-06-12 江苏满运软件科技有限公司 ZooKeeper containerization control method and device, storage medium and electronic equipment
WO2020253347A1 (en) * 2019-06-17 2020-12-24 深圳前海微众银行股份有限公司 Container cluster management method, device and system
CN112468361A (en) * 2020-11-19 2021-03-09 苏州浪潮智能科技有限公司 Network connection state monitoring method and device, electronic equipment and storage medium
WO2021051582A1 (en) * 2019-09-17 2021-03-25 平安科技(深圳)有限公司 Host performance monitoring method and apparatus for server cluster, device, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020253347A1 (en) * 2019-06-17 2020-12-24 深圳前海微众银行股份有限公司 Container cluster management method, device and system
WO2021051582A1 (en) * 2019-09-17 2021-03-25 平安科技(深圳)有限公司 Host performance monitoring method and apparatus for server cluster, device, and storage medium
CN111130925A (en) * 2019-11-29 2020-05-08 广州文远知行科技有限公司 Resource monitoring method and device, computer equipment and storage medium
CN111277460A (en) * 2020-01-17 2020-06-12 江苏满运软件科技有限公司 ZooKeeper containerization control method and device, storage medium and electronic equipment
CN112468361A (en) * 2020-11-19 2021-03-09 苏州浪潮智能科技有限公司 Network connection state monitoring method and device, electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨杰 等: "面向大规模集群的自动化监控系统", 计算机工程与科学, no. 10 *

Also Published As

Publication number Publication date
CN114500246B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN108829560B (en) Data monitoring method and device, computer equipment and storage medium
CN108521339B (en) Feedback type node fault processing method and system based on cluster log
CN109460343A (en) System exception monitoring method, device, equipment and storage medium based on log
CN111046011A (en) Log collection method, system, node, electronic device and readable storage medium
CN105376251A (en) Intrusion detection method and intrusion detection system based on cloud computing
CN108632111A (en) Service link monitoring method based on log
CN111866016A (en) Log analysis method and system
CN112148610A (en) Test case execution method and device, computer equipment and storage medium
CN114116322B (en) Data recovery method, device, equipment and storage medium
CN103455600A (en) Video URL (Uniform Resource Locator) grabbing method and device and server equipment
CN112506755A (en) Log collection method and device, computer equipment and storage medium
CN111813630A (en) Method and device for collecting log information and computer equipment
CN115102877B (en) Virtual network card network detection method, device, equipment and medium
CN112612680A (en) Message warning method, system, computer equipment and storage medium
CN114143171B (en) Alarm root cause positioning method and system based on TR069 protocol
CN105207829B (en) Intrusion detection data processing method, device and system
CN114500246B (en) Network connection state monitoring method and device, computer equipment and storage medium
CN113110965A (en) Abnormal information monitoring method and device, computer storage medium and terminal
CN113918373A (en) Memory leak monitoring method, memory leak detection method and corresponding devices
CN114296880A (en) Service request processing method, device, equipment and medium based on large-scale cluster
CN112527595A (en) Monitoring method and device for Greenplus cluster database and computer equipment
CN110289977B (en) Fault detection method, system, equipment and storage medium for logistics warehouse system
CN105391602A (en) Data acquisition test method and device
CN114064387A (en) Log monitoring method, system, device and computer readable storage medium
CN113055243B (en) DPI interface data processing method and device

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