//  Copyright (c) 1997,1998 Network Computing Technologies, Inc.
//  All rights reserved.
// 
//  Redistribution and use of executable software is never 
//  permitted without the express written permission of 
//  Network Computing Technologies, Inc.
// 
//  Distribution of the source is never permitted without 
//  the express written permission of 
//  Network Computing Technologies, Inc.
// 
//  THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
//  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
//  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.



Developer's notes on using trapgen:


Usage:   trapgen -d <destination ip address>

example:  trapgen -d 192.1.2.3

Note:  Either the -d <destination ip address> pair or the -f <input file> pair (which must contain a -d <destination ip address> pair) is mandandatory

The above example will generate a trap that looks like this:

community:	public
sender ip:	current host ip
Sender OID:	1.3.6.1.4.1.2854
Trap Type:      6 (enterprise specific)
Specific Type:	1
Timestamp:	0

with an empty varbind list and send it to ip address 192.1.2.3 on port 162.
These are the defaults (except the destination ip address 192.1.2.3).  Use the following command line switches to override these defaults:

-f filename (must be specified first - see below)
-d destinationIpAddress:port		e.g., -d 123.45.67.89:1025
-c communityName 			e.g., -c private
-o senderOID				e.g., -o 1.3.6.1.4.1.2854
-i senderIP				e.g., -i 199.8.7.6
-g trapType				e.g., -g 5
-s specificType 			e.g., -s 23
-t timestamp				e.g., -t 234445

-p a      - dumps the trap in ascii format to the screen, does not send
-p h      - dumps the trap in hex format to the screen, does not send


In addition, you can specify varbinds to be added with the -v switch:

-v oid TYPE value

where:

oid is the object id of the variable
TYPE is one of the following:
	STRING		
	COUNTER		
	GAUGE		
	INTEGER		
	ADDRESS		
	OID		
	TIMETICK	
and 
value is the value to associate in the varbind

For example:
-v 1.3.6.1.4.1.1824.1.0.0.1 STRING "Very High Temperature"

Note the use of quotes ("") to enclose the text which contains spaces.


Using the -f filename option:

You may store the parameter information in a text file.  The text file should look like a series of command line options, with each option on a separate line.

For example:

-d 123.45.67.89:1025
-c private
-o 1.3.6.1.4.1.1824
-i 199.8.7.6
-g 5
-s 23
-t 12445
-v 1.3.6.1.4.1.1824.1.0.0.1 STRING This is a string (you do not need quotes)
-v 1.3.6.1.4.1.1824.1.0.0.1 COUNTER 3345556
-v 1.3.6.1.4.1.1824.1.0.0.1 GAUGE 12343212
-v 1.3.6.1.4.1.1824.1.0.0.1 INTEGER 99
-v 1.3.6.1.4.1.1824.1.0.0.1 ADDRESS 100.200.123.111
-v 1.3.6.1.4.1.1824.1.0.0.1 OID 1.2.3.4.5.6.7.8.9
-v 1.3.6.1.4.1.1824.1.0.0.1 TIMETICK 2233121

Be sure the last entry has a new line on it or it will be missed!  I addition to the options listed in the file, the command line options will also be processed.  The command line options will override the file specified options (except varbind info which will accumulate).

Please note:

The command line input is not checked very extensively.  Since so many of you have expressed interest in this tool, we will be making changes in the future.  Send an email to trapgen@ncomtech.com if you wish to be notified when new features are available.

Happy Trapping!

Network Computing Technologies, Inc.




