Todd, those variables would not be blank, they would be the additional 3
variables that James has been mentioning. Without knowing the total - which now
appears possible, you can't tell what the data is in the trap. Like I said if
the data is moving from field to field depending on the trap forrmat, I don't
see how in code you could differentiate the type of data in the field. I
considered your approach (in fact it was the only possible approach) but I
could not get around not know what kind of data was in the variable - was it an
ifType or ifIndex etc. When I know the total number of variables, I can pick
the variables out based on which format they are. I know that if there are 5
variables then the second one is ifType and the third one is ifReason etc.
Thanks everyone - valuable input, I will be able to solve this.
> -----Original Message-----
> From: Todd H. [mailto:netview@toddh.net]
> Sent: Thursday, October 03, 2002 4:46 PM
> To: Barr, Scott
> Cc: nv-l@lists.tivoli.com
> Subject: Re: [nv-l] Cursed Cisco Trap Formats
>
>
> "Barr, Scott" <Scott_Barr@csgsystems.com> writes:
>
> > Very true - but I have no idea what the contents mean. if NVATTR_2
> > is "2" for ifType that is not the same if it is "2" for
> > ifLocalReason. Yes, blanks are detectable, but deciding which format
> > the trap is still won't be easy unless I can tell whether its a 3,
> > 4, or 5 type trap.
>
> You know the formats for each case, and what sort of event you want to
> send or display you want to do, right?
>
> Unless I've missed something, telling whether isn't testing for a 3 4
> or 5 trap is a simple matter of testing
>
> if NVATTR_1 2 and 3 are non blank.
> if 4&5 are blank or undefined,
> do type 3 stuff using the defs you know for that one
> fi
> if (4nonblank and 5 blank/undefined)
> do type 4 stuff based on defs you know for that one
> fi
> if (4nonblank and 5 nonblank)
> do type 5 stuff
> fi
> fi
>
> The syntax of that depends on your choice of scripting language.
> So long as you can define any sort of footprint to distinguish the
> type of traps based on the varbinds available to you in the
> environment variables, you're all set.
>
> --
> Todd H.
> http://www.toddh.net/
>
|