Summary of the invention
What the present invention solved is cannot obtain by normal MIB node the problem of specific information in prior art.
For addressing the above problem, the invention provides a kind of processing method of trap information, comprising:
When alarm event produces, judge whether to exist the trap information of mating with this alarm event;
When there is the trap information of coupling, judge whether the additional information in described trap information is empty;
When described additional information is not sky, travels through described trap information and whether comprise special binding variable;
When comprising special binding variable, the value of additional information is set to the codomain that special variable is corresponding.
Optionally, the processing method of described trap information also comprises: other information in trap information are processed according to predetermined manner, and reported after the trap information after processing is encapsulated.
Optionally, describedly judge whether the additional information in described trap information is that empty step comprises:
Obtain the OID information of described trap information;
Whether the additional information that judges described trap information according to the OID information getting is empty.
Optionally, the processing method of described trap information also comprises:
When described additional information is sky, travel through other information in described trap information;
Other information in described trap information are processed according to predetermined manner;
After being encapsulated, other information in trap information after processing report.
Optionally, the processing method of described trap information also comprises:
When described trap information does not comprise special binding variable, travel through other information in described trap information;
Other information in described trap information are processed according to predetermined manner;
After being encapsulated, other information in trap information after processing report.
The present invention also provides a kind of processing unit of trap information, comprising:
Matching unit, is suitable for when alarm event produces, and judges whether to exist the trap information of mating with this alarm event;
Judging unit, is suitable for when there is the trap information of coupling, judges whether the additional information in described trap information is empty;
Query unit, is suitable for, when described additional information is not sky, travels through described trap information and whether comprising special binding variable;
The first processing unit, is suitable for when comprising special binding variable, and the value of additional information is set to the codomain that special variable is corresponding.
Optionally, the processing unit of described trap information also comprises:
The second processing unit, is suitable for other information in trap information to process according to predetermined manner;
Encapsulation unit, be suitable for and the trap information after processing is encapsulated after report.
Optionally, described the second processing unit, is also suitable for, when described additional information is sky, traveling through other information in described trap information, and other information in described trap information are processed according to predetermined manner;
Described encapsulation unit, reports after being also suitable for other information in the trap information after processing to encapsulate.
Optionally, described the second processing unit, is also suitable for, when described trap information does not comprise special binding variable, traveling through other information in described trap information, and other information in described trap information are processed according to predetermined manner;
Described encapsulation unit, reports after being also suitable for other information in the trap information after processing to encapsulate.
Optionally, described judging unit comprises:
Acquiring unit, is suitable for obtaining the OID information of described trap information;
Verification unit, is suitable for judging according to the OID information getting whether the additional information of described trap information is empty.
Compared with prior art, technical scheme of the present invention has the following advantages:
The processing method of trap information of the present invention, specific information needs being reported by predetermined set adds in the additional information in trap information, and by the special binding variable in judgement additional information, the value of additional information is set to the codomain that special variable is corresponding, thereby increased the content of trap information, realized the reporting functions of specific information.
Further, in the processing method of trap information of the present invention, while not comprising specific information in trap information, be that additional information is while being sky, other information in described trap information are processed according to predetermined manner, and report after the trap information after processing is encapsulated, so just can realize reporting of normal information.That is to say, the present invention is given the correct time and also can be realized reporting of specific information in normal information, thereby has improved trap practicality of information.
Embodiment
As described in the background art, existing trap information only can report the normal information of MIB node upper giving the correct time, the content reporting is fixed, cannot realize reporting of specific information by MIB node, and these specific informations may be important and very significant, so just may cause and cannot carry out real-time management to the state of equipment, thereby affect the performance of system.
The present invention adds in the additional information of trap information by the specific information that needs are reported, and the value of additional information is set to the codomain that special variable is corresponding, on being carried out, trap information gives the correct time like this, the specific information that just user can be needed reports simultaneously, thereby increased the content of trap information, and realized the reporting functions of specific information.
For above-mentioned purpose of the present invention, feature and advantage can more be become apparent, below in conjunction with accompanying drawing, specific embodiments of the invention are described in detail.
Fig. 1 shows the schematic flow sheet of a kind of embodiment of the processing method of trap information of the present invention.With reference to figure 1, the processing method of described trap information comprises:
Step S1: alarm event produces;
In concrete application, need the trap information that first will report equipment to design, that is to say, need to be according to user's demand, analyze each alarm and need to bind which information upper giving the correct time, whether the existing MIB node of equipment can satisfy the demand, if existing MIB node can meet the demand of reporting information, does not need to design so special variable; If existing MIB node cannot get the specific information that user needs, so need to arrange again the binding variable of a trap, what this binding variable was corresponding is the needed specific information of user.
Like this, after device trigger alarm, while sending alarm to agent side, not only need alarm index to send to agency, also need the form by additional information by binding variable corresponding to specific information to report.
Step S2: judge whether to exist the trap information of mating with this alarm event;
If do not exist, mate with this alarm event trap information time, do not deal with.
If while there is the trap information of mating with this alarm event, execution step S3: judge whether the additional information in described trap information is empty;
When described additional information is not sky, execution step S4: travel through described trap information and whether comprise special binding variable;
When not comprising special binding variable, do not need additional information to operate; When comprising special binding variable, execution step S5: the value of additional information is set to the codomain that special variable is corresponding.
Then perform step S6: other information in trap information are processed according to predetermined manner;
Other information in Trap information comprise: the common variableses such as index, types of variables.It should be noted that, special binding variable in the present embodiment refers to some variablees relative with common variables, namely by existing MIB node cannot get, but some variablees relevant to the state of equipment, special binding variable can be according to user's demand and different, and different users can arrange different special binding variables.
The processing mode that can adopt trap information of the prior art when other information in trap information are processed, this is well known to those skilled in the art, and does not repeat them here.After execution step S6, the common variables being about in trap information obtains after corresponding variable name and index information according to existing mode, finally performs step S7: after the trap information after processing is encapsulated, report.
In the processing method of the trap information of the present embodiment, by increased the setting of special binding variable in trap information, thereby the specific information of user's request is encapsulated and reported, thereby increased the amount of information that trap information comprises, realized reporting of specific information.
It should be noted that, in the present embodiment, described step S2, describedly judges whether the additional information in described trap information is that empty step comprises: the OID information of obtaining described trap information; Whether the additional information that judges described trap information according to the OID information getting is empty.
The implementation of step S2 and implementation of the prior art are similar, do not repeat them here.
Continuation is with reference to figure 1, and the processing method of described trap information also comprises:
At execution of step S3, when described additional information is sky, execution step S8: travel through other information in described trap information;
Then perform step S9: other information in described trap information are processed according to predetermined manner;
Finally perform step S10: after other information in the trap information after processing are encapsulated, report.
Correspondingly, at execution of step S4, when described trap information does not comprise special binding variable, execution step S8: travel through other information in described trap information;
Then perform step S9: other information in described trap information are processed according to predetermined manner;
Finally perform step S10: after other information in the trap information after processing are encapsulated, report.
When additional information is while not comprising special binding variable in sky or trap information, do not need additional information to process, thereby only its dependent variable in trap information is processed to obtain corresponding variable name and index information etc. according to existing mode, thereby realize the encapsulation of normal trap information and report.
Those skilled in the art should be understood that, when SNMP task is received after the trap information that adopts the present invention's transmission, can test to special binding variable, determine whether this special binding variable can get by MIB node, if MIB node cannot get so and not report, if can get corresponding special variable by MIB node, so report.Particularly, can when obtaining these mib informations, first judge whether the codomain of special binding variable is empty, not check if not empty, directly skip, according to existing mode, test if it is empty.
When SNMP task goes to obtain the value of binding information by obtaining the mode of MIB nodal value, also to take this mode to remove to skip those special variablees, otherwise can be considered to obtain failure, due in processing before, according to the mode of SNMP task encapsulation, the value of special variable is packaged, so this one-phase does not need other processing to special variable.So just can effectively solve the problem that special binding variable cannot report, and be reported to result and other binding variables in Network Management Station, seen as broad as long.
Fig. 2 shows the structural representation of embodiment mono-of the processing unit of trap information of the present invention.With reference to figure 2, the processing unit of described trap information, comprising:
Matching unit 10, is suitable for when alarm event produces, and judges whether to exist the trap information of mating with this alarm event;
Judging unit 20, is suitable for when there is the trap information of coupling, judges whether the additional information in described trap information is empty;
Query unit 30, is suitable for, when described additional information is not sky, travels through described trap information and whether comprising special binding variable;
The first processing unit 40, is suitable for when comprising special binding variable, and the value of additional information is set to the codomain that special variable is corresponding.
In the present embodiment, described judging unit 20 can comprise: acquiring unit and verification unit (not shown).
Described acquiring unit is suitable for obtaining the OID information of described trap information;
Described verification unit is suitable for judging according to the OID information getting whether the additional information of described trap information is empty.
The processing unit of the trap information of the present embodiment arranges accordingly by 40 pairs of special binding variables of described the first processing unit, thereby specific information is increased in trap information, follow-up like this to trap information encapsulate and on give the correct time and just comprised corresponding specific information, thereby can specific information be received and be processed.
In other embodiments, as shown in Figure 3, the processing unit of described trap information can also comprise: the second processing unit 50 and encapsulation unit 60.
Described the second processing unit 50 is suitable for other information in trap information to process according to predetermined manner;
Described encapsulation unit 60 be suitable for and the trap information after processing is encapsulated after report.
One skilled in the art will appreciate that described the second processing unit 50 is also suitable for, when described additional information is sky, traveling through other information in described trap information, other information in described trap information are processed according to predetermined manner; Described encapsulation unit 60 reports after being also suitable for other information in the trap information after processing to encapsulate.
Similarly, described the second processing unit 50 is also suitable for, when described trap information does not comprise special binding variable, traveling through other information in described trap information, and other information in described trap information are processed according to predetermined manner; Described encapsulation unit 60 reports after being also suitable for other information in the trap information after processing to encapsulate.
Although the present invention discloses as above, the present invention is not defined in this.Any those skilled in the art, without departing from the spirit and scope of the present invention, all can make various changes or modifications, so protection scope of the present invention should be as the criterion with claim limited range.