nv-l

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

2006-11-13 15:29:52
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:28:27 -0500

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)
<Prev in Thread] Current Thread [Next in Thread>