Trap Sender Examples - Compaq TCP/IP Services for OpenVMS Programming And Reference Manual

Tcp/ip services for openvms
Table of Contents

Advertisement

Table 4–5 (Cont.) Flags for the snmp_trapsnd Command
Flag
-h host
-p port
-tcp
-v version

4.2.1.3 Trap Sender Examples

In the following
The first line is the
The remainder is the display received when running the trap receiver
program (
1. The following example generates a trap that originated on the
(specified by the
Version 1). The
the local host.
$ snmp_trapsnd 0.0 local 0 0 0
Message received from 127.0.0.1
SNMPv1-Trap-PDU:
community - 7075626C 6963
enterprise - 0.0
agent address - 0.0.0.0
trap type - Cold Start (0)
timeticks - 51938978
2. The following example generates the same trap as in example 1, except that
it specifies the use of SNMP Version 2.
$ snmp_trapsnd 0.0 local 0 0 0 "-v2c"
Message received from 127.0.0.1
SNMPv2-Trap-PDU:
community - 7075626C 6963
sysUpTime.0 - 51938968 = 6 d 0:16:29
snmpTrapOID.0 - 0.0
3. The following example sends values to the node
name
$ snmp_trapsnd 1.2.3 marley.dec.com 6 33 100 -c special -h mynode
Message received from 16.20.208.68
SNMPv1-Trap-PDU:
community - 73706563 69616c
4.2 Using the Trap Sender and Trap Receiver Programs
Description
Specifies the host name or IP address (in ASN.1 dot notation format) of the
destination host to receive the trap message. The default is
(127.0.0.1).
Specifies a port number on the destination host where the message is to be sent.
The default is UDP 162.
Specifies that the TCP transport be used instead of the default UDP transport.
If a connection cannot be established, the program displays the warning
connect - : connection refused
Specifies the SNMP version to use for sending the PDU. The valid versions are
or
1
(default). You can specify the flag and value without including a space (for
example,
-v2c
and
-v1
).
snmp_trapsnd
command examples:
snmp_trapsnd
snmp_traprcv
) without flags included.
parameter) using the default SNMP version (SNMP
agent
-h host
parameter is not specified, so the trap will be sent to
special
.
Using the SNMP Utilities
.
command.
public
public
with the community
mynode
special
Using the SNMP Utilities 4–11
localhost
2c
localhost

Advertisement

Table of Contents
loading

Table of Contents