Skip navigation.
Downloads | Product Documentation | Support

WebLogic Server Command Reference

## snmptrapd

Starts a daemon that receives traps and prints information about the trap.

### Syntax

>     java snmptrapd [-d] [-c snmpCommunity] [-p TrapDestinationPort]

Argument | Definition
--- | ---
`-c` `snmpCommunity` | Specifies that community name that the SNMP agent (or `snmpv1trap` command) used to generate the trap. If you do not specify a value, the command assumes `-c public`.
`-p` `TrapDestinationPort` | Specifies the port number on which the trap daemon receives traps. If you do not specify a value, the command assumes `-p 162`.

### Example

The following command starts a trap daemon and instructs it to listen for requests on port 165. The daemon runs in the shell until you kill the process or exit the shell:

`java snmptrapd -p 165`

If the command succeeds, the trap daemon returns a blank line with a cursor. The trap daemon waits in this state until it receives a trap, at which point it prints the trap.

## Example: Sending Traps to the Trap Daemon

To generate WebLogic Server traps and receive them through the trap daemon:

1. Open a command prompt (shell) and invoke the following script:

`WL_HOME\server\bin\setWLSEnv.sh` (or `setWLSEnv.cmd` on Windows)
where `WL_HOME` is the directory in which you installed WebLogic Server.

2. To start the trap daemon, enter the following command:

`java snmptrapd`

3. Open another shell and invoke the following script:

`WL_HOME\server\bin\setWLSEnv.sh` (or `setWLSEnv.cmd` on Windows)

4. To generate a trap, enter the following command:

`java snmpv1trap localhost .1.3.6.1.4.140.625 localhost 6 60 1000`

The `snmpv1trap` command generates a `serverStart` Trap and broadcasts it through port 162.

In the shell in which the trap daemon is running, the daemon prints the following:

`Trap received from: /127.0.0.1, community: public
Enterprise: .1.3.6.1.4.140.625
Agent: /127.0.0.1
TRAP_TYPE: 6
SPECIFIC NUMBER: 60
Time: 1000
VARBINDS:`