nv-l

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

2002-03-12 10:30:35
Subject: RE: [nv-l] Formatting trap variables like "$+1"
From: "Treptow, Craig" <Treptow.Craig AT principal DOT com>
To: nv-l AT lists.tivoli DOT com
Date: Tue, 12 Mar 2002 09:30:35 -0600
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 AT us.ibm DOT com]
Sent: Tuesday, March 12, 2002 9:25 AM
To: Treptow, Craig
Cc: nv-l AT lists.tivoli DOT 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 AT principal DOT com>
03/12/2002 10:06 AM

 
        To:     "NetView List (E-mail)" <nv-l AT lists.tivoli DOT 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 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)