nv-l

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

2002-12-31 09:41:45
Subject: Re: [nv-l] Passing the trap source to custom scripts
From: James Shanks <jshanks AT us.ibm DOT com>
To: nv-l AT lists.tivoli DOT 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 AT isbank.com DOT tr>
12/31/2002 09:22 AM

 
        To:     nv-l AT lists.tivoli DOT 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 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>