nv-l
[Top] [All Lists]

Re: [nv-l] How to pass Octet String trap parameter to script ?

To: James Shanks <jshanks@us.ibm.com>
Subject: Re: [nv-l] How to pass Octet String trap parameter to script ?
From: "Philippe Menard" <PME@fr.ibm.com>
Date: Wed, 17 Sep 2003 12:05:40 +0200
Cc: nv-l@lists.tivoli.com
Delivered-to: mailing list nv-l@lists.tivoli.com
Delivery-date: Wed, 17 Sep 2003 11:06:09 +0100
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
List-help: <mailto:nv-l-help@lists.tivoli.com>
List-post: <mailto:nv-l@lists.tivoli.com>
List-subscribe: <mailto:nv-l-subscribe@lists.tivoli.com>
List-unsubscribe: <mailto:nv-l-unsubscribe@lists.tivoli.com>
Mailing-list: contact nv-l-help@lists.tivoli.com; run by ezmlm

James,

> But I am curious.  Are you saying that the varbind "$3" is empty when it gets to ovactiond?  
> Or does it still contain one or more hex characters?    
> Or is that exactly the problem, that you cannot tell which is the case?

My understanding is that ovactiond does get the original bytes.
Then it converts "very offending" characters to underscores, escapes "less offending" ones
with a \ character (fix of CERT security issue) and passes the result string to the script.
In this specific case, my script gets a string containing only underscore characters !!

I still have hopes there is a solution because another script does get the "0x12 34 ..." string.
The difference seems to be that this trap definition was NOT loaded in Mib Browser ...
More on this later.

Best regards,
Phil.

- - -

Philippe MÉNARD
Networking Delivery Support Center
Mail : pme@fr.ibm.com
Phone : +33 (0)4 92 11 48 69
Fax : +33 (0)4 93 24 49 07




James Shanks/Raleigh/IBM@IBMUS

16/09/2003 20:03

       
        To:        nv-l@lists.tivoli.com
        cc:        
        Subject:        Re: [nv-l] How to pass Octet String trap parameter to script ?

       



Sorry, but no.

There is no facility to pass on "cooked" data.   And you are correct those other formatting techniques have nothing to do with this issue either, nor does the AdditionalLegalTrapCharacters.   But I am curious.  Are you saying that the varbind "$3" is empty when it gets to ovactiond?  Or does it still contain one or more hex characters?    Or is that exactly the problem, that you cannot tell which is the case?


Off hand, I cannot think of a way out of your predicament.  If what you want to do is simply print the message for analysis later, then you could use the
roundabout method of capturing the formatted string as an Additional Action in nvevents.   As the man page for trapd.conf shows, you can capture the formatted message of an event in the display as $MSG and use a script to print that.  But I don't see how to  pass it on to ovactiond for anything automatic.


James Shanks
Level 3 Support  for Tivoli NetView for UNIX and Windows
Tivoli Software / IBM Software Group


"Philippe Menard" <PME@fr.ibm.com>

09/16/2003 12:30 PM

       
       To:        nv-l@lists.tivoli.com

       cc:        

       Subject:        Re: [nv-l] How to pass Octet String trap parameter to script ?





All,


I do pass all the variables within quotes as in  : <myscript> "$1" "$2" "$3" "$4" "$5"
.

> What you are passing to your script is raw data from trapd.
That is exactly the subject of this question : is there a way to instruct trapd and ovactiond

to pass "cooked" data to a script ?


The NV documentation explains when to use $1, $-1, $+1, etc but I could find nothing
about converting a string of bytes (e.g. 0x08 07 02 04 01 01 02 01 : from an actual device)
into something that a script can work with, i.e. which can be unescaped. I guess that

even AdditionalLegalTrapCharacters could not help here.


Regards,

Phil.


- - -

Philippe MÉNARD
Networking Delivery Support Center
Mail : pme@fr.ibm.com
Phone : +33 (0)4 92 11 48 69
Fax : +33 (0)4 93 24 49 07



James Shanks/Raleigh/IBM@IBMUS

16/09/2003 17:56

       
      To:        nv-l@lists.tivoli.com

      cc:        

      Subject:        Re: [nv-l] How to pass Octet String trap parameter to script ?


     





What's in the display window of nvevents is a construction. nvevents has already set aside a buffer and interpreted it.  What you are passing to your script is raw data from trapd.

If it contains blanks, then you must enclose it in quotes, just as you would any other script input on the command line.    You have to pass

     <myscript>  "$3"  

not just
     <myscript> $3
or the shell will pass only the first word of $3.

In general it doesn't hurt to enclose all of your variables

     <myscript> "$1" "$2" "$3" "$4" "$5"

when you don't know what form the incoming data will take.

James Shanks
Level 3 Support  for Tivoli NetView for UNIX and Windows
Tivoli Software / IBM Software Group
"Philippe Menard" <PME@fr.ibm.com>

09/16/2003 11:42 AM

       
     To:        nv-l@lists.tivoli.com

     cc:        

     Subject:        [nv-l] How to pass Octet String trap parameter to script ?







All,


AIX 4.3.3 ML10 + NV 7.1.3 + popular patches.


I need to provide a script with the parameters found in a trap.

$1, $2, etc work fine for integers and strings but doesn't for Octet Strings.


It seems that the bytes are passed (and escaped for most of them) by ovactiond.

Is there is way to get the bytes string as displayed in the events window ?

( i.e. a string like "0x01 12 34 ab ..." )

Best regards,

Philippe.


- - -

Philippe MÉNARD
Networking Delivery Support Center
Mail : pme@fr.ibm.com
Phone : +33 (0)4 92 11 48 69
Fax : +33 (0)4 93 24 49 07






<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web