nv-l

Re: [nv-l] email of trap message contains \"\\\"

2003-02-10 11:17:07
Subject: Re: [nv-l] email of trap message contains \"\\\"
From: netview AT toddh DOT net (Todd H.)
To: bart<bart AT isiskorea DOT com>
Date: 10 Feb 2003 10:06:17 -0600
bart<bart AT isiskorea DOT com> writes:

> Hi,world~
> 
> I remenber I saw something like this somewhere in this site,but I can't find 
> the solution.
> 
> When I set the event configuration to send the email,
> I send messages something like this
> 
> echo "$hostname" "$MSG "| mailx -r <mail_server> -s "$HOST $MSG"  nmsadmin AT 
> isiskorea DOT com ;;
> 
> the action works well...
> 
> But,when the hostname or messages  contains ip_adress,
> it displays "" infront of the "dot" like this xxx\\.xxx\\.xxx\\.xxx\\.
> 
> How can i eliminate the "" ?

As part of a security fix from a root exploit vulnerability, by
default, when send trap vabinds to external scripts, Netview escapes
- and . with a backslash and replaces all other non-alphanumerics with
  an _.   

See the release notes for your version of NetView for more details and
for sed commands that strips the backslashes out in the external
script. 

Example from a script of mine:


############################################################################
# replace \- \. and \_  with - . and  _  respectvely. Required for
# security efix
############################################################################
TEMP_HOST=$(/usr/bin/echo "$5" | /usr/bin/sed 's:\\\([-\._]\):\1:g')
MESSAGESTRING=$(/usr/bin/echo "$1" | /usr/bin/sed 's:\\\([-\._]\):\1:g')


-- 
Todd H.
http://www.toddh.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: nv-l-unsubscribe AT lists.tivoli DOT com
For additional commands, e-mail: nv-l-help AT lists.tivoli DOT com

*NOTE*
This is not an Offical Tivoli Support forum. If you need immediate
assistance from Tivoli please call the IBM Tivoli Software Group
help line at 1-800-TIVOLI8(848-6548)


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