Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. On the Ambari Server host, browse to /etc/ambari-server/conf directory.
  2. Edit the ambari.properties file.
  3. Add an entry for the location of your new template (that will override the default template). . Any notification types defined in the new template will override those bundled with Ambari. If you choose to provide your own template file, you only need to define notification templates for the types that you wish to override. If a notification template type is not found in the customized template, Ambari will default to the templates that ship with the JAR.

    Code Block
    alerts.template.file=/foo/var/alert-templates-custom.xml


  4. Save the file and restart Ambari Server.

...

VariableDescription
$alert.getAlertDefinition() The definition that the alert is an instance of.
$alert.getAlertText() The specific alert text.
$alert.getAlertName() The name of the alert.
$alert.getAlertState() The alert state (OK|WARNING|CRITICAL|UNKNOWN)
$alert.getServiceName() The name of the service that the alert is defined for.
$alert.hasComponentName() True if the alert is for a specific service component.
$alert.getComponentName() The component, if any, that the alert is defined for.
$alert.hasHostName() True if the alert was triggered for a specific host.
$alert.getHostName() The hostname, if any, that the alert was triggered for.
$ambari.getServerUrl()The Ambari Server URL.
$ambari.getServerVersion()The Ambari Server version.
$ambari.getServerHostName()The Ambari Server hostname.
$dispatch.getTargetName()The notification target name.
$dispatch.getTargetDescription()The notification target description.
$summary.getAlerts(service,alertState)A list of all alerts for a given service or alert state (OK|WARNING|CRITICAL|UNKNOWN).
$summary.getServicesByAlertState(alertState)A list of all services for a given alert state (OK|WARNING|CRITICAL|UNKNOWN).
$summary.getServices()A list of all services that are reporting an alert in the notification.
$summary.getCriticalCount()The CRITICAL alert count.
$summary.getOkCount()The OK alert count.
$summary.getTotalCount()
The total alert count.
$summary.getUnknownCount()The UNKNOWN alert count.
$summary.getWarningCount()The WARNING alert count.
$summary.getAlerts()
A list of all of the alerts in the notification.

Example: Modify Alert EMAIL Subject

...