nv-l

Re: [NV-L] Trap -> external program ???

2006-11-13 16:01:34
Subject: Re: [NV-L] Trap -> external program ???
From: James Shanks <jshanks AT us.ibm DOT com>
To: Tivoli NetView Discussions <nv-l AT lists.ca.ibm DOT com>
Date: Mon, 13 Nov 2006 15:43:26 -0500

Rats. Another typo.

The deal is that you pass the trap variables as $1 - $50 and the enterprise as $E, the specific type as $S and the agent as $A

So when you invoke the script as the hidden command it should be with "$" in front of these variables
\usr\ov\bin\echovar.hidden.bat $S $A "$1" "$2" "$3" "$4" "$5" (no % sign here)

and when you reference them in the bat file they are positional as %1, %2, and so on




James Shanks
Level 3 Support for Tivoli NetView for UNIX and Windows
Network Availability Management
Network Management - Development
Tivoli Software, IBM Corp
Inactive hide details for James Shanks/Raleigh/IBM@IBMUSJames Shanks/Raleigh/IBM@IBMUS


          James Shanks/Raleigh/IBM@IBMUS
          Sent by: nv-l-bounces AT lists.ca.ibm DOT com

          11/13/2006 03:28 PM
          Please respond to
          Tivoli NetView Discussions <nv-l AT lists.ca.ibm DOT com>


To

Tivoli NetView Discussions <nv-l AT lists.ca.ibm DOT com>

cc


Subject

Re: [NV-L] Trap -> external program ???

It doesn't have to be even that complicated. Try this one. Create a bat file called echovar.hidden.bat and put in \usr\ov\bin with these contents

::
:: The purpose of this script is to echo variables to a file
:: to test the hidden appl
:: You must pass variables to the script as $S, $1, $2 etc
:: and variables which might contain spaces must be encapsulated in
:: quotation marks. Invoke it like this as a hidden command:
:: \usr\ov\bin\echovar.hidden.bat %S %A "$1" "$2" "$3" "$4" "$5"
::
date /t >> \usr\ov\log\echo-hidden.txt
time /t >> \usr\ov\log\echo-hidden.txt
echo "specific = " %1 >> \usr\ov\log\echo-hidden.txt
echo "agent = " %2 >> \usr\ov\log\echo-hidden.txt
echo "var1 = " %3 >> \usr\ov\log\echo-hidden.txt
echo "var2 = " %4 >> \usr\ovV\log\echo-hidden.txt
echo "var3 = " %5 >> \usr\ovV\log\echo-hidden.txt
echo "var4 = " %6 >> \usr\ov\log\echo-hidden.txt
echo "var5 = " %7 >> \usr\ov\log\echo-hidden.txt

:: repeat as needed

Now in Trap Settings for every trap you want logged, edit the Properties and add this as the command to be run every time the trap is received.
\usr\ovV\bin\echovar.hidden.bat %S %A "$1" "$2" "$3" "$4" "$5"

and mark it as a hidden (background) command.

If you need to add the NetView Drive letter because it is not C:. then do so. If your trap has more variables, then expand the batch file and what you pass it.

Not sophisticated enough for you? Well, this should be enough to get you started. Of course, if you want to call your bat file something else, feel free.



James Shanks
Level 3 Support for Tivoli NetView for UNIX and Windows
Network Availability Management
Network Management - Development
Tivoli Software, IBM Corp
_______________________________________________
NV-L mailing list
NV-L AT lists.ca.ibm DOT com
Unsubscribe:NV-L-leave AT lists.ca.ibm DOT com
http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to internal IBM'ers only)

GIF image

GIF image

GIF image

_______________________________________________
NV-L mailing list
NV-L AT lists.ca.ibm DOT com
Unsubscribe:NV-L-leave AT lists.ca.ibm DOT com
http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to 
internal IBM'ers only)
<Prev in Thread] Current Thread [Next in Thread>