Generate a notification (trap) to report an event to the SNMP manager with the specified message.
Generate a notification (trap) to report an event to the SNMP manager with the specified message.
Item | Description |
---|---|
-a host | Specifies to connect to the SNMP agent on the specified host. If the -a flag is not specified, the default host is the local host. host can be an IPv4 address, an IPv6 address, or a host name. |
-c community | Specifies community name to use. This community must have been set in /etc/snmpdv3.conf for SNMP version 3 or in /etc/snmpd.conf for SNMP version 1 and have the read access privilege at least to the SNMP agent running on the specified host or local host. If the -c flag is not specified, the default community name is "public". |
-o oid | Specifies the event that generates the trap message. The oid specified, it will be used in the trap packet. If the parameter is not specified, the default OID is used in the trap packet. This specified OID is not validated for its correctness. |
-d | Enables the debug facility |
-h targethost | Specifies the target network manger host to which the trap message will be sent. The target host can be an IPv4 address, an IPv6 address, or a host name.The -h flag is different from the -a flag. The -a flag specifies a host where the AIX® SNMP agent (snmp) must be running and the SNMP agent forwards this trap to network mangers. However, the -h flag does not require the AIX SNMP agent to forward the trap message to network managers, and it sends the trap directly to the network manager. If there are no -h and -a flags, the trap will be sent to the AIX SNMP agent on the local host. |
-m message | Defines the message that the snmptrap command will send. message specifies the information the trap will hold. This information is in the text format. The -m flag must be the last flag specified. |
snmptrap -m hello world
snmptrap -c community1 -h blah -m hello world
snmptrap -h nehcyg -m hello world
snmptrap -h nehcyg –o 1.3.6.1.4.1.2.6.191.1.6.1.0 -m hello world
snmptrap -c community1 -h 2000:1:1:1:209:6bff:feae:6d67 -m hello world
snmptrap -h 2000:1:1:1:209:6bff:feae:6d67 -o 1.3.6.1.4.1.2.6.191.1.6.1.0 -m hello world
Item | Description |
---|---|
/etc/snmpdv3.conf | Contains the configuration file for the SNMP version 3 agent. |
/etc/snmpd.conf | Contains the configuration file for the SNMP version 1 agent. |