nv-l
[Top] [All Lists]

RE: [nv-l] Formatting trap variables like "$+1"

To: <nv-l@lists.tivoli.com>
Subject: RE: [nv-l] Formatting trap variables like "$+1"
From: "Binder, Karin" <karin.binder@nwa.com>
Date: Tue, 12 Mar 2002 10:35:12 -0600
If I understood James earlier reply, using $+1 to format the event message does 
not change what data is passed to nvcorrd. Thus, the additional varbind data is 
still not immediately accessible in a script called by an action node in a 
ruleset.  However, that format does make the type and value parts of the 
varbind accessible as variables in a script called by an additional action.  
So, one can configure an event with an additional action that calls a script 
using the $+1 format, and parse the desired data.  At this point, one could 
issue a new trap via the snmptrap command that contains whatever data you want 
out of any part of the varbind, and send this second trap through ruleset 
processing.  Or, if the remaining processing of the trap is simple, skip 
ruleset processing altogether and do the work in the script that has already 
been called.

Since my earlier post, I've come across more and more of these from multiple 
vendors.  If I misunderstood and there is a simpler way, I hope someone will 
clarify.  I'd rather not have to process two traps for every one of these 
received.  



-----Original Message-----
From: Treptow, Craig [mailto:Treptow.Craig@principal.com]
Sent: Tuesday, March 12, 2002 9:31 AM
To: nv-l@lists.tivoli.com
Cc: 'James Shanks'
Subject: RE: [nv-l] Formatting trap variables like "$+1"


Hmmm...

I'm doing this right now in the script:

echo "NVA=[$NVA]" > $LOGFILE
echo "NVATTR_1=[$NVATTR_1]" >> $LOGFILE
echo "NVATTR_2=[$NVATTR_2]" >> $LOGFILE
echo "NVATTR_3=[$NVATTR_3]" >> $LOGFILE
echo "NVATTR_4=[$NVATTR_4]" >> $LOGFILE

The NVATTR_1, just gets me '6', not 'cHsrpGrpEntry.cHsrpGrpStandbyState.8.0 6'.

So, I think I'm still missing something, or doing something wrong.

Thanks for your help!!

Craig

-----Original Message-----
From: James Shanks [mailto:jshanks@us.ibm.com]
Sent: Tuesday, March 12, 2002 9:25 AM
To: Treptow, Craig
Cc: nv-l@lists.tivoli.com
Subject: Re: [nv-l] Formatting trap variables like "$+1"


Craig -
Are you passing the NVATTR variables to your script, or just referencing 
them?
To pass them you must enclose them in quotation marks, because otherwise 
the shell will stop as the first space when it instantiates the variable.
For example, to pass your variables you'd need to say
   <full_path>myscript  "NVATTR_1"  "NVATTR_2"  "NVATTR_3" 
and so on.
But because these are exported  you can just use them in your script. 
If you are going to echo them to file, then you could just say
        echo "var1 = " NVATTR_1  >>  myfile
right in the script.

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





"Treptow, Craig" <Treptow.Craig@principal.com>
03/12/2002 10:06 AM

 
        To:     "NetView List (E-mail)" <nv-l@lists.tivoli.com>
        cc: 
        Subject:        [nv-l] Formatting trap variables like "$+1"

 

I am having trouble implementing James Shanks' solution to Karin Binder's 
problem back in February and am hoping somebody can help me.

This is the question I'm referring to:

http://www.vk.net/tivoli/Netview-List.nsf/4a25624e007bfc5c85255a850068ca27/5bf179679b67e533ca256b6600544312!OpenDocument
 

Basically, James suggested using the "$+1" formatting of a trap variable.

It seems straightforward, but I think I am missing something.

I have a similar situation with Cisco HSRP state change traps.
I can format the variable in the trap by doing the "$+1", and in the 
events display I do get:
"cHsrpGrpEntry.cHsrpGrpStandbyState.8.0 6", but when I look at the 
"NVATTR_*" variables passed to my script in an action node all I have is:
NVA=[offline-dist-1-l3.net.principal.com]
NVATTR_1=[6]
NVATTR_2=[3]
NVATTR_3=[A]
NVATTR_4=[4]

What am I missing to make this work?  I'm trying to use the "8.0" to 
eventually do some SNMP gets and figure out which interface had the HSRP 
state change.

Thanks for any help.

Craig

---------------------------------------------------------------------
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)




---------------------------------------------------------------------
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