CN107276813A - A SNMP-TRAP alarm method and device - Google Patents
A SNMP-TRAP alarm method and device Download PDFInfo
- Publication number
- CN107276813A CN107276813A CN201710520459.8A CN201710520459A CN107276813A CN 107276813 A CN107276813 A CN 107276813A CN 201710520459 A CN201710520459 A CN 201710520459A CN 107276813 A CN107276813 A CN 107276813A
- Authority
- CN
- China
- Prior art keywords
- alarm
- trap
- event
- attributes
- event queue
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000001514 detection method Methods 0.000 claims abstract description 5
- 230000006870 function Effects 0.000 description 11
- 238000012856 packing Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 238000004806 packaging method and process Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011895 specific detection Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0631—Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/02—Standardisation; Integration
- H04L41/0213—Standardised network management protocols, e.g. simple network management protocol [SNMP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Computer And Data Communications (AREA)
Abstract
Description
技术领域technical field
本发明涉及集群监控领域,特别涉及一种SNMP-TRAP告警方法及装置。The invention relates to the field of cluster monitoring, in particular to an SNMP-TRAP alarm method and device.
背景技术Background technique
随着现代社会科技的发展,互联网已经渗透于人们生活的各方各面,人们每天产生的数据急剧增加。2014年仅我国就有高达20亿元的大数据市场,并且一直以约60%速度增长。对大数据存储和监控离不开服务器集群,服务器集群的一个重要、必须的功能就是主动告警,比较常见的方式为SNMP(Simple Network Management Protocol,简单网络管理协议)的TRAP告警。With the development of science and technology in modern society, the Internet has penetrated into all aspects of people's lives, and the data generated by people every day has increased dramatically. In 2014, my country alone had a big data market of up to 2 billion yuan, and it has been growing at a rate of about 60%. Big data storage and monitoring are inseparable from server clusters. An important and necessary function of server clusters is active alarms. The more common way is SNMP (Simple Network Management Protocol, Simple Network Management Protocol) TRAP alarms.
现有技术中,SNMP-TRAP告警的方式往往根据SNMP的原则,将一个资源定义为MIB中的一个节点,如将每个告警(例如电量过低、磁盘将满、风扇故障等)设计成MIB中的一个节点。这样的好处简单易懂,SNMP管理端收到一个TRAP告警时,从收到的OID就可以清楚的知道哪里出现了问题。然而,这种SNMP-TRAP告警的方式在当需要增加新的告警时,往往需要重新设计MIB库,并且需要对新的告警重新编码,对SNMP-TRAP告警的扩展十分不利;并且,服务器集群是个很复杂的设备,必然存在很多种告警,使得设计出的MIB文件往往很大,对使用方造成困扰和不便。因此,如何对MIB进行设计,使SNMP-TRAP告警可以更加便捷的扩展,且减小MIB文件的容量,提高用户体验,是现今亟需解决的问题。In the prior art, the SNMP-TRAP alarm method is often based on the principle of SNMP, defining a resource as a node in the MIB, such as designing each alarm (such as low battery, near-full disk, fan failure, etc.) into a MIB A node in . This advantage is simple and easy to understand. When the SNMP management terminal receives a TRAP alarm, it can clearly know where the problem occurs from the received OID. However, this SNMP-TRAP alarm method often needs to redesign the MIB library when a new alarm needs to be added, and needs to recode the new alarm, which is very unfavorable to the expansion of the SNMP-TRAP alarm; and the server cluster is a For very complex equipment, there must be many kinds of alarms, so the designed MIB file is often very large, causing confusion and inconvenience to the user. Therefore, how to design the MIB so that the SNMP-TRAP alarm can be expanded more conveniently, reduce the capacity of the MIB file, and improve user experience is an urgent problem to be solved today.
发明内容Contents of the invention
本发明的目的是提供一种SNMP-TRAP告警方法及装置,以通过将每个告警属性设计成MIB中的一个OID,使SNMP-TRAP告警可以更加便捷的扩展,且减小MIB文件的容量。The object of the present invention is to provide a kind of SNMP-TRAP alarm method and device, so that SNMP-TRAP alarm can be expanded more conveniently and reduce the capacity of MIB file by designing each alarm attribute as an OID in MIB.
为解决上述技术问题,本发明提供一种SNMP-TRAP告警方法,包括:In order to solve the problems of the technologies described above, the present invention provides a kind of SNMP-TRAP warning method, comprising:
检测获取预设的部件或业务功能中存在的告警项;Detect and obtain alarm items existing in preset components or business functions;
获取所述告警项对应的告警属性;Obtain an alarm attribute corresponding to the alarm item;
根据MIB中所述告警属性各自对应的OID,将所述告警属性打包成TRAP报文并发送到对应的接收端。According to the respective OIDs corresponding to the alarm attributes in the MIB, the alarm attributes are packaged into a TRAP message and sent to the corresponding receiving end.
可选的,所述根据MIB中所述告警属性各自对应的OID,将所述告警属性打包成TRAP报文并发送到对应的接收端之前,还包括:Optionally, according to the respective OIDs corresponding to the alarm attributes in the MIB, before packing the alarm attributes into a TRAP message and sending it to the corresponding receiving end, the method further includes:
将所述告警属性打包成事件;Packing the alarm attributes into an event;
锁住事件队列,将所述事件放入所述事件队列,并解锁所述事件队列。An event queue is locked, the event is put into the event queue, and the event queue is unlocked.
可选的,所述根据MIB中所述告警属性各自对应的OID,将所述告警属性打包成TRAP报文并发送到对应的接收端,包括:Optionally, according to the respective OIDs corresponding to the alarm attributes in the MIB, the alarm attributes are packaged into a TRAP message and sent to the corresponding receiving end, including:
从所述事件队列获取所述事件;obtaining the event from the event queue;
根据所述MIB中所述告警属性各自对应的OID,将所述事件中的所述告警属性打包成所述TRAP报文并发送到所述接收端;According to the respective OIDs corresponding to the alarm attributes in the MIB, pack the alarm attributes in the event into the TRAP message and send it to the receiving end;
锁住所述事件队列,将所述事件从所述事件队列中删除,并解锁所述事件队列。The event queue is locked, the event is deleted from the event queue, and the event queue is unlocked.
可选的,所述告警属性包括:告警级别、告警对象ID、告警对象名、对象类型、错误码、错误描述、告警发生时间、告警对象序列号、集群ID、集群名、节点名ID、节点名和集群版本号中至少一项。Optionally, the alarm attributes include: alarm level, alarm object ID, alarm object name, object type, error code, error description, alarm occurrence time, alarm object serial number, cluster ID, cluster name, node name ID, node at least one of the cluster name and cluster version number.
可选的,所述根据MIB中所述告警属性各自对应的OID,将所述告警属性打包成TRAP报文并发送到对应的接收端之后,还包括:Optionally, according to the respective OIDs corresponding to the alarm attributes in the MIB, after the alarm attributes are packaged into a TRAP message and sent to the corresponding receiving end, the method further includes:
所述接收端根据所述TRAP报文中的所述OID,向对应的位置发送对应的告警信息。The receiving end sends corresponding alarm information to a corresponding location according to the OID in the TRAP message.
此外,本发明还提供了一种SNMP-TRAP告警装置,包括:In addition, the present invention also provides a kind of SNMP-TRAP warning device, comprises:
检测模块,用于检测获取预设的部件或业务功能中存在的告警项;A detection module, configured to detect and obtain alarm items existing in preset components or business functions;
获取模块,用于获取所述告警项对应的告警属性;An acquisition module, configured to acquire an alarm attribute corresponding to the alarm item;
发送模块,用于根据MIB中所述告警属性各自对应的OID,将所述告警属性打包成TRAP报文并发送到对应的接收端。The sending module is configured to pack the alarm attributes into a TRAP message according to the respective OIDs corresponding to the alarm attributes in the MIB and send it to a corresponding receiving end.
可选的,该装置还包括:Optionally, the device also includes:
打包模块,用于将所述告警属性打包成事件;A packaging module, configured to package the alarm attribute into an event;
事件队列模块,用于锁住事件队列,将所述事件放入所述事件队列,并解锁所述事件队列。The event queue module is used to lock the event queue, put the event into the event queue, and unlock the event queue.
可选的,所述发送模块,包括:Optionally, the sending module includes:
获取子模块,用于从所述事件队列获取所述事件;An acquisition submodule, configured to acquire the event from the event queue;
发送子模块,用于根据所述MIB中所述告警属性各自对应的OID,将所述事件中的所述告警属性打包成所述TRAP报文并发送到所述接收端;A sending submodule, configured to pack the alarm attributes in the event into the TRAP message and send it to the receiving end according to the respective OIDs corresponding to the alarm attributes in the MIB;
事件队列子模块,锁住所述事件队列,将所述事件从所述事件队列中删除,并解锁所述事件队列。The event queue sub-module locks the event queue, deletes the event from the event queue, and unlocks the event queue.
本发明所提供的一种SNMP-TRAP告警方法,包括:检测获取预设的部件或业务功能中存在的告警项;获取所述告警项对应的告警属性;根据MIB中所述告警属性各自对应的OID,将所述告警属性打包成TRAP报文并发送到对应的接收端;An SNMP-TRAP alarm method provided by the present invention includes: detecting and obtaining alarm items existing in preset components or service functions; acquiring alarm attributes corresponding to the alarm items; OID, packing the alarm attribute into a TRAP message and sending it to a corresponding receiving end;
可见,本发明通过获取告警项对应的告警属性,可以利用对应的告警属性体现告警项的内容;通过根据MIB中告警属性各自对应的OID,将告警属性打包成TRAP报文并发送到对应的接收端,可以利用预先设置的告警属性对应的OID将对应的告警属性打包成TRAP报文并发送到对应的接收端,使得接收端可以通过告警属性获取对应的告警项,从而使SNMP-TRAP告警可以更加便捷的扩展,且减小了MIB文件的容量。此外,本发明还提供了一种SNMP-TRAP告警装置,同样具有上述有益效果。It can be seen that the present invention can utilize the corresponding alarm attribute to embody the content of the alarm item by obtaining the corresponding alarm attribute of the alarm item; according to the respective OIDs corresponding to the alarm attribute in the MIB, the alarm attribute is packaged into a TRAP message and sent to the corresponding receiver end, can use the OID corresponding to the preset alarm attribute to pack the corresponding alarm attribute into a TRAP message and send it to the corresponding receiving end, so that the receiving end can obtain the corresponding alarm item through the alarm attribute, so that the SNMP-TRAP alarm can be More convenient expansion, and reduce the capacity of MIB files. In addition, the present invention also provides an SNMP-TRAP alarm device, which also has the above beneficial effects.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only It is an embodiment of the present invention, and those skilled in the art can also obtain other drawings according to the provided drawings without creative work.
图1为本发明实施例所提供的一种SNMP-TRAP告警方法的流程图;Fig. 1 is the flowchart of a kind of SNMP-TRAP warning method provided by the embodiment of the present invention;
图2为本发明实施例所提供的一种SNMP-TRAP告警方法的MIB中的告警属性示意图;Fig. 2 is a schematic diagram of alarm attributes in the MIB of a SNMP-TRAP alarm method provided by an embodiment of the present invention;
图3为本发明实施例所提供的一种SNMP-TRAP告警装置的结构图。Fig. 3 is a structural diagram of an SNMP-TRAP alarm device provided by an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
请参考图1,图1为本发明实施例所提供的一种SNMP-TRAP告警方法的流程图。该方法可以包括:Please refer to FIG. 1 , which is a flowchart of an SNMP-TRAP alarm method provided by an embodiment of the present invention. The method can include:
步骤101:检测获取预设的部件或业务功能中存在的告警项。Step 101: Detect and acquire alarm items existing in preset components or service functions.
其中,预设的部件或业务功能可以为用户或设计人员预先设置的利用本实施例所提供的方法进行SNMP-TRAP告警的位置。本实施例对此不做任何限制。Wherein, the preset component or service function may be a preset location for SNMP-TRAP alarming by using the method provided by this embodiment. This embodiment does not impose any limitation on this.
可以理解的是,对于本步骤中的告警项的具体检测获取方式,可以由设计人员根据实用场景和用户需求自行设置,只要可以获取预设的部件或业务功能中存在的告警项,本实施例对此不受任何限制。It can be understood that the specific detection and acquisition method of the alarm items in this step can be set by the designer according to the practical scenario and user needs. As long as the alarm items in the preset components or business functions can be obtained, this embodiment There are no restrictions on this.
步骤102:获取告警项对应的告警属性。Step 102: Obtain the alarm attribute corresponding to the alarm item.
其中,告警属性为MIB中的OID对应的属性,每个告警属性可以各自对应一个OID。告警属性可以包括告警级别(如严重、警告和消息级别)、告警对象ID、告警对象名、对象类型、错误码、错误描述、告警发生时间、告警对象序列号、集群ID、集群名、节点名ID、节点名和集群版本号;也可以上述内容中的一项或几项;还可以包括其他内容。对于告警属性的具体内容,也就是MIB中的OID的属性,可以由设计人员根据实用场景和用户需求自行设置,本实施例对此不做任何限制。Wherein, the alarm attribute is an attribute corresponding to an OID in the MIB, and each alarm attribute may correspond to an OID. Alarm attributes can include alarm levels (such as critical, warning, and message levels), alarm object ID, alarm object name, object type, error code, error description, alarm occurrence time, alarm object serial number, cluster ID, cluster name, and node name ID, node name, and cluster version number; one or more of the above contents can also be included; other contents can also be included. The specific content of the alarm attribute, that is, the attribute of the OID in the MIB, can be set by the designer according to practical scenarios and user requirements, and this embodiment does not impose any restrictions on this.
具体的,告警属性对应的OID在MIB中的设置方式,可以如图2所示,alarm可以为MIB根节点(在MIB文件中,它可以在“1.3.6.1.4.1”之下的某节点下),critical、warning和information分别为严重、警告和消息的三个告警级别。attributes为告警总属性,objId、objName、objType、errorCode、errorInfo、createdTime、objSn、clusterId、clusterName、nodeId、nodeName、clusterVersion分别为attributes下的告警对象ID、告警对象名、对象类型、错误码、错误描述、告警发生时间、告警对象序列号、集群ID、集群名、节点名ID、节点名和集群版本号的表示告警对象ID、告警对象名、对象类型、错误码、错误描述、告警发生时间、告警对象序列号、集群ID、集群名、节点名ID、节点名和集群版本号的告警分属性。本实施例对此不做任何限制。Specifically, the setting method of the OID corresponding to the alarm attribute in the MIB can be shown in Figure 2, and the alarm can be the root node of the MIB (in the MIB file, it can be under a certain node under "1.3.6.1.4.1") ), critical, warning and information are the three warning levels of critical, warning and message respectively. attributes is the total attribute of the alarm, and objId, objName, objType, errorCode, errorInfo, createdTime, objSn, clusterId, clusterName, nodeId, nodeName, and clusterVersion are the alarm object ID, alarm object name, object type, error code, and error description under attributes, respectively. , alarm occurrence time, alarm object sequence number, cluster ID, cluster name, node name ID, node name, and cluster version number indicate the alarm object ID, alarm object name, object type, error code, error description, alarm occurrence time, and alarm object Alarm sub-attributes of serial number, cluster ID, cluster name, node ID, node name, and cluster version number. This embodiment does not impose any limitation on this.
可以理解的是,本步骤中获取告警项对应的告警属性的具体方式,可以为根据预先设置的该告警项与告警属性的对应关系,获取该告警项对应的告警属性,如添加每个告警项时,预先设置该告警项与告警属性的对应关系;也可以为对该告警项进行分析,获取对应的告警属性。只要可以获取告警项对应的告警属性,对于具体的获取方式,可以由设计人员根据实用场景和用户需求自行设置,本实施例对此不做任何限制。It can be understood that, in this step, the specific method of obtaining the alarm attribute corresponding to the alarm item may be to obtain the alarm attribute corresponding to the alarm item according to the preset correspondence between the alarm item and the alarm attribute, such as adding each alarm item , the corresponding relationship between the alarm item and the alarm attribute is set in advance; it is also possible to analyze the alarm item and obtain the corresponding alarm attribute. As long as the alarm attribute corresponding to the alarm item can be obtained, the specific acquisition method can be set by the designer according to practical scenarios and user requirements, and this embodiment does not impose any restrictions on this.
步骤103:根据MIB中告警属性各自对应的OID,将告警属性打包成TRAP报文并发送到对应的接收端。Step 103: According to the OIDs corresponding to the alarm attributes in the MIB, pack the alarm attributes into a TRAP message and send it to the corresponding receiving end.
其中,本步骤的目的是根据MIB中告警属性各自对应的OID,将告警项对应的告警属性打包成TRAP报文并发送到对应的接收端,从而使接收端可以根据TRAP报文中OID的告警属性获取告警项,进行对应的告警操作。Among them, the purpose of this step is to package the alarm attributes corresponding to the alarm item into a TRAP message and send it to the corresponding receiving end according to the OID corresponding to the alarm attribute in the MIB, so that the receiving end can Attributes to obtain alarm items, and perform corresponding alarm operations.
可以理解的是,由于集群中的告警项的数量可能很多,为了避免告警项对应的告警属性丢失,造成的漏告警情况,可以在本步骤之前,将获取的告警项对应的告警属性放入到队列中。也就是说,本步骤之前可以包括:将告警属性打包成事件;锁住事件队列,将事件放入事件队列,并解锁事件队列的步骤。通过锁住事件队列,将告警属性打包成的事件放入到事件队列,并解锁事件队列,可以使每次对事件队列添加事件的过程不受干扰,避免了同时添加事件可能造成的事件遗漏的情况。It is understandable that since there may be a large number of alarm items in the cluster, in order to avoid missing alarms caused by the loss of alarm attributes corresponding to the alarm items, you can put the alarm attributes corresponding to the obtained alarm items into the in queue. That is to say, this step may include: packing the alarm attribute into an event; locking the event queue, putting the event into the event queue, and unlocking the event queue. By locking the event queue, putting the events packaged with alarm attributes into the event queue, and unlocking the event queue, the process of adding events to the event queue can be uninterrupted each time, avoiding the possibility of missing events caused by adding events at the same time Condition.
对应的,本步骤可以为从事件队列获取事件;根据MIB中告警属性各自对应的OID,将事件中的告警属性打包成TRAP报文并发送到接收端;锁住事件队列,将事件从事件队列中删除,并解锁事件队列的步骤。通过锁住事件队列,将处理后的事件从事件队列中删除,并解锁事件队列的步骤,可以保证将处理后的事件,也就是其告警属性已打包成TRAP报文并发送到接收端的事件,从事件队列中删除的过程不受干扰。Correspondingly, this step can be to acquire events from the event queue; according to the respective OIDs corresponding to the alarm attributes in the MIB, the alarm attributes in the event are packaged into TRAP messages and sent to the receiving end; the event queue is locked, and the event is retrieved from the event queue Delete, and unlock the event queue steps. By locking the event queue, deleting the processed event from the event queue, and unlocking the event queue, it can be guaranteed that the processed event, that is, the event whose alarm attribute has been packaged into a TRAP message and sent to the receiving end, The process of removing from the event queue is not disturbed.
需要说明的是,由于本实施例所提供的方法向接收端发送的TRAP报文为告警项对应的告警属性的OID。因此,接收端可以根据对应的告警属性的OID确定告警项,从而执行对应的告警操作。也就是说,本实施例所提供的方法还可以包括:接收端根据TRAP报文中的OID,向对应的位置发送对应的告警信息的步骤。对于对应的位置的具体设置方式,可以为TRAP报文中的OID对应的告警项对应的位置,也可以为预先设置的一个用于显示告警信息的位置,本实施例对此不做任何限制。对于告警信息的具体设置方式,可以为TRAP报文中的OID对应的告警项对应的告警信息,本实施例对此同样不做任何限制。It should be noted that the TRAP message sent to the receiving end by the method provided in this embodiment is the OID of the alarm attribute corresponding to the alarm item. Therefore, the receiving end can determine the alarm item according to the OID of the corresponding alarm attribute, so as to perform the corresponding alarm operation. That is to say, the method provided by this embodiment may further include: the receiving end sends corresponding alarm information to a corresponding location according to the OID in the TRAP message. The specific setting method of the corresponding location may be the location corresponding to the alarm item corresponding to the OID in the TRAP message, or a preset location for displaying alarm information, which is not limited in this embodiment. The specific setting method of the alarm information may be the alarm information corresponding to the alarm item corresponding to the OID in the TRAP message, which is also not limited in this embodiment.
可以理解的是,本实施所提供的方法从告警本身的属性出发,将每种告警项的所有告警属性列出,并将每个告警属性设计成MIB中的一个OID,当需要告警时,将告警项的对应的告警属性发送到接收端,由于全部告警项对应告警属性的OID相对不变,需要增加新的告警时,只需确定新的告警项与原有的告警属性的OID的对应关系或增加较少的告警属性的OID及对应关系。It can be understood that the method provided by this implementation starts from the attributes of the alarm itself, lists all the alarm attributes of each alarm item, and designs each alarm attribute as an OID in the MIB. When an alarm is required, the The corresponding alarm attribute of the alarm item is sent to the receiving end. Since the OID corresponding to the alarm attribute of all alarm items is relatively unchanged, when a new alarm needs to be added, it is only necessary to determine the corresponding relationship between the new alarm item and the OID of the original alarm attribute Or add fewer OIDs and corresponding relationships of alarm attributes.
本实施例中,本发明实施例通过获取告警项对应的告警属性,可以利用对应的告警属性体现告警项的内容;通过根据MIB中告警属性各自对应的OID,将告警属性打包成TRAP报文并发送到对应的接收端,可以利用预先设置的告警属性对应的OID将对应的告警属性打包成TRAP报文并发送到对应的接收端,使得接收端可以通过告警属性获取对应的告警项,从而使SNMP-TRAP告警可以更加便捷的扩展,且减小了MIB文件的容量。In this embodiment, the embodiment of the present invention can use the corresponding alarm attribute to reflect the content of the alarm item by obtaining the alarm attribute corresponding to the alarm item; according to the OID corresponding to the alarm attribute in the MIB, the alarm attribute is packaged into a TRAP message and To send to the corresponding receiving end, you can use the OID corresponding to the pre-set alarm attribute to package the corresponding alarm attribute into a TRAP message and send it to the corresponding receiving end, so that the receiving end can obtain the corresponding alarm item through the alarm attribute, so that SNMP-TRAP alarms can be expanded more conveniently, and the capacity of MIB files is reduced.
请参考图3,图3为本发明实施例所提供的一种SNMP-TRAP告警装置的结构图。该装置可以包括:Please refer to FIG. 3 , which is a structural diagram of an SNMP-TRAP alarm device provided by an embodiment of the present invention. The device can include:
检测模块100,用于检测获取预设的部件或业务功能中存在的告警项;A detection module 100, configured to detect and acquire alarm items existing in preset components or business functions;
获取模块200,用于获取告警项对应的告警属性;An acquisition module 200, configured to acquire an alarm attribute corresponding to an alarm item;
发送模块300,用于根据MIB中告警属性各自对应的OID,将告警属性打包成TRAP报文并发送到对应的接收端。The sending module 300 is configured to pack the alarm attributes into a TRAP message according to the OIDs corresponding to the alarm attributes in the MIB and send it to the corresponding receiving end.
可选的,该装置还可以包括:Optionally, the device may also include:
打包模块,用于将告警属性打包成事件;Packaging module, used to package alarm attributes into events;
事件队列模块,用于锁住事件队列,将事件放入事件队列,并解锁事件队列。The event queue module is used to lock the event queue, put events into the event queue, and unlock the event queue.
可选的,发送模块300,可以包括:Optionally, the sending module 300 may include:
获取子模块,用于从事件队列获取事件;Obtain submodules for obtaining events from the event queue;
发送子模块,用于根据MIB中告警属性各自对应的OID,将事件中的告警属性打包成TRAP报文并发送到接收端;The sending sub-module is used to package the alarm attributes in the event into TRAP messages according to the OIDs corresponding to the alarm attributes in the MIB and send them to the receiving end;
事件队列子模块,锁住事件队列,将事件从事件队列中删除,并解锁事件队列。The event queue submodule locks the event queue, deletes the event from the event queue, and unlocks the event queue.
本实施例中,本发明实施例通过获取模块200获取告警项对应的告警属性,可以利用对应的告警属性体现告警项的内容;通过发送模块300根据MIB中告警属性各自对应的OID,将告警属性打包成TRAP报文并发送到对应的接收端,可以利用预先设置的告警属性对应的OID将对应的告警属性打包成TRAP报文并发送到对应的接收端,使得接收端可以通过告警属性获取对应的告警项,从而使SNMP-TRAP告警可以更加便捷的扩展,且减小了MIB文件的容量。In this embodiment, the embodiment of the present invention obtains the alarm attribute corresponding to the alarm item through the acquisition module 200, and can use the corresponding alarm attribute to reflect the content of the alarm item; through the sending module 300, according to the OID corresponding to the alarm attribute in the MIB, the alarm attribute Pack it into a TRAP message and send it to the corresponding receiving end. You can use the OID corresponding to the preset alarm attribute to pack the corresponding alarm attribute into a TRAP message and send it to the corresponding receiving end, so that the receiving end can obtain the corresponding alarm attribute through the alarm attribute. Alarm items, so that the SNMP-TRAP alarm can be expanded more conveniently, and the capacity of the MIB file is reduced.
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other Any other known storage medium.
以上对本发明所提供的SNMP-TRAP告警方法及装置进行了详细介绍。本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以对本发明进行若干改进和修饰,这些改进和修饰也落入本发明权利要求的保护范围内。The SNMP-TRAP alarm method and device provided by the present invention have been introduced in detail above. In this paper, specific examples are used to illustrate the principle and implementation of the present invention, and the descriptions of the above embodiments are only used to help understand the method and core idea of the present invention. It should be pointed out that for those skilled in the art, without departing from the principles of the present invention, some improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710520459.8A CN107276813A (en) | 2017-06-30 | 2017-06-30 | A SNMP-TRAP alarm method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710520459.8A CN107276813A (en) | 2017-06-30 | 2017-06-30 | A SNMP-TRAP alarm method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN107276813A true CN107276813A (en) | 2017-10-20 |
Family
ID=60070485
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710520459.8A Pending CN107276813A (en) | 2017-06-30 | 2017-06-30 | A SNMP-TRAP alarm method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107276813A (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110365525A (en) * | 2019-06-28 | 2019-10-22 | 苏州浪潮智能科技有限公司 | A management protocol-based alarm method, device and storage medium |
| CN110543409A (en) * | 2019-08-29 | 2019-12-06 | 南方电网数字电网研究院有限公司 | Hardware data acquisition method and device, computer equipment and storage medium |
| EP3975481A4 (en) * | 2019-12-12 | 2022-09-07 | ZTE Corporation | METHOD AND APPARATUS FOR DATA ACQUISITION, COMPUTER DEVICE AND COMPUTER READABLE MEDIUM |
| CN116340517A (en) * | 2023-03-24 | 2023-06-27 | 济南浪潮数据技术有限公司 | Alarm management method, system, storage medium and equipment |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030105861A1 (en) * | 2001-12-04 | 2003-06-05 | Jong-Ky Lee | System and method for managing and displaying representative severity of network element in SNMP |
| CN1921407A (en) * | 2005-08-23 | 2007-02-28 | 中兴通讯股份有限公司 | Alarm managing method for SNMP protocol network managing system |
| CN101388808A (en) * | 2008-10-24 | 2009-03-18 | 中兴通讯股份有限公司 | A trap processing method based on simple network management protocol |
| CN101917284A (en) * | 2010-07-23 | 2010-12-15 | 中兴通讯股份有限公司 | Alarm method, network equipment and system based on OMG CORBA northbound interface |
| CN102026253A (en) * | 2010-12-21 | 2011-04-20 | 大唐移动通信设备有限公司 | Alarm reporting and processing method, system and equipment |
| CN104408898A (en) * | 2014-10-27 | 2015-03-11 | 福建星网锐捷安防科技有限公司 | Alarm information combination determination based method and apparatus for improving alarm accuracy |
| CN104636989A (en) * | 2015-02-11 | 2015-05-20 | 广东电网有限责任公司中山供电局 | Power system monitoring alarm information processing method and system |
| CN105187258A (en) * | 2015-09-30 | 2015-12-23 | 北京英诺威尔科技股份有限公司 | Method for analyzing and processing configurable Trap alarm |
| CN106357457A (en) * | 2016-10-31 | 2017-01-25 | 瑞斯康达科技发展股份有限公司 | Warning test method, warning test apparatus and warning test system |
| CN106411566A (en) * | 2016-08-19 | 2017-02-15 | 成都广达新网科技股份有限公司 | MIB alarm analysis method and system based on XML technology |
-
2017
- 2017-06-30 CN CN201710520459.8A patent/CN107276813A/en active Pending
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20030105861A1 (en) * | 2001-12-04 | 2003-06-05 | Jong-Ky Lee | System and method for managing and displaying representative severity of network element in SNMP |
| CN1921407A (en) * | 2005-08-23 | 2007-02-28 | 中兴通讯股份有限公司 | Alarm managing method for SNMP protocol network managing system |
| CN101388808A (en) * | 2008-10-24 | 2009-03-18 | 中兴通讯股份有限公司 | A trap processing method based on simple network management protocol |
| CN101917284A (en) * | 2010-07-23 | 2010-12-15 | 中兴通讯股份有限公司 | Alarm method, network equipment and system based on OMG CORBA northbound interface |
| CN102026253A (en) * | 2010-12-21 | 2011-04-20 | 大唐移动通信设备有限公司 | Alarm reporting and processing method, system and equipment |
| CN104408898A (en) * | 2014-10-27 | 2015-03-11 | 福建星网锐捷安防科技有限公司 | Alarm information combination determination based method and apparatus for improving alarm accuracy |
| CN104636989A (en) * | 2015-02-11 | 2015-05-20 | 广东电网有限责任公司中山供电局 | Power system monitoring alarm information processing method and system |
| CN105187258A (en) * | 2015-09-30 | 2015-12-23 | 北京英诺威尔科技股份有限公司 | Method for analyzing and processing configurable Trap alarm |
| CN106411566A (en) * | 2016-08-19 | 2017-02-15 | 成都广达新网科技股份有限公司 | MIB alarm analysis method and system based on XML technology |
| CN106357457A (en) * | 2016-10-31 | 2017-01-25 | 瑞斯康达科技发展股份有限公司 | Warning test method, warning test apparatus and warning test system |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110365525A (en) * | 2019-06-28 | 2019-10-22 | 苏州浪潮智能科技有限公司 | A management protocol-based alarm method, device and storage medium |
| CN110543409A (en) * | 2019-08-29 | 2019-12-06 | 南方电网数字电网研究院有限公司 | Hardware data acquisition method and device, computer equipment and storage medium |
| EP3975481A4 (en) * | 2019-12-12 | 2022-09-07 | ZTE Corporation | METHOD AND APPARATUS FOR DATA ACQUISITION, COMPUTER DEVICE AND COMPUTER READABLE MEDIUM |
| CN116340517A (en) * | 2023-03-24 | 2023-06-27 | 济南浪潮数据技术有限公司 | Alarm management method, system, storage medium and equipment |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110224858B (en) | Log-based alarm method and related device | |
| CN103605722B (en) | Database monitoring method and device, equipment | |
| CN103827810B (en) | Asset Model Import Connector | |
| CN107276813A (en) | A SNMP-TRAP alarm method and device | |
| CN105610648B (en) | A method and server for collecting operation and maintenance monitoring data | |
| CN110362455B (en) | A data processing method and data processing device | |
| KR20070050402A (en) | Pattern discovery in network security systems | |
| CN113794597B (en) | Alarm information processing method, system, electronic equipment and storage medium | |
| CN106972978A (en) | A kind of ALM method for pushing and device | |
| CN101312405A (en) | Alarm processing method and network management system | |
| CN109947616A (en) | A kind of automatically-monitored operational system of the cloud operating system based on OpenStack technology | |
| CN107579854A (en) | A cluster alarm method, device, equipment and computer-readable storage medium | |
| CN100499482C (en) | A method for monitoring user behavior in network management system | |
| CN105591775B (en) | A kind of network operation management maintenance OAM method, device and system | |
| CN113127290A (en) | Service operation index monitoring method and device and server | |
| CN109684176A (en) | A kind of report method of warning information, system and associated component | |
| CN106911519A (en) | A kind of data acquisition monitoring method and device | |
| CN110290002A (en) | An updating method, terminal and electronic equipment | |
| CN106713014A (en) | Monitored host in monitoring system, the monitoring system and monitoring method | |
| CN117608957A (en) | System security monitoring method, device and storage medium | |
| CN117544474A (en) | Alarm message processing method, device, electronic equipment and storage medium | |
| CN108829563A (en) | A kind of alarm method and alarm device | |
| CN111343017B (en) | Method, system, device and medium for cloud platform resource alarm | |
| CN108810142A (en) | Monitoring method, device, computer equipment and the storage medium of Zookeeper | |
| CN116192611B (en) | A unified alarm method, system and device based on multiple microservice scenarios |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171020 |
|
| RJ01 | Rejection of invention patent application after publication |