nv-l
[Top] [All Lists]

Re: [nv-l] Passing the trap source to custom scripts

To: nv-l@lists.tivoli.com
Subject: Re: [nv-l] Passing the trap source to custom scripts
From: James Shanks <jshanks@us.ibm.com>
Date: Tue, 31 Dec 2002 09:41:45 -0500
I assume your script is specified in the command for automatic action in 
trapd.conf.  Pass $A to it there, e.g,
        <full_path>/myscript   $A
then reference it as $1 within the script. 
This is the same general procedure for passing all trap variables ($1 - 
$n).  See the man page for trap.conf to get more information on what else 
is available.  If any of them are strings then must be enclosed in quotes 
when passed, e.g
        /<full_path>/myscript   $A  $1 $2 "$3" 

And since your hostname or IP address will contain the dot, it will be 
escaped when passed to your script, e.g
        "shanks.raleigh.ibm.com"  becomes "shanks\.raleigh\.ibm\.com" 
so you will have to manipulate that value within to remove the escape 
characters if they are to be used in a command.  You can do that with sed, 
for example,
        host  = `echo $1 | sed -n "s:\\\\\\::gp"`
 

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




Serkan Dölen <Serkan.Dolen@isbank.com.tr>
12/31/2002 09:22 AM

 
        To:     nv-l@lists.tivoli.com
        cc: 
        Subject:        [nv-l] Passing the trap source to custom scripts



Hi
How can I pass the trap source ( the node) to custom scripts?

My specific trap has one long text variable and it does not include source
node.

Thanks.

Serkan Dolen
T. Isbank


---------------------------------------------------------------------
To unsubscribe, e-mail: nv-l-unsubscribe@lists.tivoli.com
For additional commands, e-mail: nv-l-help@lists.tivoli.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>

Archive operated by Skills 1st Ltd

See also: The NetView Web