nv-l
[Top] [All Lists]

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

To: Tivoli NetView Discussions <nv-l@lists.ca.ibm.com>
Subject: Re: [NV-L] Trap -> external program ???
From: James Shanks <jshanks@us.ibm.com>
Date: Mon, 13 Nov 2006 15:28:27 -0500
Delivery-date: Mon, 13 Nov 2006 20:29:52 +0000
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
In-reply-to: <20061113194520.GD26392@localhost.localdomain>
List-help: <mailto:nv-l-request@lists.ca.ibm.com?subject=help>
List-id: Tivoli NetView Discussions <nv-l.lists.ca.ibm.com>
List-post: <mailto:nv-l@lists.ca.ibm.com>
List-subscribe: <http://lists.ca.ibm.com/mailman/listinfo/nv-l>, <mailto:nv-l-request@lists.ca.ibm.com?subject=subscribe>
List-unsubscribe: <http://lists.ca.ibm.com/mailman/listinfo/nv-l>, <mailto:nv-l-request@lists.ca.ibm.com?subject=unsubscribe>
Reply-to: Tivoli NetView Discussions <nv-l@lists.ca.ibm.com>
Sender: nv-l-bounces@lists.ca.ibm.com

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@lists.ca.ibm.com
Unsubscribe:NV-L-leave@lists.ca.ibm.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>

Archive operated by Skills 1st Ltd

See also: The NetView Web