SNMP trap provides a very useful way to monitor vSphere. You can use either GUI or vSphere API to configure up to 4 trap receivers. With that I can use alarm to monitor events or state changes.
If you use vSphere API to add SNMP receivers, you will need the OptionManager managed object. The related options you want to set are: snmp.receiver.1.name, snmp.receiver.1.port, snmp.receiver.1.community, snmp.receiver.1.enabled. There are 3 more sets with similar names but different numbers (2, 3, 4).