Send-Trap Cmdlet

Parameters   Output Objects   Configuration Settings  

The Send-Trap component is used to sends SNMP traps to a remote address.

Syntax

Send-Trap [parameters]

Remarks

Depending upon the value of the Version parameter, the packet is constructed as an SNMPv1, SNMPv2 or SNMPv3 Trap PDU. The following parameters provide more control over how traps are generated: Port, Agent, Community, Enterprise.

For SNMPv3 traps, the User, AuthenticationPassword, and EncryptionPassword parameters can be set. If any values are provided in the ObjectID, ObjectType, ObjectValue arrays, they are sent unchanged. In the case of an SNMPv2 or SNMPv3 Trap, if the Obj properties are not specified, the following values are set: sysUpTime.0 equal to Uptime and snmpTrapOID.0 equal to OID.

For SNMPv2 and SNMPv3 Traps, OID must contain the full OID of the Trap. Automatic translation is handled internally from node labels to node OIDs assuming that a valid MIB file is provided. For SNMPv1, OID must be of the form "GenericTrap.SpecificTrap". These values are sent in the PDU header. Agent and Enterprise are taken from their corresponding parameters.

The cmdlets support pipeline input for some of their parameters. Prebuilding an object and piping it to the cmdlet is very useful, but should be used with caution to prevent security conflicts. Steps have been taken to decrease the risk of a possibly accidental pipe to the cmdlet, for instance, the Credential parameter cannot be piped to the cmdlet and must be specified manually.


#send a coldStart trap
send-trap -manager 10.0.1.255 -oid coldStart.0

#send a custom coldStart trap
send-trap -manager 10.0.1.255 -oid coldStart.0 -objectID 1.1 -objectType Integer -objectValue 20

#send a custom coldStart trap with multiple objects
send-trap -manager 10.0.1.255 -oid coldStart.0 -objectID 1.1,1.2,1.3 -objectType Integer,Integer,Integer -objectValue 20,31,53

Below are some examples using SNMPv1:


#send a coldStart trap using SNMPv1
send-trap -version 1 -manager 10.0.1.255 -oid 0.0

#send a custom coldStart trap using SNMPv1
send-trap -version 1 -manager 10.0.1.255 -oid 0.0 -objectID 1.1 -objectType Integer -objectValue 20

#send a custom coldStart trap with multiple objects and custom enterprise
send-trap -version 1 -manager 10.0.1.255 -enterprise 1.5.7.5.8.3.4.1.4 -oid 0.0 -objectID 1.1,1.2 -objectType Integer,Integer -objectValue 20,31

Parameter List


The following is the full list of the parameters of the cmdlet with short descriptions. Click on the links for further details.

LogFileThe location of a file to which debug information is written.
AgentThe address of the SNMP agent.
AuthenticationPasswordThe password to use for SNMPv3 authentication.
AuthenticationProtocolThe authentication protocol used.
CommunityThe value of the Community parameter for SNMP traps.
ConfigSpecifies one or more configuration settings.
EncryptionAlgorithmThe encryption algorithm used for the request.
EncryptionPasswordThe password to use for SNMPv3 privacy encryption.
EnterpriseThe type of the object generating the trap.
LocalIPThe IP address of the local interface to use.
LogFileThe location of a file to which debug information is written.
ManagerThe Manager to which to send the trap.
MibExtra mib files to use for the Label to OID translation and vice versa.
ObjectIDA collection of OIDs to add to the trap.
ObjectTypeA collection of Object types to add to the trap.
ObjectValueThe Object value collection to add to the trap.
OIDThe OID to use for the request.
TimeoutThe maximum time allowed for the operation.
UptimeTime passed since the agent was initialized (in hundredths of a second).
UserThe username to use for authentication.
VersionThe version of SNMP to use for the request.

Output Objects


The following is the full list of the output objects returned by the cmdlet with short descriptions. Click on the links for further details.

TrapThis object is returned for each trap received by the component.

Configuration Settings


The following is a list of configuration settings for the cmdlet with short descriptions. Click on the links for further details.

BuildInfoInformation about the product's build.
CodePageThe system code page used for Unicode to Multibyte translations.
LicenseInfoInformation about the current license.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

Copyright (c) 2022 /n software inc. - All rights reserved.
NetCmdlets 2020 - Version 20.0 [Build 8319]