nv-l

[nv-l] Script option for use with APAR IY21527

2002-04-04 18:08:58
Subject: [nv-l] Script option for use with APAR IY21527
From: "Binder, Karin" <karin.binder AT nwa DOT com>
To: <nv-l AT lists.tivoli DOT com>
Date: Thu, 4 Apr 2002 17:08:58 -0600
Hello All,

I appreciate all the information that is shared on this list.  I found 
something that was useful to me, and thought it might be helpful to some of you.

I recently enabled the security mechanism provided in APAR IY21527 (also in 
V6.03) to filter illegal special characters from traps. The sample script 
provided in the APAR readme suggested the use of 'sed "s:\\\\\\::g"' to remove 
the prepended backslash characters.  That didn't work in our environment as we 
do not have a consistent depth of domains in our DNS names.  And then there are 
those traps that contain a "." in message text (i.e. "Node down.").  Further, 
with vendors doing creative things like appending port number to ASN strings, 
predicting the number of "."s in a variable became even more challenging.  I 
found an alternative using the shell "eval" command to force an evaluation of a 
variable, thus removing the escape characters irrespective of how many there 
are in the variable.  I used it at the top of my script on each variable that 
might contain a backslash (NVA, NVATTR_n, etc).  It worked in my /bin/sh 
scripts;  I suspect it would work in other scripts types as well (csh, ksh), 
although I have not tested those.  As always, test it first and use at your own 
risk.  Sample syntax in /bin/sh:

NVATTR_1=`eval echo $NVATTR_1`
NVATTR_2=`eval echo $NVATTR_2`
etc.

Karin Binder

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