The snmp_trap command generates a notification (trap) to report an event to the SNMP manager with the specified message.
snmp_trap [-debug] [-host HostName | -target TargetHost] [-com Community] [-msg Message]
The snmp_trap command generates a notification (trap) to report an event to the SNMP manager with the specified message.
Flag name | Description |
---|---|
-host HostName | Specifies to connect to the SNMP agent on the specified host. If you do not specify this flag, the default host is the local host. Host can be an IP address or a host name. |
-com Community | Specifies the community name to use. This community must have been set in the /etc/snmpdv3.conf file for SNMP version 3 file. You also have to have read-access privilege to at least the SNMP agent running on the specified host or local host. If you do not specify this flag, the default community name is "public". |
-debug | Enables the debug facility. |
-msg Message | Defines the message that the snmp_trap command will send. This value specifies the information the trap will hold. This information is in the text format. You must order this flag as the last one in the list when you specify this command. |
-target TargetHost | Specifies the target network-manager host to which the trap message is sent. It is different from -host flag. If you do not specify the -host and -target flags, the trap is sent to the VIOS SNMP agent on the local host. |
snmp_trap -msg hello world