Configures the translation of events to traps, trap destinations, or both based on information in a configuration file.
evntcmd [/s ComputerName] [/v VerbosityLevel] [/n] FileName
/s ComputerName : Specifies, by name, the computer on which you want to configure the translation of events to traps, trap destinations, or both. If you do not specify a computer, the configuration occurs on the local computer.
/v VerbosityLevel : Specifies which types of status messages appear as traps and trap destinations are configured. This parameter must be an integer between 0 and 10. If you specify 10, all types of messages appear, including tracing messages and warnings about whether trap configuration was successful. If you specify 0, no messages appear.
/n : Specifies that the SNMP service should not be restarted if this computer receives trap configuration changes.
FileName : Specifies, by name, the configuration file that contains information about the translation of events to traps and trap destinations you want to configure.
/? : Displays help at the command prompt.
| • | If you want to configure traps but not trap destinations, you can create a valid configuration file by using Event to Trap Translator, which is a graphical utility. If you have the SNMP service installed, you can start Event to Trap Translator by typing evntwin at a command prompt. After you have defined the traps you want, click Export to create a file suitable for use with evntcmd. You can use Event to Trap Translator to easily create a configuration file and then use the configuration file with evntcmd at the command prompt to quickly configure traps on multiple computers. | ||||||||||
| • | The syntax for configuring a trap is as follows: #pragma ADD EventLogFile EventSource EventID [Count [Period]]
| ||||||||||
| • | The syntax for removing a trap is as follows: #pragma DELETE EventLogFile EventSource EventID
| ||||||||||
| • | The syntax for configuring a trap destination is as follows: #pragma ADD_TRAP_DEST CommunityName HostID
| ||||||||||
| • | The syntax for removing a trap destination is as follows: #pragma DELETE_TRAP_DEST CommunityName HostID
|
The following examples illustrate entries in the configuration file for the evntcmd command. They are not designed to be typed at a command prompt.
To send a trap message if the Event Log service is restarted, type:
#pragma ADD System "Eventlog" 2147489653
To send a trap message if the Event Log service is restarted twice in three minutes, type:
#pragma ADD System "Eventlog" 2147489653 2 180
To stop sending a trap message whenever the Event Log service is restarted, type:
#pragma DELETE System "Eventlog" 2147489653
To send trap messages within the community named Public to the host with the IP address 192.168.100.100, type:
#pragma ADD_TRAP_DEST public 192.168.100.100
To send trap messages within the community named Private to the host named Host1, type:
#pragma ADD_TRAP_DEST private Host1
To stop sending trap messages within the community named Private to the same computer on which you are configuring trap destinations, type:
#pragma DELETE_TRAP_DEST private localhost
| Format | Meaning |
Italic | Information that the user must supply |
Bold | Elements that the user must type exactly as shown |
Ellipsis (...) | Parameter that can be repeated several times in a command line |
Between brackets ([]) | Optional items |
Between braces ({}); choices separated by pipe (|). Example: {even|odd} | Set of choices from which the user must choose only one |
Courier font | Code or program output |