You can use the vCenter Server Appliance SNMP agent to send virtual machine and environmental notifications to management systems.
About this task
To send SNMP v1 and v2c notifications with the SNMP agent, you must configure the target, that is the receiver, unicast address, community, and an optional port. If you do not specify a port, the SNMP agent sends notifications to UDP port 162 on the target management system by default.
- Access the appliance shell and log in as a user who has the administrator or super administrator role.
The default user with super administrator role is root.
- Run the snmp.set --targets command:
snmp.set --targets target_address@port/community
Here target_address, port, and community are the address of the target system, the port number to send the notifications to, and the community name, respectively. The port value is optional. If you do not specify a port, the default port,161, is used.
Each time you specify a target with this command, the settings you specify overwrite all previously specified settings. To specify multiple targets, separate them with a comma.
For example, run the following command for configuring the targets 192.0.2.1@678/targetcommunity and 2001:db8::1/anothercom:
snmp.set --targets 192.0.2.1@678/targetcommunity,2001:db8::1/anothercom
- (Optional) If the SNMP agent is not enabled, enable it by running the snmp.enable command.
- (Optional) To send a test trap to verify that the agent is configured correctly, run the snmp.test command.
The agent sends a warmStart trap to the configured target.