Method and system for monitoring and alarming frequent UP/DOWN of network equipment port

文档序号:490594 发布日期:2022-01-04 浏览:4次 中文

阅读说明:本技术 网络设备端口频繁up/down监听告警方法及系统 (Method and system for monitoring and alarming frequent UP/DOWN of network equipment port ) 是由 李朝锋 嵇凌 钟伟 韦国富 曾庆豪 周伟娟 曹艺 于 2021-10-18 设计创作,主要内容包括:本发明属于网络设备运维领域,尤其涉及一种网络设备端口频繁UP/DOWN监听告警方法及系统,建立端口映射表,记录前一次采集到的端口状态,实时判断并生成端口UP/DOWN触发信息;根据端口UP/DOWN触发信息创建和保存端口告警队列容器;获取当前存在的端口历史状态记录,当队列元素个数等于用户预先设置的上下线次数阈值,且队列容器中队列头部元素与尾部元素的时间跨度小于用户预先设置的时间范围阈值时,输出告警信息,本发明引入UP/DOWN触发次数阈值和时间范围阈值,这样避免了漏报,提高了端口告警的准确性,为网络通信提供了良好保证。(The invention belongs to the field of operation and maintenance of network equipment, in particular to a method and a system for monitoring and alarming frequent UP/DOWN of a port of the network equipment, wherein a port mapping table is established, the port state acquired at the previous time is recorded, and the port state is judged and generated in real time to generate port UP/DOWN trigger information; creating and storing a port alarm queue container according to the port UP/DOWN trigger information; the method comprises the steps of obtaining a historical state record of a port which exists currently, and outputting alarm information when the number of queue elements is equal to an UP-line and DOWN-line number threshold preset by a user and the time span of a head element and a tail element of a queue in a queue container is smaller than a time range threshold preset by the user.)

1. A method for monitoring and alarming frequent UP/DOWN of a network device port comprises obtaining port state data, and is characterized by also comprising the steps of establishing a port mapping table, recording the port state collected last time, judging in real time and generating port UP/DOWN trigger information; creating and storing a port alarm queue container according to the port UP/DOWN trigger information; and acquiring a historical state record of a port which currently exists, and outputting alarm information when the number of the queue elements is equal to an up-down line frequency threshold value preset by a user and the time span of a head element and a tail element of the queue in a queue container is smaller than a time range threshold value preset by the user.

2. The method of claim 1, wherein the alarm queue container is used to store alarm queues of all ports, the alarm queue is used to store port alarm elements, the queue is a first-in-first-out queue, and the port alarm element is a structural element including a port ID and a port UP/DOWN trigger time.

3. A monitoring and alarming system for frequent UP/DOWN of network device port is characterized in that it comprises device information acquisition module, port UP/DOWN trigger module, port alarm processing module, device information storage module, user configuration management module,

the equipment information acquisition module is used for acquiring the state information of all ports of the network;

the port UP/DOWN triggering module is used for receiving the port state information sent by the equipment information acquisition module and generating and sending a UP/DOWN triggering message of the port;

the port alarm processing module operates the equipment information storage module through an instruction and sends out a port alarm signal;

the device information storage module is used for storing all port information after the UP/DOWN condition is triggered and finishing the interaction with the port alarm processing module through instruction transmission;

and the user configuration management module is used for setting and storing the alarm threshold.

4. The system of claim 3, wherein the device information collecting module is configured to collect status information of all ports of a network, determine the number of parallel threads in a thread pool according to the number of switch clusters, and obtain status information of all ports of a switch according to an SNMP protocol, and one thread is responsible for monitoring all ports of a switch.

5. The system of claim 3 wherein the port UP/DOWN trigger module receives port status information from the device information acquisition module, creates a port mapping table, records the status of the previous port, determines in real time whether the port has continuously completed an on-line operation and an off-line operation, and sends the UP/DOWN trigger information to the port alarm processing module.

6. The system of claim 3 wherein the port alarm processing module receives port information from the port UP/DOWN trigger module, stores the port information in the device information storage module, completes information interaction by command operation, and determines whether the history information record in the device information storage module meets the alarm condition.

7. The system of claim 3 wherein the device information storage module receives and stores the port alarm queue from the port alarm processor by establishing a queue container, and receives the operation command to complete the corresponding information interaction function.

8. The system of claim 3 wherein the user configuration management module establishes a user configuration table via a database for initializing port alarm thresholds: the method comprises a time range threshold value and an up-down line frequency threshold value, and alarm information is generated according to the time range threshold value; determining the length of a port alarm queue according to the threshold of the number of times of going up and down the linenOnly storing in a certain alarm queuenInformation of each corresponding port.

Technical Field

The invention belongs to the field of operation and maintenance of network equipment, and particularly relates to a frequent UP/DOWN monitoring alarm and system for a port of the network equipment.

Background

With the gradual expansion of the network system scale, the number of switches in the network is more and more, and the management of the switch cluster ports is very important. The frequent UP/DOWN of the port means that the port is frequently on-line and off-line within a certain time, and the problem may be the reason of port failure, port looseness and the like, and related personnel need to be informed to perform troubleshooting in time, so that major accidents are avoided.

When UP/DOWN alarms are issued on the existing network device ports, a static time threshold is usually adopted, for example: if three times of UP/DOWN alarms of the ports within 10 minutes are set, UP/DOWN counting is carried out on all the ports, if three times of UP/DOWN alarms are carried out within 10 minutes, the alarms are carried out, and the historical alarm state is cleared once every 10 minutes; in addition, the number of ports of the switch cluster of the large-scale network user is large, the number of the ports with faults is small, historical state records are established statically for all the ports in the prior art, the traversing mode is used for checking, the efficiency is low, meanwhile, a certain time is needed for the system to acquire the switch data, when the number of the switches reaches a certain degree, the time for acquiring information is increased, and the real-time monitoring efficiency of the system is reduced.

Disclosure of Invention

Aiming at the problems of low acquisition efficiency, low port alarm efficiency and low alarm accuracy of switch cluster port information in the traditional method, the invention aims to provide a method for monitoring alarm by frequent UP/DOWN of a network device port, which has real-time, high port alarm accuracy and high port information acquisition efficiency.

The technical scheme for achieving the purpose comprises the following contents.

A method for monitoring and alarming frequent UP/DOWN of a network device port comprises the steps of obtaining port state data, establishing a port mapping table, recording the port state collected last time, judging in real time and generating port UP/DOWN trigger information; creating and storing a port alarm queue container according to the port UP/DOWN trigger information; and acquiring a historical state record of a port which currently exists, and outputting alarm information when the number of the queue elements is equal to an up-down line frequency threshold value preset by a user and the time span of a head element and a tail element of the queue in a queue container is smaller than a time range threshold value preset by the user.

Further, the alarm queue container is used for storing alarm queues of all ports, the alarm queues are used for storing port alarm elements, the queues are first-in first-out queues, and the port alarm elements are structural elements and include port IDs and port UP/DOWN trigger times.

Compared with the existing static time threshold, the frequent UP/DOWN monitoring and alarming method for the network equipment port introduces the UP/DOWN triggering time threshold and the time range threshold, judges whether the UP/DOWN triggering time threshold is met, judges whether the time range threshold is met, alarms when both the UP/DOWN triggering time threshold and the time range threshold are met, and then clears the alarm, otherwise, does not alarm, thus avoiding the report missing, improving the accuracy of the port alarm and providing good guarantee for the network communication.

The invention also provides a system for monitoring and alarming frequent UP/DOWN of network device port by using the monitoring and alarming method as guidance, which comprises a device information acquisition module, a port UP/DOWN trigger module, a port alarming processing module, a device information storage module and a user configuration management module,

the equipment information acquisition module is used for acquiring the state information of all ports of the network;

the port UP/DOWN triggering module is used for receiving the port state information sent by the equipment information acquisition module and generating and sending a UP/DOWN triggering message of the port;

the port alarm processing module operates the equipment information storage module through an instruction and sends out a port alarm signal;

the device information storage module is used for storing all port information after the UP/DOWN condition is triggered and finishing the interaction with the port alarm processing module through instruction transmission;

and the user configuration management module is used for setting and storing the alarm threshold.

Further, the device information acquisition module is configured to acquire state information of all ports of a network, determine the number of parallel threads in a thread pool according to the number of switch clusters, and acquire state information of all ports of a switch according to an SNMP protocol, where one thread is responsible for monitoring all ports on one switch. Compared with the prior art that all port information is combined into a large message structure in a circulating traversing mode, the method and the device have the advantages that one thread is established for each switch, each thread acquires the port information of the corresponding switch by itself, parallel monitoring is achieved, the real-time effect is good, the monitoring timeliness is strong, and the port information acquisition efficiency is high.

Further, the port UP/DOWN triggering module receives the port state information sent by the equipment information acquisition module, establishes a port mapping table, records the state of the previous port, judges whether the port continuously completes one online operation and one offline operation in real time, and sends the UP/DOWN triggering information to the port alarm processing module.

Further, the port alarm processing module receives the port information sent by the port UP/DOWN trigger module, stores the information in the equipment information storage module, completes information interaction in a command operation mode, and judges whether the history information record in the equipment information storage module meets the alarm condition.

Further, the device information storage module receives and stores the port alarm queue sent by the port alarm processor by establishing the queue container, and receives the operation instruction to complete the corresponding information interaction function.

Further, the user configuration management module establishes a user configuration table through a database, and is used for initializing a port alarm threshold: the method comprises a time range threshold value and an up-down line frequency threshold value, and alarm information is generated according to the time range threshold value; and determining the length n of the port alarm queue according to the upper and lower line times threshold, wherein a certain alarm queue only stores the information of n corresponding ports.

Drawings

FIG. 1 is a schematic diagram of data flow of a monitoring alarm system according to an embodiment;

FIG. 2 is a block diagram of an alert queue container in the embodiment;

fig. 3 is a flowchart illustrating the operation of the device information storage module in the embodiment.

Detailed Description

The present invention is described in detail with reference to the following examples, which are provided for illustration and are not intended to be limiting.

Referring to fig. 1 to fig. 3, an embodiment of the present invention provides a method and a system for monitoring and alarming frequent UP/DOWN of a port of a network device, which are applied to a network intelligent operation and maintenance system; the method comprises the following steps:

s1: a database user configuration table, alarm _ threshold, is created according to alarm thresholds preset by the user, as shown in table 1, including a time range threshold, an UP/DOWN number threshold,

table 1 alarm _ threshold data table two-point item data

The set alarm threshold is as follows: the SQL statements "update _ alarm _ threshold set up down time = (user input) where ID = 1" and "update _ alarm _ threshold set up down count = (user input) where ID = 2" are executed, respectively;

s2: creating a thread pool in an equipment information acquisition module, initializing the thread pool according to the number of switch equipment, wherein all sub-threads in the thread pool are executed in parallel, and the created thread pool is as follows: execute the Java statement "ExecutorService threeadpool = executors.

S3: and each sub-thread is bound with each switch and is only responsible for acquiring the port data of the corresponding switch. The protocol for obtaining the switch data is SNMP, the switch port data is obtained through a data interface provided by a switch manufacturer, and the switch data structure is shown in table 2. The acquiring of the port data of the switch is as follows: the Java code "List < TableEvent > curralportdata = snmpooperater. snmpgettable (table column oid, cluster, timeout, number of retries)";

TABLE 2 Port State data Table

S4: the port UP/DOWN triggering module is configured to receive the acquired port state information, and create a port mapping table, where as shown in table 3, a port is marked as 0 when initialized;

table 3 port mapping table

S5: after receiving the switch port state information sent by the device information acquisition module, if a certain port is marked as 0 in the mapping table, executing according to the following rules: when the port is in an online state, the mark is set to be 1, and when the port is in an offline state, the mark is set to be-1; if the flag in its mapping table is not 0, the following rule is followed: if the mapping table is marked as 1 and the port is in an off-line state, sending UP/DOWN trigger of the port once, and setting the mark as-1; the mapping table is marked as-1, and the port is in an online state, the mapping table is marked as 1; the mapping table is not changed under other conditions;

table 4 device information storage module operation instruction set

S6: and the port alarm processing module is used for receiving the trigger command sent by the port UP/DOWN trigger module and sending an operation command to the equipment information storage module, wherein the operation command set is shown in a table 4. After receiving a port UP/DOWN trigger, the following rules are executed: searching whether an alarm queue (corresponding to an instruction checkPort) of the port exists in the container, if the alarm queue of the port does not exist in the queue container, initializing an alarm queue (corresponding to an instruction createQueue), inserting a head element into the queue, and putting the queue into the queue container; if the alarm queue of the port exists in the queue container, inserting a tail element (corresponding to an instruction insertElement) into the queue;

s7: the device information storage module is used for creating and storing a port alarm queue container, the schematic diagram of the alarm queue container is shown in fig. 2, an operation instruction of the port alarm processing module is received, a corresponding result is returned, and the module execution flow chart is shown in fig. 3;

s8: table 4 said initContainer, after the system is started, the device information storage module automatically initializes a queue container;

s9: in table 4, the checkPort searches whether a queue of a port exists by traversing the queue container, where the input parameter is a port ID, and the return parameter is whether a boolean value of the port exists;

s10: table 4, the createQueue creates an alarm queue according to the incoming parameters;

s11: the clearqueue in table 4 deletes the corresponding alarm queue according to the incoming port ID;

s12: table 4, the insertElement finds a corresponding port queue according to the incoming parameter, and inserts an element at the tail of the queue;

s13: the element in step S12 is a data structure, as shown in table 5,

table 5 element structure in alarm queue

Data name Data type Means of
ID INT Port ID
upDownTime Data Port UP/DOWN trigger time

When an element is inserted at the tail of the queue, the following rules are adopted: if the time difference between the updown time of the tail element in the queue and the updown time of the head element in the queue is less than the time range threshold value preset by the user, returning an alarm judgment; otherwise, not returning;

s14: step S12, insert an element at the tail of the queue, and when the number of queue elements is greater than the threshold of the number of times of line-up and line-down preset by the user, pop up a head element according to the principle of the FIFO queue, and execute according to the execution rule of S12;

s15: and after the port alarm processing module executes the insertElement instruction and receives the alarm judgment returned by the equipment information storage module, outputting an alarm, executing a clearqueue instruction and clearing the alarm queue of the port.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:网络健康状态分析方法、装置、计算机设备和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类