nv-l
[Top] [All Lists]

RE: [nv-l] Ruleset that sends new trap with custom info.

To: nv-l@lists.us.ibm.com
Subject: RE: [nv-l] Ruleset that sends new trap with custom info.
From: James Shanks <jshanks@us.ibm.com>
Date: Wed, 28 Dec 2005 16:50:42 -0500
Delivery-date: Wed, 28 Dec 2005 21:51:11 +0000
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
In-reply-to: <3CA59067BA00434AB3DEF953DEA053430257CE6F@REISDAL01SXCH03.fareis.famisg.net>
Reply-to: nv-l@lists.us.ibm.com
Sender: owner-nv-l@lists.us.ibm.com
The security mavens here at IBM decided that some trap characters should
always be escaped lest  some unscrupulous person embed a system command in
a trap variable and it  cause your system harm should one of our trap
processing daemons unwitting echo that  variable.  Since the daemons
execute with root authority the result could be bad.

In any case, the dot is one of those, whether you put it in
AdditionalLegalTrapCharacters or not.  So you have to get rid of it in your
script.
That's what the business about using sed  was for in whatever post you read
it in.  This one is for fixing a variable passed in as the second argument:

NODE=`echo "$2" | sed "s:\\\\\\::g"`

The sed is a template for removing  3 backslashes from a hostname, one
which would look like this:   "jshanks1\.raleigh\.ibm\.com" when printed.
 See how it works?  The sed needs a pair of backslashes for every one that
occurs in the hostname.  If the name were just  "xyz\.ibm\.com" with only
two, then your sed would be  sed "s:\\\\::g".  Get it?

And of course in your case, you would probably have to do something like
this
 NODE=`echo "$NVATTR_2" | sed "s:\\\\\\::g"`
depending on what varbind the hostname is in.

HTH

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


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

Archive operated by Skills 1st Ltd

See also: The NetView Web