Well, I'd start with the NetView documentation. This is not a trivial exercise.
According to the nv-l archives you are using NetView for Windows. In the User's Guide, read over Chapter 6, Working with events and event filters, especially the sections on Configuring events, Avoiding security problems with non-alphanumeric characters in traps and Actions on events. That will cover the basics of what you have to do.
Then you can configure this trap to launch a hidden command. I'd start with a simple test case. Put this in a file called "echovar.hidden.bat" in \usr\ov\bin:
:: The purpose of this script is to echo variables to a file
:: to test a hidden application
:: You must pass variables to the script as $E, $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 $E $A "$1" "$2" "$3" "$4" "$5"
date /t >> \usr\ov\log\echo-hidden.txt
time /t >> \usr\ov\log\echo-hidden.txt
echo "enterprise = " %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\ov\log\echo-hidden.txt
echo "var3 = " %5 >> \usr\ov\log\echo-hidden.txt
echo "var4 = " %6 >> \usr\ov\log\echo-hidden.txt
echo "var5 = " %7 >> \usr\ov\log\echo-hidden.txt
And then run trap.exe, select your trap, click on Properties, and at the bottom of the Trap Properties panel, put
[drive_letter]: \usr\ov\bin\echovar.hidden.bat $E $A "$1" "$2" "$3" "$4" "$5"
in the box labeled "Run this command when the trap is received". "Run as" should say "Hidden Application" (which means it does not require a console for display).
Once you have this working you can set about modifying it. Change the variables passed in to get just what you want. Then add mode code map them into an nvsnmptrap command to send a trap. You can look that up in the Netview for Windows Programmer's Reference. But here's a sample which sends a replica NetView Node Down trap
:: sample bat file script to send a replica Node down trap (Version 7 style)
:: 1. We are not sending the port (it defaults to 162 udp)
:: 2. we could skip sending community name but here we are using a bogus one
:: just to show that trapd doesn't care what one you use but
:: you can configure the Log message to show $C and see what it is.
:: 3. Below the first hostname is the trapd destination -- your box or some other
:: 4. The second hostname is the agent sending the trap -- it cannot be a bogus
:: hostname, but you can use a bogus IP address to make it easy to spot.
:: 5. The contents of the 4th variable in real life are :
:: -- timestamp -- object id of host --
:: Here they are just made up.
nvsnmptrap -c public ^
jshanks1.raleigh.ibm.com .22.214.171.124.126.96.36.199.3.1 ^
jshanks2.raleigh.ibm.com 6 58916865 1 ^
.188.8.131.52.184.108.40.206.220.127.116.11.0 Integer 2 ^
.18.104.22.168.22.214.171.124.126.96.36.199.0 OctetStringascii "jshanks2.raleigh.ibm.com" ^
.188.8.131.52.184.108.40.206.220.127.116.11.0 OctetStringascii "Node Down" ^
.18.104.22.168.22.214.171.124.126.96.36.199.0 OctetStringascii "890775021 256" ^
.188.8.131.52.184.108.40.206.220.127.116.11.0 OctetStringascii "openview" ^
.18.104.22.168.22.214.171.124.126.96.36.199.0 OctetStringascii "jshanks2.raleigh.ibm.com" ^
.188.8.131.52.184.108.40.206.220.127.116.11.0 OctetStringascii "18.104.22.168" ^
.22.214.171.124.126.96.36.199.188.8.131.52.0 OctetStringascii "[184.108.40.206]"
I hope by now you see where to go with this. You are going to have to write code to parse the variables passed in and map them to the output trap you want to send. If you program in PERL or REXX rather than Windows batch file, it will be that much easier. And you can use any enterprise OID you like, including the original one, or you can use NetView's .220.127.116.11.18.104.22.168.3.1 Specific id's from 1000 to 1100 are reserved for that purpose.
Once you have this working, I'd set the original trap to "Log Only" using trap.exe and then the event browser will only display your new one by default.
Tivoli Network Availability Management Level Three
Network Availability Management
Tivoli Software, IBM Corp
1-919-224-1642 | T/L 687-1642 | ITN 26871642
NV-L mailing list
http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to
internal IBM'ers only)