protected void sendTraps(Notification notification, SnmpVersion snmpVersion) throws InvalidSnmpConfigurationException, IOException {
    PDU trap = prepareTrap(notification, snmpVersion);
    String udpPort = getDispatchProperty(notification.DispatchProperties, PORT_PROPERTY);
    for (Recipient recipient : getNotificationRecipients(notification)) {
      String address = recipient.Identifier;
      Target target = createTrapTarget(notification, snmpVersion);
      target.setAddress(new UdpAddress(address + "/" + udpPort));
      snmp.send(trap, target);
    }
  }
Creates trap based on alerts notification and sends it to hosts specified in recipients list.
@param notification alert notification to dispatch
@param snmpVersion SNMP version
@throws InvalidSnmpConfigurationException if notification's dispatch properties don't contain any of required properties or recipient list is empty.
@throws IOException if the SNMP trap could not be sent
ambari-server/src/main/java/org/apache/ambari/server/notifications/dispatchers/SNMPDispatcher.java