WO2017117870A1 - 陷阱指令Trap的处理方法及装置 - Google Patents

陷阱指令Trap的处理方法及装置 Download PDF

Info

Publication number
WO2017117870A1
WO2017117870A1 PCT/CN2016/076899 CN2016076899W WO2017117870A1 WO 2017117870 A1 WO2017117870 A1 WO 2017117870A1 CN 2016076899 W CN2016076899 W CN 2016076899W WO 2017117870 A1 WO2017117870 A1 WO 2017117870A1
Authority
WO
WIPO (PCT)
Prior art keywords
trap
alarm
parsing
rule
module
Prior art date
Application number
PCT/CN2016/076899
Other languages
English (en)
French (fr)
Inventor
杨松
孙奇
袁虎
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017117870A1 publication Critical patent/WO2017117870A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • G06F11/0775Content or structure details of the error report, e.g. specific table structure, specific error fields

Definitions

  • the present invention relates to the field of communications, and in particular to a method and apparatus for processing a trap instruction trap.
  • the hardware device indicates that the device has failed or changed by actively sending a trap instruction trap.
  • the virtualized hardware management also needs to use appropriate rules to parse the traps reported by the device into user-readable alarm messages for fault diagnosis and maintenance. Because different devices define different traps, how to define rules for parsing various traps in virtualized hardware management is the most important content of Trap processing.
  • Virtualized hardware management defines the Trap parsing rules mainly in a pre-defined way at development time.
  • the pre-defined way of development is that the developer analyzes the data of the device management information base (Management Information Base (MIB) file or the equipment manufacturer in the development stage, and sorts out the rules for parsing the Trap and pre-defines the virtualization hardware.
  • MIB Management Information Base
  • the advantage of this method is that it saves the user's work and increases the ease of use of the system.
  • the disadvantage is that the system is not flexible enough, and the handling of some traps is flawed. All of the pre-defined ways of development have such deficiencies, mainly due to the characteristics of various device Trap definitions.
  • the Trap is divided into three types:
  • the first type of device defines multiple Traps in the MIB file, and each Trap represents an alarm. This type only needs to analyze the MIB file. In the Trap definition, you can customize the parsing rules.
  • the second type of device defines only one or a few traps in the MIB file. A bound variable in the trap has a limited value. Different values represent different alarms. This type only requires the manufacturer to provide binding. The parsing rules can be customized by the value of the variable and the corresponding alarm description.
  • the third type of device only defines one or a few Traps in the MIB file. Different Traps are distinguished by bind variables, but the Trap bind variable has no definite value. The manufacturer cannot provide the value of the bind variable. Corresponding alarm descriptions, this type of device cannot customize specific rules.
  • the rules for parsing Trap are not flexible enough for the first and second types of devices when the Trap is processed in a pre-defined manner.
  • the third type of device it is more difficult to handle.
  • the related technology is to use the summary alarm.
  • the rule is defined according to the trap defined by the MIB file.
  • Several Traps define several summary alarms. The inadequacy is that a Trap should generate different alarms by different binding variables. After the virtualization hardware management process, only a single summary alarm with the same alarm level and alarm name can be generated, although the alarm details will be The value of the bind variable is different, but it is not conducive to the user to distinguish between alarms.
  • the virtualization hardware management system resolves the inaccurate and inflexible alarm information according to the Trap rule defined by the device MIB file.
  • the device MIB file Currently, there is no effective solution.
  • the invention provides a method and a device for processing a trap instruction trap to solve at least the virtualization hardware in the related art.
  • the management system resolves the inaccuracy and inflexibility of the alarm information according to the trap rules defined in the device MIB file.
  • a method for processing a trap instruction Trap including:
  • parsing rule corresponding to the Trap, and parsing the trap according to the parsing rule, where the parsing rule is an parsing rule generated according to a correspondence between a value of a binding variable and an alarm information, and the binding variable
  • the value is the value of the user-defined bind variable in the Trap;
  • the alarm information alarm corresponding to the binding variable carried in the Trap is generated.
  • the method further includes: receiving a predetermined rule of the Trap, and the customizing rule, if the Trap fails to be parsed As the parsing rule.
  • the method before parsing the Trap according to the parsing rule, the method includes:
  • the Trap is parsed according to the parsing rule.
  • the method further includes: setting a priority of the parsing rule when parsing the trap successfully to be higher than other parsing in the parsing rule list. rule.
  • the parsing rules are formed in the following manner:
  • the setting information of the user input is received on the preset interface, where the setting information is used to set the alarm type of the Trap, and the alarm type includes: alarm and alarm recovery;
  • the received alarm information is received on the preset interface, and an analysis rule generated according to the correspondence between the value of the binding variable of the trap and the alarm information is formed, where the The alarm information includes the alarm level, the name of the alarm, and the cause of the alarm.
  • the alarm information includes: an alarm code for identifying an alarm information corresponding to the Trap.
  • a processing apparatus for a trap instruction trap including:
  • the parsing module obtains the parsing rule corresponding to the Trap, and parses the trap according to the parsing rule, where the parsing rule is an parsing rule generated according to the correspondence between the value of the binding variable and the alarm information,
  • the value of the bind variable is the value of the user-defined bind variable in the Trap;
  • the generating module is configured to generate the alarm information alarm corresponding to the binding variable carried in the Trap if the Trap is successfully parsed.
  • the device further includes: an adding module, configured to: after parsing the Trap according to the parsing rule, receiving a Trap pre-determination rule if the Trap fails to be parsed, The custom rule is taken as the parsing rule.
  • the device further includes:
  • the processing module is configured to parse the Trap through a predefined Trap processing chain before parsing the Trap according to the parsing rule;
  • the second parsing module is configured to parse the Trap according to the parsing rule when it is determined that the Trap processing chain cannot parse the Trap.
  • the device further includes:
  • the setting module is configured to set the priority of the parsing rule when the Trap is successful to be higher than other parsing rules in the parsing rule list after the parsing is successful.
  • the device further includes:
  • the receiving module is configured to receive the setting information input by the user on the preset interface, where the setting information is used to set the alarm type of the trap, and the alarm type includes: alarm and alarm recovery;
  • Forming a module configured to receive the input alarm information on the preset interface when the alarm type is received, and form an analysis rule generated according to the correspondence between the value of the binding variable of the Trap and the alarm information.
  • the alarm information includes an alarm level, an alarm name, and an alarm cause.
  • the trap sent by the device is obtained, and the parsing rule corresponding to the trap is obtained, and the trap is parsed according to the parsing rule, where the parsing rule is an parsing rule generated according to the correspondence between the value of the binding variable and the alarm information.
  • the value of the bind variable is the value of the user-defined bind variable in the trap.
  • FIG. 1 is a flowchart of a method for processing a trap instruction Trap according to an embodiment of the present invention
  • FIG. 2 is a block diagram 1 of a processing apparatus of a trap instruction trap according to an embodiment of the present invention
  • FIG. 3 is a block diagram 2 of a processing apparatus for a trap instruction Trap according to an embodiment of the present invention
  • FIG. 4 is a structural block diagram 3 of a processing apparatus for a trap instruction Trap according to an embodiment of the present invention
  • FIG. 5 is a structural block diagram 4 of a processing apparatus for a trap instruction Trap according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram 5 of a processing apparatus for a trap instruction Trap according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of a Trap alarm processing system according to a preferred embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a Trap processing module of a customizable parsing rule according to a preferred embodiment of the present invention.
  • FIG. 9 is a flowchart of processing a Trap by a Trap processing module that can customize a parsing rule according to a preferred embodiment of the present invention.
  • FIG. 10 is a flowchart of customizing a Trap parsing rule by using a Trap processing system that can customize a parsing rule according to a preferred embodiment of the present invention
  • FIG. 11 is a schematic diagram of a Trap detail interface according to a preferred embodiment of the present invention.
  • FIG. 12 is a schematic diagram of a custom rule alarm interface according to a preferred embodiment of the present invention.
  • FIG. 13 is a schematic diagram of an alarm recovery interface according to a preferred embodiment of the present invention.
  • FIG. 14 is a schematic diagram of a Trap parsing rule storage structure according to a preferred embodiment of the present invention.
  • FIG. 15 is a schematic diagram of optimization of a Trap parsing rule storage structure according to a preferred embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for processing a trap instruction Trap according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
  • Step S102 acquiring a Trap sent by the device
  • Step S104 Acquire an analysis rule corresponding to the Trap, and parse the Trap according to the parsing rule, where the parsing rule is an parsing rule generated according to a correspondence between a value of the binding variable and the alarm information, and the value of the binding variable The value of the bind variable defined for the user in the Trap;
  • step S106 when the Trap is successfully parsed, the alarm information alarm corresponding to the binding variable carried in the Trap is generated.
  • the parsing rule corresponding to the trap is obtained, and the trap is parsed according to the parsing rule, where the parsing rule is an parsing rule generated according to the correspondence between the value of the binding variable and the alarm information.
  • the value of the bind variable is the value of the user-defined bind variable in the trap.
  • the second type of binding variable has a finite value, and the correspondence between the value and the alarm information is customized by the manufacturer.
  • the binding variable is The correspondence between the value and the alarm information is customized by the user and is more open sourced.
  • the Trap fails to be parsed, the summary alarm is sent, and the pre-determined rule of the trap is received, and the custom rule is used as the parsing rule.
  • This embodiment is a system. During the self-learning process, the Trap instruction that the system cannot parse receives the parsing instruction set by the user, and stores the parsing instruction in the parsing instruction library for the next parsing of the trap call.
  • the Trap is parsed through a predefined Trap processing chain before the parsing rule parses the Trap;
  • the Trap is parsed according to the parsing rule, and the Trap is parsed by a predefined Trap processing chain, including the background, before the user-defined Trap parsing rule is used.
  • the first type and the second type of parsing rules in the technology parse the received trap.
  • the priority of the parsing rule when the trap is successfully parsed is set to be higher than other parsing rules in the parsing rule list.
  • the parsing rule that successfully parses may be set. In the front end of the parsing list.
  • the parsing rule is formed by:
  • the setting information of the user input is received on the preset interface, where the setting information is used to set the alarm type of the trap, and the alarm type includes: alarm and alarm recovery;
  • the input alarm information is received on the preset interface, and an analysis rule is generated according to the correspondence between the value of the binding variable of the trap and the alarm information, where the alarm information includes an alarm. Level, alarm name, and alarm cause.
  • the system stores alarm information and analysis rules in the database.
  • the alarm information includes: an alarm code corresponding to the alarm information of the trap, and the alarm code of each alarm information is unique in the entire system, and is automatically generated by a special module, and the alarm code and the parsing are performed.
  • the rules are also put into the data structure in memory so that they can be called at any time later to improve system efficiency.
  • a processing device for the trap command trap is provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and details are not described herein.
  • the term "module” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • FIG. 2 is a structural block diagram 1 of a processing apparatus for a trap instruction trap according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes
  • the obtaining module 22 is configured to acquire a Trap sent by the device
  • the parsing module 24 is connected to the obtaining module 22, and obtains an parsing rule corresponding to the trap, and parses the trap according to the parsing rule, where the parsing rule is an parsing rule generated according to the correspondence between the value of the binding variable and the alarm information.
  • the value of the bind variable is the value of the user-defined bind variable in the Trap;
  • the generating module 26 is connected to the parsing module 24, and is configured to generate the alarm information alarm corresponding to the binding variable carried in the trap when the trap is successfully parsed.
  • the obtaining module 22 obtains the trap sent by the device, and the parsing module 24 obtains the parsing rule corresponding to the trap, and parses the trap according to the parsing rule, wherein the parsing rule is based on the value of the binding variable and the alarm information.
  • the parsing rule generated by the corresponding relationship, the value of the bind variable is a value of a bind variable defined by the user in the trap, and the generating module 26 generates a binding variable corresponding to the trap in the trap when the trap is successfully parsed.
  • the alarm information is used to solve the problem that the virtualized hardware management system resolves the inaccurate and inflexible alarm information according to the Trap rule defined by the device MIB file, and improves the accuracy and flexibility of the user-defined Trap rule analysis alarm information.
  • FIG. 3 is a structural block diagram 2 of a processing apparatus for a trap instruction Trap according to an embodiment of the present invention. As shown in FIG. 3, the device includes:
  • the adding module 32 is connected to the parsing module 24, and is configured to receive the trapping rule of the trap when the trap is parsed after parsing the trap according to the parsing rule, and use the custom rule as the parsing rule.
  • FIG. 4 is a structural block diagram 3 of a processing apparatus for a trap instruction trap according to an embodiment of the present invention. As shown in FIG. 4, the apparatus includes:
  • the processing module 42 is connected to the obtaining module 22, and is configured to parse the Trap through a predefined Trap processing chain before parsing the Trap according to the parsing rule;
  • the second parsing module 44 is connected to the processing module 42 and configured to parse the trap according to the parsing rule when it is determined that the trap processing chain cannot parse the trap.
  • FIG. 5 is a structural block diagram 4 of a processing apparatus for a trap instruction trap according to an embodiment of the present invention. As shown in FIG. 5, the apparatus further includes:
  • the setting module 52 is connected to the parsing module 24, and is configured to set the priority of the parsing rule when the parsing succeeds to be higher than other parsing rules in the parsing rule list after the trap is successfully parsed.
  • FIG. 6 is a block diagram 5 of a processing apparatus of a trap instruction trap according to an embodiment of the present invention. As shown in FIG. 6, the apparatus further includes:
  • the receiving module 62 receives the setting information input by the user on the preset interface, where the setting information is used to set the alarm type of the trap, and the alarm type includes: alarm and alarm recovery;
  • the forming module 64 is connected to the receiving module 62, and is configured to receive the input alarm information on the preset interface when receiving the alarm type as an alarm, and form a correspondence between the value of the binding variable according to the trap and the alarm information.
  • the generated parsing rule includes the alarm level, the name of the alarm, and the cause of the alarm.
  • each of the above modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple At In the processor.
  • the preferred embodiment of the present invention provides a Trap processing method that can customize the parsing rules.
  • the technical solutions are as follows:
  • FIG. 7 is a schematic diagram of a Trap alarm processing system according to a preferred embodiment of the present invention.
  • the Trap processing method of the customizable parsing rule is a sub-module of the Trap alarm processing
  • the Trap alarm processing system includes several sub-modules, wherein
  • the module with strong correlation of the Trap processing system of the customizable rule includes: a Trap receiving module (corresponding to the obtaining module 22 of the foregoing embodiment), a predefined Trap processing module (corresponding to the processing module 42 of the foregoing embodiment), and an alarm.
  • the data query module (corresponding to the generation module 26 of the above embodiment) and the alarm transmission module (corresponding to the generation module 26 of the above embodiment).
  • the corresponding functions are:
  • Trap receiving module It is responsible for receiving traps sent by various devices to specific ports, filtering them, and putting the filtered traps into the message queue for subsequent processing.
  • Pre-defined Trap processing module It is mainly responsible for parsing the Traps in the message queue one by one using the predefined parsing rules. After the Trap is processed, an alarm data object is generated and the alarm sending module is processed. There are two types of traps that can be processed by the predefined traps. The first type is a trap corresponding to an alarm. The second type is a trap variable that distinguishes alarms. Other types of traps that cannot be processed enter the range. The Trap processing module that defines the parsing rules continues processing.
  • the alarm data query module When the trap data is generated, the corresponding alarm information is stored in the database. The alarm data query system needs to query the corresponding alarm information.
  • the alarm sending module The alarm data object generated by the Trap processing system needs to be processed by the alarm sending module to generate a corresponding alarm EMB message, which is sent to the UEP platform alarm module to generate the alarm information visible to the user.
  • the Trap processing module of the parsing rule can be customized (corresponding to the parsing module 24 of the foregoing embodiment): the trap that cannot be processed by the predefined trap processing module will be processed by the module. If the processing is not possible, the generated alarm data object is processed by the alarm sending module, and the traps that cannot be processed are stored in the trap database. Then, the user can customize the trap resolution according to the information in the trap database. For example, the function description of the adding module 32 can be parsed into corresponding alarm data objects according to the customized rules of the user after the same Trap enters the system again.
  • FIG. 8 is a schematic diagram of a Trap processing module of a customizable parsing rule according to a preferred embodiment of the present invention. As shown in FIG. 8, the following modules are further included, and the corresponding functions are:
  • Trap filters are not required for each device.
  • the Trap filter filters the traps that do not need to be processed, and generates a summary alarm object.
  • the traps to be processed are processed by other modules.
  • the Trap parser (corresponding to the parsing module 24 of the above embodiment): it is mainly responsible for the parsing work of the trap, and obtains the user-defined rule from the parsing rule base, and then parses the trap according to the rule, and generates the alarm data after the parsing succeeds. The object is sent to the alarm sending module for processing. If the parsing is unsuccessful, the summary alarm data object is generated, and the trap is stored in the trap information base for use by the Trap parsing rule customization module.
  • Trap information store Stores trap information that cannot be processed by the Trap parser.
  • the information is mainly the OID and binding variables of the trap. Users can view the information and generate parsing rules based on the information.
  • the Trap parsing rule customization module (including the adding module 32, the receiving module 62, and the forming module 64 in the foregoing embodiment): a module that helps the user to complete the parsing rule definition, obtains the Trap detailed information from the Trap information database, and sets the alarm type through the customized interface. The alarm level, the cause of the alarm, and the matching rules of the bind variables are confirmed. The alarm information and parsing rules are automatically generated in the database after confirmation.
  • the Trap parsing rule base is used to save the user-defined parsing rules.
  • the parser needs to obtain the parsing rules from the trap parsing rule base. If not, the parsing rules are directly converted into summary alarms.
  • each parsing rule corresponds to one alarm information, and each alarm information needs an alarm code. Since the alarm code of the entire system cannot be repeated, it cannot be manually input by the user, and the alarm code generator is based on the alarm in the current system. The usage of the code automatically generates a unique alarm code and adds the alarm information.
  • FIG. 9 is a flowchart of processing a Trap by a Trap processing module that can customize a parsing rule according to a preferred embodiment of the present invention. As shown in FIG. 9, the steps are as follows:
  • Step 901 Receive a Trap from the device.
  • Step 902 The Trap is processed by using a predefined Trap processing chain.
  • Step 903 If it is processed by a predefined Trap processing chain, generate a normal alarm of the alarm data object;
  • Step 904 If the Trap processing chain cannot be processed by the predefined Trap processing chain, check whether the Trap needs to continue the Trap processing of the custom parsing rule.
  • Step 905 If a Trap process of the custom parsing rule is required, the rule is obtained, and the parsing process of the custom rule is performed;
  • Step 906 If the Trap processing of the custom parsing rule cannot be performed, generating a summary alarm data object summary alarm;
  • Step 907 If the Trap processing of the custom parsing rule cannot be performed, the trap is saved to the Trap information base.
  • the Trap processing system that can customize the parsing rules first receives traps that cannot be processed, generates summary alarms, and stores traps in the trap database. The user then customizes the parsing rules based on the trap details in the trap database. When the same Trap arrives, a specific alarm is generated according to the customization of the user.
  • FIG. 10 is a flowchart of customizing a Trap parsing rule by using a Trap processing system with a customizable parsing rule according to a preferred embodiment of the present invention. As shown in FIG. 10, the steps are as follows:
  • Step 1001 Enter the Trap information database to view the Trap details, including the Trap object identifier (Object Identifier, OID for short), the binding variable, and the IP address.
  • the Trap object identifier Object Identifier, OID for short
  • Step 1002 Enter a custom rule interface by using a rule setting button of the Trap details interface.
  • Step 1003 First, set an alarm type, including alarm and alarm recovery;
  • Step 1004 If the alarm type is an alarm, input alarm information such as an alarm level, an alarm name, and an alarm cause, and input rule information of a binding variable matching relationship;
  • Step 1005 Obtain an alarm code by using an alarm code generation module.
  • Step 1006 If the alarm type is alarm recovery, open an alarm tree and select an alarm to be restored.
  • Step 1007 input alarm information such as an alarm keyword
  • step 1008 the alarm information is written into the alarm database, and the custom rule is written into the Trap rule base.
  • FIG. 11 is a schematic diagram of the Trap details interface according to the preferred embodiment of the present invention.
  • the Trap details record the name of the node that sends the Trap, and the OID of the Trap. , Send the node IP address, the time when the trap was received, whether the processing rule was customized, and the information of the bind variable.
  • the Trap Details screen has three buttons, Custom Rules, Clear and Confirm. Click the confirmation button to close the Trap details interface and do nothing; click the Clear button to delete the Trap details; click the Customize button to enter the Custom Rules interface.
  • FIG. 12 is a schematic diagram of the custom rule alarm interface according to the preferred embodiment of the present invention.
  • the alarm information such as the alarm name, the alarm level, and the alarm cause needs to be input.
  • the alarm primary key can input 0 or more binding variable names. When an alarm is generated, the value of the input binding variable will be connected with the "@" symbol as part of the alarm primary key.
  • the generated alarm primary key is similar to “ALARMKEY@10.75.0.1@307@RuleTest”.
  • FIG. 13 is a schematic diagram of an alarm recovery interface according to a preferred embodiment of the present invention.
  • the input method of the alarm primary key and the processing rule is consistent with the input method of the alarm rule, and the recovery alarm code is an alarm that can be restored by setting this rule.
  • the alarm area and the alarm code are displayed in the area to be selected.
  • the selected area and the alarm code are displayed in the selected area on the right.
  • the alarm recovery here is only for the alarms generated by the customized rules.
  • the alarms displayed in the candidate area on the left are all alarms corresponding to the custom rules. There is no alarm corresponding to the predefined rule.
  • the system After clicking OK to complete the settings, the system will organize the values entered by the interface into alarm recovery information and parsing rules for storage.
  • the alarm recovery information does not require an alarm code, but requires a unique identifier, so it is automatically generated by a special module.
  • the alarm recovery information and the parsing rules are stored in the database, and the identifier and parsing rules are also put into the data structure in the memory for later use at any time to improve system efficiency.
  • FIG. 14 is a schematic diagram of the Trap parsing rule storage structure of the preferred embodiment of the present invention. As shown in FIG. 14, the Trap OID that has been parsed by the parsing rule is saved in a set. The OID can obtain the rules and alarm codes corresponding to the Trap. If there are multiple rules, the rules are organized in a linked list. The relations in the rules are organized in a linked list.
  • the Trap filter determines whether the trap needs to be parsed according to the IP address of the trap. After the parser, the parser parses the trap according to the rules. The process of parsing is to find out whether the Trap has been customized in the OID collection. If the Trap has not been customized, the summary alarm is generated and the Trap details are saved. If the TID is found in the OID collection, Then, the rule and alarm code list corresponding to the Trap are taken out. When parsing, starting from the first rule of the linked list, the relational linked list of the rule is taken out, and the binding variables of the Trap are matched one by one.
  • the processing of the rule is ended, and the next rule is taken to continue processing.
  • the rule is successfully matched.
  • the alarm information is found according to the alarm code of the rule.
  • the alarm data object is organized and sent to the alarm sending module to end the processing. If the relationship of all the rules cannot be matched successfully, a summary alarm is generated and the trap details are saved to end the processing.
  • FIG. 15 is a schematic diagram of optimization of a Trap parsing rule storage structure according to a preferred embodiment of the present invention. As shown in FIG. 15, after each Trap parsing, if a rule is successfully matched, the rule is moved to the forefront of the rule list. Therefore, after multiple Trap parsing processes, the alarm rules that often occur will be at the forefront of the rule list, so the efficiency of processing will be much improved.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present invention which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present invention.
  • Embodiments of the present invention also provide a storage medium.
  • the foregoing storage medium may be Set to store program code for performing the method steps of the above embodiments:
  • the storage medium is further arranged to store program code for performing the method steps of the above-described embodiments:
  • the foregoing storage medium may include, but not limited to, a USB flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, and a magnetic memory.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • a mobile hard disk e.g., a hard disk
  • magnetic memory e.g., a hard disk
  • the processor performs the method steps of the foregoing embodiments according to the stored program code in the storage medium.
  • modules or steps of the present invention described above can be implemented by a general-purpose computing device that can be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the trap sent by the device is obtained, the parsing rule corresponding to the trap is obtained, and the trap is parsed according to the parsing rule, where the parsing rule is based on the value of the binding variable and the alarm information.
  • the parsing rule generated by the corresponding relationship, the value of the bind variable is the value of the bind variable defined by the user in the trap.
  • the alarm corresponding to the bind variable carried in the trap is generated.
  • the information alarm solves the problem that the virtualized hardware management system resolves the inaccurate and inflexible alarm information according to the Trap rule defined by the device MIB file, and improves the accuracy and flexibility of the user-defined Trap rule analysis alarm information.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明提供了一种陷阱指令Trap的处理方法及装置,其中,该方法包括:获取设备发送的Trap,获取与该Trap对应的解析规则,并依据该解析规则解析该Trap,其中,该解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,该绑定变量的值为该Trap中用户定义的绑定变量的值,在解析该Trap成功的情况下,生成与该Trap中携带的绑定变量对应的该告警信息告警。采用上述技术方案,解决了虚拟化硬件管理系统根据设备MIB文件定义的Trap规则解析告警信息不准确和不灵活的问题,提高了用户自定义的Trap规则解析告警信息准确性和灵活性。

Description

陷阱指令Trap的处理方法及装置 技术领域
本发明涉及通信领域,具体而言,涉及一种陷阱指令Trap的处理方法及装置。
背景技术
在相关技术中,硬件设备都通过主动发送陷阱指令Trap的方式来表明设备发生了故障或者变更。而虚拟化硬件管理也需要用适当的规则把设备上报的Trap解析为用户可读的告警消息,从而进行故障判断和维护。由于不同的设备会定义不同的Trap,因此在虚拟化硬件管理中如何定义解析各种Trap的规则是Trap处理最重要的内容。
虚拟化硬件管理对Trap解析规则的定义主要采用了开发时预定义的方式。开发时预定义的方式是开发者在开发阶段通过对设备管理信息库(Management Information Base,简称为MIB)文件或设备厂家提供的资料的分析,整理出解析Trap的规则并预先定义在虚拟化硬件管理系统中,用户使用时不再进行额外的定制工作。这种方式的优点是省去了用户的工作,增加了系统的易用性,不足之处是系统不够灵活,对某些Trap的处理存在缺陷。开发时预定义的方式之所有会有这样的不足,主要是因为各种设备Trap定义自身的特点造成的。从开发者分析Trap的角度出发,主要把Trap分为三种类型:第一种类型的设备在MIB文件中定义了多条Trap,每一条Trap代表一种告警,这种类型只需分析MIB文件中的Trap定义就可以定制解析规则。第二种类型的设备在MIB文件中只定义了一条或少数几条Trap,Trap中的某个绑定变量有有限的值,不同的值代表不同的告警,这种类型只需厂家提供绑定变量的值和对应的告警描述就可定制解析规则。第三种类型的设备在MIB文件中只定义了一条或少数几条Trap,不同的Trap通过绑定变量区分,但Trap的绑定变量没有确定的值,厂家也不能提供绑定变量的值和对应的告警描述,这种类型的设备无法定制具体规则。
由此可以看出,在使用开发时预定义的方式处理Trap时,对于第一种和第二种类型的设备,解析Trap的规则不够灵活。而对于第三种类型的设备,处理起来就比较困难,相关技术的处理方式是采用概要告警,即根据设备MIB文件定义的Trap来定义规则,有几条Trap就定义几条概要告警,这样处理的不足之处是一条Trap本来应该通过绑定变量的不同而产生不同的告警,经过虚拟化硬件管理的处理之后就只能产生相同告警级别和告警名称的单一概要告警,虽然告警详细内容会因为绑定变量值的不同而不同,但也不利于用户进行告警区分。
针对相关技术中,虚拟化硬件管理系统根据设备MIB文件定义的Trap规则解析告警信息不准确和不灵活的问题,目前还没有有效的解决方案。
发明内容
本发明提供了一种陷阱指令Trap的处理方法及装置,以至少解决相关技术中虚拟化硬件 管理系统根据设备MIB文件定义的Trap规则解析告警信息不准确和不灵活的问题。
根据本发明的一个实施例,提供了一种陷阱指令Trap的处理方法,包括:
获取设备发送的Trap;
获取与所述Trap对应的解析规则,并依据所述解析规则解析所述Trap,其中,所述解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,所述绑定变量的值为所述Trap中用户定义的绑定变量的值;
在解析所述Trap成功的情况下,生成与所述Trap中携带的绑定变量对应的所述告警信息告警。
在本发明的实施例中,在依据所述解析规则解析所述Trap之后,所述方法还包括:在解析所述Trap失败的情况下,接收所述Trap的预定制规则,将所述定制规则作为所述解析规则。
在本发明的实施例中,在依据所述解析规则解析所述Trap之前,所述方法包括:
通过预定义的Trap处理链解析所述Trap;
在判断所述Trap处理链不能解析所述Trap时,依据所述解析规则解析所述Trap。
在本发明的实施例中,在解析所述Trap成功的情况下之后,所述方法还包括:将解析所述Trap成功时的所述解析规则的优先级设置为高于解析规则链表中其它解析规则。
在本发明的实施例中,所述解析规则通过以下方式形成:
在预设界面上接收用户输入的设置信息,其中,所述设置信息用于设置所述Trap的告警类型,所述告警类型包括:告警和告警恢复;
在接收到所述告警类型为告警时,在所述预设界面上接收输入的告警信息,形成依据所述Trap的绑定变量的值与告警信息的对应关系生成的解析规则,其中,所述告警信息包括告警级别、告警名称以及告警原因。
在本发明的实施例中,所述告警信息包括:用于标识与所述Trap的告警信息对应的告警码。
根据本发明的另一实施例,提供了一种陷阱指令Trap的处理装置,包括:
获取模块,设置为获取设备的发送的Trap;
解析模块,获取与所述Trap对应的解析规则,并依据所述解析规则解析所述Trap,其中,所述解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,所述绑定变量的值为所述Trap中用户定义的绑定变量的值;
生成模块,设置为在解析所述Trap成功的情况下,生成与所述Trap中携带的绑定变量对应的所述告警信息告警。
在本发明的实施例中,所述装置还包括:添加模块,设置为在依据所述解析规则解析所述Trap之后,在解析所述Trap失败的情况下,接收所述Trap的预定制规则,将所述定制规则作为所述解析规则。
在本发明的实施例中,所述装置还包括:
处理模块,设置为在依据所述解析规则解析所述Trap之前,通过预定义的Trap处理链解析所述Trap;
第二解析模块,设置为在判断所述Trap处理链不能解析所述Trap时,依据所述解析规则解析所述Trap。
在本发明的实施例中,所述装置还包括:
设置模块,设置为在解析所述Trap成功的情况下之后,将解析所述Trap成功时的所述解析规则的优先级设置为高于解析规则链表中其它解析规则。
在本发明的实施例中,所述装置还包括:
接收模块,设置为在预设界面上接收用户输入的设置信息,其中,所述设置信息用于设置所述Trap的告警类型,所述告警类型包括:告警和告警恢复;
形成模块,设置为在接收到所述告警类型为告警时,在所述预设界面上接收输入的告警信息,形成依据所述Trap的绑定变量的值与告警信息的对应关系生成的解析规则,其中,所述告警信息包括告警级别、告警名称以及告警原因。
通过本发明,获取设备发送的Trap,获取与该Trap对应的解析规则,并依据该解析规则解析该Trap,其中,该解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,该绑定变量的值为该Trap中用户定义的绑定变量的值,在解析该Trap成功的情况下,生成与该Trap中携带的绑定变量对应的该告警信息告警,解决了虚拟化硬件管理系统根据设备MIB文件定义的Trap规则解析告警信息不准确和不灵活的问题,提高了用户自定义的Trap规则解析告警信息准确性和灵活性。
附图说明
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:
图1是根据本发明实施例的一种陷阱指令Trap的处理方法的流程图;
图2是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图一;
图3是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图二;
图4是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图三;
图5是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图四;
图6是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图五;
图7是本发明优选实施例的Trap告警处理系统示意图;
图8是本发明优选实施例的可自定义解析规则的Trap处理模块的示意图;
图9是本发明优选实施例通过可自定义解析规则的Trap处理模块处理Trap的流程图;
图10是本发明优选实施例通过可自定义解析规则的Trap处理系统定制Trap解析规则的流程图;
图11是本发明优选实施例的Trap详情界面示意图;
图12是本发明优选实施例的定制规则告警界面示意图;
图13是本发明优选实施例的告警恢复界面示意图;
图14是本发明优选实施例的Trap解析规则存储结构示意图;
图15是本发明优选实施例Trap解析规则存储结构优化示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
在本实施例中提供了一种陷阱指令Trap的处理方法,图1是根据本发明实施例的一种陷阱指令Trap的处理方法的流程图,如图1所示,该流程包括如下步骤:
步骤S102,获取设备发送的Trap;;
步骤S104,获取与该Trap对应的解析规则,并依据该解析规则解析该Trap,其中,该解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,该绑定变量的值为该Trap中用户定义的绑定变量的值;
步骤S106,在解析该Trap成功的情况下,生成与该Trap中携带的绑定变量对应的该告警信息告警。
通过上述步骤,获取设备发送的Trap,获取与该Trap对应的解析规则,并依据该解析规则解析该Trap,其中,该解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,该绑定变量的值为该Trap中用户定义的绑定变量的值,在解析该Trap成功的情况下,生成与该Trap中携带的绑定变量对应的该告警信息告警,解决了虚拟化硬件管理系统根据设备 MIB文件定义的Trap规则解析告警信息不准确和不灵活的问题,提高了用户自定义的Trap规则解析告警信息准确性和灵活性。与背景技术中描述的第二种类型设备解析Trap相比,第二种类型的绑定变量有有限的值,值与告警信息的对应关系由厂家定制好的,本实施中,绑定变量的值与告警信息的对应关系由用户自定义,更加开源化设计。
在本实施例中,在调用解析规则解析该Trap之后,在解析该Trap失败的情况下,发出概要告警,接收该Trap的预定制规则,将该定制规则作为该解析规则,本实施例是个系统自学习的过程,遇到系统解析不了的Trap指令接收用户自定义设置的解析指令,并将该解析指令存到解析指令库中,用于下次解析Trap调用。
在本实施例中,在调用解析规则解析该Trap之前,通过预定义的Trap处理链解析该Trap;
在判断该Trap处理链不能解析该Trap时,依据该解析规则解析该Trap,在使用用户定义的Trap解析规则前,通过预定义的Trap处理链解析该Trap,该预定义的Trap处理链包括背景技术中的第一类型和第二类型解析规则对接收到的Trap解析。
在本实施例中,在解析该Trap成功的情况下之后,将解析该Trap成功时的该解析规则的优先级设置为高于解析规则链表中其它解析规则,例如可以将解析成功的解析规则置于解析链表的前端。
在本实施例中,该解析规则通过以下方式形成:
在预设界面上接收用户输入的设置信息,其中,该设置信息用于设置该Trap的告警类型,该告警类型包括:告警和告警恢复;
在接收到该告警类型为告警时,在该预设界面上接收输入的告警信息,形成依据该Trap的绑定变量的值与告警信息的对应关系生成的解析规则,其中,该告警信息包括告警级别、告警名称以及告警原因,系统将告警信息和解析规则存放到数据库。
在本实施例中,该告警信息包括:用于标识与该Trap的告警信息对应的告警码,每条告警信息的告警码在整个系统是唯一的,由专门的模块自动生成,告警码和解析规则除了放到数据库中,还会放入内存中的数据结构,以便以后随时调用,提高系统效率。
在本实施例中还提供了一种陷阱指令Trap的处理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图2是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图一,如图2所示,该装置包括
获取模块22,设置为获取设备的发送的Trap;
解析模块24,与获取模块22连接,获取与该Trap对应的解析规则,并依据该解析规则解析该Trap,其中,该解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则, 该绑定变量的值为该Trap中用户定义的绑定变量的值;
生成模块26,与解析模块24连接,设置为在解析该Trap成功的情况下,生成与该Trap中携带的绑定变量对应的该告警信息告警。
通过本发明,获取模块22获取设备发送的Trap,解析模块24获取与该Trap对应的解析规则,并依据该解析规则解析该Trap,其中,该解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,该绑定变量的值为该Trap中用户定义的绑定变量的值,生成模块26在解析该Trap成功的情况下,生成与该Trap中携带的绑定变量对应的该告警信息告警,解决了虚拟化硬件管理系统根据设备MIB文件定义的Trap规则解析告警信息不准确和不灵活的问题,提高了用户自定义的Trap规则解析告警信息准确性和灵活性。
图3是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图二,如图3所示,该装置除包括图2所示的所有模块外,还包括:
添加模块32,与解析模块24连接,设置为在依据该解析规则解析该Trap之后,在解析该Trap失败的情况下,接收该Trap的预定制规则,将该定制规则作为该解析规则。
图4是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图三,如图4所示,该装置除包括图2所示的所有模块外,该装置还包括:
处理模块42,与获取模块22连接,设置为在依据该解析规则解析该Trap之前,通过预定义的Trap处理链解析该Trap;
第二解析模块44,与处理模块42连接,设置为在判断该Trap处理链不能解析该Trap时,依据该解析规则解析该Trap。
图5是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图四,如图5所示,该装置还包括:
设置模块52,与解析模块24连接,设置为在解析该Trap成功的情况下之后,将解析该Trap成功时的该解析规则的优先级设置为高于解析规则链表中其它解析规则。
图6是根据本发明实施例的一种陷阱指令Trap的处理装置的结构框图五,如图6所示,,该装置还包括:
接收模块62,在预设界面上接收用户输入的设置信息,其中,该设置信息用于设置该Trap的告警类型,该告警类型包括:告警和告警恢复;
形成模块64,与接收模块62连接,设置为在接收到该告警类型为告警时,在该预设界面上接收输入的告警信息,形成依据该Trap的绑定变量的值与告警信息的对应关系生成的解析规则,其中,该告警信息包括告警级别、告警名称以及告警原因。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处 理器中。
下面结合本发明的优选实施例进行详细说明。
为了克服相关技术中预定义解析规则的缺点,本发明优选实施例提出了一种可自定义解析规则的Trap处理方法,所述技术方案如下:
图7是本发明优选实施例的Trap告警处理系统示意图,如图7所示,可自定义解析规则的Trap处理方法是Trap告警处理的一个子模块,Trap告警处理系统包含若干子模块,其中和可自定义解析规则的Trap处理系统相关性较强的模块包括:Trap接收模块(相当于上述实施例的获取模块22),预定义Trap处理模块(相当于上述实施例的处理模块42),告警数据查询模块(相当于上述实施例的生成模块26),告警发送模块(相当于上述实施例的生成模块26)。其对应的功能分别是:
Trap接收模块:其主要负责接收各种设备发到特定端口的Trap,并进行过滤,并将过滤后的Trap放入消息队列,等待后续的处理。
预定义Trap处理模块:其主要负责使用预定义的解析规则对消息队列中的Trap逐一进行解析处理,Trap经处理后生成告警数据对象,进入告警发送模块进行处理。预定义Trap处理模块能够处理的Trap类型有两种,第一种类型是一条Trap对应一条告警,第二种类型是通过Trap的绑定变量来区分告警,其他不能处理的Trap类型将进入可自定义解析规则的Trap处理模块继续进行处理。
告警数据查询模块:Trap经处理后生成告警数据对象时,其对应的告警信息存储在数据库中,需要通过告警数据查询系统查询相应的告警信息。
告警发送模块:经Trap处理系统处理后生成的告警数据对象需要由告警发送模块进行处理,生成相应的告警EMB消息,发送到UEP平台告警模块后生成用户可见的告警信息。
可自定义解析规则的Trap处理模块(相当于上述实施例的解析模块24):预定义Trap处理模块不能处理的Trap将由本模块继续处理。如果不能处理,将生成概要告警数据对象交由告警发送模块处理,同时将不能处理的Trap存入Trap信息库,之后用户可以根据Trap信息库中的信息定制Trap解析规则(此处相当于上述实施例的添加模块32的功能描述),当同样的Trap再次进入本系统以后就能根据用户的定制规则解析成相应告警数据对象。
图8是本发明优选实施例的可自定义解析规则的Trap处理模块的示意图,如图8所示,又包括以下模块,其对应功能分别是:
Trap过滤器:并不是每种设备的Trap都需要进行自定义规则的解析处理,Trap过滤器对不需要处理的Trap进行过滤,直接生成概要告警对象,需要处理的Trap交由其他模块继续处理。
Trap解析器(相当于上述实施例的解析模块24):其主要负责Trap的解析工作,其从解析规则库中取得用户定义的规则,然后依据规则对Trap进行解析,解析成功后生成告警数据 对象,交由告警发送模块处理,如果解析不成功,则生成概要告警数据对象,并且把Trap存入Trap信息库,供Trap解析规则定制模块使用。
Trap信息库:存放不能被Trap解析器处理的Trap信息,这些信息主要是Trap的OID和绑定变量,用户可以查看这些信息,并根据这些信息生成解析规则。
Trap解析规则定制模块(包括上述实施例中添加模块32、接收模块62和形成模块64):帮助用户完成解析规则定义的模块,其从Trap信息库获得Trap详细信息,通过定制界面设置告警类型、告警级别、告警原因和绑定变量的匹配规则等内容,确认以后自动生成告警信息和解析规则存储在数据库中。
Trap解析规则库:用于保存用户定制的解析规则,当Trap处理时,解析器需要从Trap解析规则库中获取解析规则,如果不能获取则直接转成概要告警。
告警码生成器:每条解析规则对应一条告警信息,每条告警信息需要一个告警码,由于整个系统的告警码不能重复,所以不能由用户手动输入,而由告警码生成器根据当前系统中告警码的使用情况自动生成唯一的告警码加入告警信息。
图9是本发明优选实施例通过可自定义解析规则的Trap处理模块处理Trap的流程图,如图9所示,步骤如下:
步骤901,接收到设备发送Trap;
步骤902,通过预定义的Trap处理链对Trap进行处理;
步骤903,如果能被预定义的Trap处理链处理,生成告警数据对象正常告警;
步骤904,如果不能被预定义的Trap处理链处理,先检查Trap是否需要继续进行自定义解析规则的Trap处理;
步骤905,如果需要进行自定义解析规则的Trap处理,则获取规则,进行自定义规则的解析处理;
步骤906,如果不能被自定义解析规则的Trap处理,则生成概要告警数据对象概要告警;
步骤907,如果不能被自定义解析规则的Trap处理,则将Trap保存到Trap信息库。
可自定义解析规则的Trap处理系统首先要收到不能被处理的Trap,产生概要告警,将Trap存入Trap信息库,然后用户再根据Trap信息库中的Trap详情进行解析规则定制,之后再有相同的Trap到达后就会根据用户的定制生成具体的告警。
图10是本发明优选实施例通过可自定义解析规则的Trap处理系统定制Trap解析规则的流程图,如图10所示,步骤如下:
步骤1001,进入Trap信息库,查看Trap详情,包括Trap对象标识符(Object Identifier,简称为OID)、绑定变量、发送IP等信息;
步骤1002,通过Trap详情界面的规则设置按钮进入定制规则界面;
步骤1003,首先设置告警类型,包括告警和告警恢复;
步骤1004,如果告警类型是告警则输入告警级别、告警名称、告警原因等告警信息,输入绑定变量匹配关系的规则信息;
步骤1005,通过告警码生成模块获得告警码;
步骤1006,如果告警类型是告警恢复则打开告警树选择要恢复的告警;
步骤1007,输入告警关键字等告警信息;
步骤1008,将告警信息写入告警数据库,将自定义规则写入Trap规则库。
本发明优选实施例的实施方式包括:
虚拟化硬件管理启动时会从Trap信息库和Trap解析规则库中加载数据到内存中,如果虚拟化硬件管理是第一次运行,Trap信息库和Trap解析规则库都是没有内容的,需要先收到设备的概要告警,并在Trap信息库中保存Trap详情,图11是本发明优选实施例的Trap详情界面示意图,如图11所示,Trap详情记录了发送Trap的节点名称,Trap的OID,发送节点IP地址,接收到Trap的时间,是否定制过处理规则,以及绑定变量的信息。Trap详情界面有三个按钮,分别是定制规则、清除和确认。点击确认按钮可以关闭Trap详情界面,不做任何操作;点击清除按钮可以删除此条Trap详情;点击定制规则按钮可以进入定制规则界面。
在定制规则界面可以设置告警规则和告警恢复规则,图12是本发明优选实施例的定制规则告警界面示意图,如图12所示,需要输入告警名称、告警级别、告警原因等告警信息。告警主键可以输入0个或多个绑定变量名,在生成告警时,输入的绑定变量的值将用“@”符号连接起来,作为告警主键的一部分。
比如图12中,deviceHostIP=10.75.0.1deviceErrorCode=307,deviceUserLabel=RuleTest,则生成的告警主键类似“ALARMKEY@10.75.0.1@307@RuleTest”,当其中一个变量值不同的时候,告警主键会不同,生成的告警也不相同。处理规则可以输入0个或多个绑定变量名和值的关系式,关系有“==,!=,<,>,<=,>=,like,!like”八种,所有关系式之间是逻辑与的关系,即必须同时满足所有的这些关系,图中的设置类似于这样的逻辑关系“deviceHostIP==10.75.0.1&&deviceErrorCode==307&&deviceUserLabel like RuleTest&&componentType!=5”。告警主键和处理规则输入的绑定变量名都必须是Trap支持的,如果Trap不支持就没有效果。点击确认完成设置后,系统会把界面输入的值组织成告警信息和解析规则进行存放,其中告警信息有一条重要的数据告警码还没有明确,因为告警码在整个系统中必须是唯一的,因此由专门的模块自动生成。之后告警信息和解析规则都被存入数据库,告警码和解析规则还会放入内存中的数据结构,以便以后随时使用,提高系统效率。
图13是本发明优选实施例的告警恢复界面示意图,如图13所示,告警主键和处理规则的输入方法和告警规则的输入方法一致,恢复告警码是设置这条规则能够恢复的告警,左边 的待选项区域显示告警名称及告警码,右边的已选项区域显示已选择的告警名称及告警码,当这条规则匹配成功后,已选择区域的告警会被恢复掉。因为开发时预定义的Trap处理规则和自定义的Trap处理规则不同,因此这里的告警恢复只针对自定义的规则产生的告警,即左边的待选项区域显示的告警都是自定义规则对应的告警,而没有预定义规则对应的告警。点击确认完成设置后,系统会把界面输入的值组织成告警恢复信息和解析规则进行存放,其中告警恢复信息不需要告警码,但需要一条唯一的标识符,因此由专门的模块自动生成。之后告警恢复信息和解析规则都被存入数据库,标识符和解析规则还会放入内存中的数据结构,以便以后随时使用,提高系统效率。
根据Trap详情定制了解析规则后,再接收到相同的Trap就能进行解析处理了。先看一下Trap解析规则在内存中的存储结构,图14是本发明优选实施例的Trap解析规则存储结构示意图,如图14所示,进行过解析规则定制的Trap OID被保存在一个集合里,通过OID可以取得Trap对应的规则和告警码,如果规则有多条则以链表的形式组织,规则中的关系式以链表的形式组织。
Trap进入可自定义解析规则的Trap处理系统后,首先Trap过滤器会根据发送Trap的IP地址判断这条Trap是否需要进行自定义规则解析,通过之后解析器就会根据规则对这条Trap进行解析,解析的过程是先在OID集合中查找这条Trap是否进行过规则定制,如果查不到说明Trap还没有进行过规则定制,直接产生概要告警,并保存Trap详情;如果在OID集合中查到则取出Trap对应的规则和告警码链表。解析时从链表的第一条规则开始,取出规则的关系式链表,逐一与Trap的绑定变量进行匹配,任何一个关系式不匹配则结束这条规则的处理,取下一条规则继续处理。当某条规则的所有关系式都匹配时,说明这条规则匹配成功,根据这条规则的告警码查到告警信息,组织成告警数据对象交由告警发送模块,结束本次处理。如果所有规则的关系式都不能匹配成功,则产生概要告警,并保存Trap详情,结束本次处理。
由于规则的处理是根据规则链表的顺序从第一条依次向后进行处理,如果一条经常发生的告警规则处于链表的末尾的话,每次的处理就会解析每一条规则,效率较低,为解决这个问题,图15是本发明优选实施例Trap解析规则存储结构优化示意图,如图15所示,每次Trap解析完之后,如果有规则匹配成功,则将这条规则移至规则链表的最前端,这样在多次Trap解析处理之后,经常发生的告警规则就会处于规则链表的最前端,这样处理的效率就会提高很多。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明各个实施例所述的方法。
本发明的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被 设置为存储用于执行上述实施例方法步骤的程序代码:
可选地,存储介质还被设置为存储用于执行上述实施例的方法步骤的程序代码:
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
可选地,在本实施例中,处理器根据存储介质中已存储的程序代码执行上述实施例的方法步骤。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。
以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。
工业实用性
基于本发明实施例提供的上述技术方案,获取设备发送的Trap,获取与该Trap对应的解析规则,并依据该解析规则解析该Trap,其中,该解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,该绑定变量的值为该Trap中用户定义的绑定变量的值,在解析该Trap成功的情况下,生成与该Trap中携带的绑定变量对应的该告警信息告警,解决了虚拟化硬件管理系统根据设备MIB文件定义的Trap规则解析告警信息不准确和不灵活的问题,提高了用户自定义的Trap规则解析告警信息准确性和灵活性。

Claims (11)

  1. 一种陷阱指令Trap的处理方法,包括:
    获取设备发送的Trap;
    获取与所述Trap对应的解析规则,并依据所述解析规则解析所述Trap,其中,所述解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,所述绑定变量的值为所述Trap中用户定义的绑定变量的值;
    在解析所述Trap成功的情况下,生成与所述Trap中携带的绑定变量对应的所述告警信息告警。
  2. 根据权利要求1所述的方法,其中,在依据所述解析规则解析所述Trap之后,所述方法还包括:
    在解析所述Trap失败的情况下,接收所述Trap的预定制规则,将所述定制规则作为所述解析规则。
  3. 根据权利要求1所述的方法,其中,在依据所述解析规则解析所述Trap之前,所述方法包括:
    通过预定义的Trap处理链解析所述Trap;
    在判断所述Trap处理链不能解析所述Trap时,依据所述解析规则解析所述Trap。
  4. 根据权利要求1所述的方法,其中,在解析所述Trap成功的情况下之后,所述方法还包括:
    将解析所述Trap成功时的所述解析规则的优先级设置为高于解析规则链表中其它解析规则。
  5. 根据权利要求1所述的方法,其中,所述解析规则通过以下方式形成:
    在预设界面上接收用户输入的设置信息,其中,所述设置信息用于设置所述Trap的告警类型,所述告警类型包括:告警和告警恢复;
    在接收到所述告警类型为告警时,在所述预设界面上接收输入的告警信息,形成依据所述Trap的绑定变量的值与告警信息的对应关系生成的解析规则,其中,所述告警信息包括告警级别、告警名称以及告警原因。
  6. 根据权利要求1至5任一项所述的方法,其中,所述告警信息包括:
    用于标识与所述Trap的告警信息对应的告警码。
  7. 一种陷阱指令Trap的处理装置,包括:
    获取模块,设置为获取设备的发送的Trap;
    解析模块,获取与所述Trap对应的解析规则,并依据所述解析规则解析所述Trap,其中,所述解析规则是依据绑定变量的值与告警信息的对应关系生成的解析规则,所述绑定变量的值为所述Trap中用户定义的绑定变量的值;
    生成模块,设置为在解析所述Trap成功的情况下,生成与所述Trap中携带的绑定变量对应的所述告警信息告警。
  8. 根据权利要求7所述的装置,其中,所述装置还包括:
    添加模块,设置为在依据所述解析规则解析所述Trap之后,在解析所述Trap失败的情况下,接收所述Trap的预定制规则,将所述定制规则作为所述解析规则。
  9. 根据权利要求7所述的装置,其中,所述装置还包括:
    处理模块,设置为在依据所述解析规则解析所述Trap之前,通过预定义的Trap处理链解析所述Trap;
    第二解析模块,设置为在判断所述Trap处理链不能解析所述Trap时,依据所述解析规则解析所述Trap。
  10. 根据权利要求7所述的装置,其中,所述装置还包括:
    设置模块,设置为在解析所述Trap成功的情况下之后,将解析所述Trap成功时的所述解析规则的优先级设置为高于解析规则链表中其它解析规则。
  11. 根据权利要求7所述的装置,其中,所述装置还包括:
    接收模块,设置为在预设界面上接收用户输入的设置信息,其中,所述设置信息用于设置所述Trap的告警类型,所述告警类型包括:告警和告警恢复;
    形成模块,设置为在接收到所述告警类型为告警时,在所述预设界面上接收输入的告警信息,形成依据所述Trap的绑定变量的值与告警信息的对应关系生成的解析规则,其中,所述告警信息包括告警级别、告警名称以及告警原因。
PCT/CN2016/076899 2016-01-08 2016-03-21 陷阱指令Trap的处理方法及装置 WO2017117870A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610014716.6A CN106959903A (zh) 2016-01-08 2016-01-08 陷阱指令Trap的处理方法及装置
CN201610014716.6 2016-01-08

Publications (1)

Publication Number Publication Date
WO2017117870A1 true WO2017117870A1 (zh) 2017-07-13

Family

ID=59273201

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/076899 WO2017117870A1 (zh) 2016-01-08 2016-03-21 陷阱指令Trap的处理方法及装置

Country Status (2)

Country Link
CN (1) CN106959903A (zh)
WO (1) WO2017117870A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117181A (zh) * 2018-07-24 2019-01-01 郑州云海信息技术有限公司 一种标识的生成方法及装置
CN113608999A (zh) * 2021-07-08 2021-11-05 宁畅信息产业(北京)有限公司 基于Linux系统处理snmptrap的方法、设备及存储介质
CN116095203A (zh) * 2023-01-31 2023-05-09 中国电信国际有限公司 基于trap消息的解析方法及相关设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110698A (zh) * 2006-07-21 2008-01-23 中兴通讯股份有限公司 陷阱解析与预处理系统及方法
CN103997420A (zh) * 2014-04-22 2014-08-20 上海斐讯数据通信技术有限公司 trap信息的处理方法及装置
CN105187258A (zh) * 2015-09-30 2015-12-23 北京英诺威尔科技股份有限公司 一种可配置的Trap告警解析处理方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101605045A (zh) * 2008-06-10 2009-12-16 中兴通讯股份有限公司 一种告警通知消息的上报方法
CN102546260A (zh) * 2012-02-06 2012-07-04 烽火通信科技股份有限公司 一种基于snmp网络管理的模拟器
CN103595569A (zh) * 2013-11-15 2014-02-19 南京云川信息技术有限公司 一种网络管理系统中的告警信息入库的处理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101110698A (zh) * 2006-07-21 2008-01-23 中兴通讯股份有限公司 陷阱解析与预处理系统及方法
CN103997420A (zh) * 2014-04-22 2014-08-20 上海斐讯数据通信技术有限公司 trap信息的处理方法及装置
CN105187258A (zh) * 2015-09-30 2015-12-23 北京英诺威尔科技股份有限公司 一种可配置的Trap告警解析处理方法

Also Published As

Publication number Publication date
CN106959903A (zh) 2017-07-18

Similar Documents

Publication Publication Date Title
US20160179495A1 (en) Device and method for packaging application
CN109739717B (zh) 一种页面数据采集的方法及装置、服务器
CN110932918B (zh) 日志数据采集方法、装置及存储介质
EP3101842B1 (en) Method, system and computer readable medium for network management automation
CN105550325A (zh) 一种数据管理方法和装置
US9942409B1 (en) System and computer-implemented method for translating coding language for graphical scripts
CN112154420A (zh) 自动智能云服务测试工具
CN109582289B (zh) 规则引擎中规则流的处理方法、系统、存储介质和处理器
WO2017117870A1 (zh) 陷阱指令Trap的处理方法及装置
US10083070B2 (en) Log file reduction according to problem-space network topology
CN110941632A (zh) 一种数据库审计方法、装置及设备
CN106682210B (zh) 日志文件查询方法及装置
CN113419935B (zh) 移动端性能监控方法、装置、设备及存储介质
CN115242434A (zh) 应用程序接口api的识别方法及装置
CN106936660B (zh) 数据采集方法和装置
CN107330031B (zh) 一种数据存储的方法、装置及电子设备
CN112988600A (zh) 业务场景测试方法、装置、电子设备及存储介质
CN110532184B (zh) 多场景模拟响应的方法、装置、计算机设备及存储介质
CN109921920A (zh) 一种故障信息处理方法与相关装置
CN108415994B (zh) 一种网络管理系统报表生成方法、装置和设备
CN103617093B (zh) 一种解决终端故障的方法、客户端和系统
CN116628215A (zh) 数据资产管理方法、控制装置及可读存储介质
CN111352824B (zh) 测试方法、装置及计算机设备
CN113377682A (zh) 服务测试方法及装置
CN113391904B (zh) 一种基于分布式框架的简批量定制调度方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16883014

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16883014

Country of ref document: EP

Kind code of ref document: A1