nv-l

Re: [nv-l] Cursed Cisco Trap Formats

2002-10-03 17:46:07
Subject: Re: [nv-l] Cursed Cisco Trap Formats
From: netview AT toddh DOT net (Todd H.)
To: "Barr, Scott" <Scott_Barr AT csgsystems DOT com>
Date: 03 Oct 2002 16:46:07 -0500
"Barr, Scott" <Scott_Barr AT csgsystems DOT 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/