You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2016/12/08 23:29:50 UTC

[11/25] ambari git commit: Merge from branch-2.5

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/configuration/sleepy-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/configuration/sleepy-site.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/configuration/sleepy-site.xml
index 67762a5..5b6f2f6 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/configuration/sleepy-site.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/configuration/sleepy-site.xml
@@ -33,4 +33,16 @@
     </value-attributes>
     <on-ambari-upgrade add="false"/>
   </property>
+  <property>
+    <name>sleepy_user</name>
+    <display-name>sleepy User</display-name>
+    <value>sleepy</value>
+    <property-type>USER</property-type>
+    <description>sleepy Username.</description>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/kerberos.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/kerberos.json
new file mode 100644
index 0000000..45e33f5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/kerberos.json
@@ -0,0 +1,78 @@
+{
+  "services": [
+    {
+      "name": "SLEEPY",
+      "identities": [
+        {
+          "name": "/spnego"
+        },
+        {
+          "name": "sleepy",
+          "principal": {
+            "value": "${sleepy-site/sleepy_user}-${cluster_name|toLower()}@${realm}",
+            "type" : "user",
+            "configuration": "sleepy-site/sleepy_principal_name",
+            "local_username": "${sleepy-site/sleepy_user}"
+          },
+          "keytab": {
+            "file": "${keytab_dir}/sleepy.headless.keytab",
+            "owner": {
+              "name": "${sleepy-site/sleepy_user}",
+              "access": "r"
+            },
+            "group": {
+              "name": "${cluster-env/user_group}",
+              "access": "r"
+            },
+            "configuration": "sleepy-site/sleepy_user_keytab"
+          }
+        },
+        {
+          "name": "/smokeuser"
+        }
+      ],
+      "configurations": [
+      ],
+      "components": [
+        {
+          "name": "SLEEPY",
+          "identities": [
+            {
+              "name": "/HDFS/NAMENODE/hdfs"
+            },
+            {
+              "name": "sleepy_sleepy",
+              "principal": {
+                "value": "sleepy/_HOST@${realm}",
+                "type" : "service",
+                "configuration": "sleepy-site/sleepy.sleepy.kerberos.principal",
+                "local_username": "${sleepy-site/sleepy_user}"
+              },
+              "keytab": {
+                "file": "${keytab_dir}/sleepy.service.keytab",
+                "owner": {
+                  "name": "${sleepy-site/sleepy_user}",
+                  "access": "r"
+                },
+                "group": {
+                  "name": "${cluster-env/user_group}",
+                  "access": ""
+                },
+                "configuration": "sleepy-site/sleepy.sleepy.keytab.file"
+              }
+            },
+            {
+              "name": "/spnego",
+              "principal": {
+                "configuration": "sleepy-site/sleepy.security.authentication.spnego.kerberos.principal"
+              },
+              "keytab": {
+                "configuration": "sleepy-site/sleepy.security.authentication.spnego.kerberos.keytab"
+              }
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/metainfo.xml
index 470d809..5b4dbd4 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/metainfo.xml
@@ -52,6 +52,11 @@
           <default>true</default>
         </theme>
       </themes>
+
+      <configuration-dependencies>
+        <config-type>sleepy-alert-config</config-type>
+      </configuration-dependencies>
+
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/alerts/alert_sleepy_process.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/alerts/alert_sleepy_process.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/alerts/alert_sleepy_process.py
new file mode 100644
index 0000000..6005459
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/alerts/alert_sleepy_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+import logging
+
+from resource_management.libraries.functions.simulate_perf_cluster_alert_behaviour import simulate_perf_cluster_alert_behaviour
+
+ALERT_BEHAVIOUR_TYPE = "{{sleepy-alert-config/alert.behavior.type}}"
+
+ALERT_SUCCESS_PERCENTAGE = "{{sleepy-alert-config/alert.success.percentage}}"
+
+ALERT_TIMEOUT_RETURN_VALUE = "{{sleepy-alert-config/alert.timeout.return.value}}"
+ALERT_TIMEOUT_SECS = "{{sleepy-alert-config/alert.timeout.secs}}"
+
+ALERT_FLIP_INTERVAL_MINS = "{{sleepy-alert-config/alert.flip.interval.mins}}"
+
+logger = logging.getLogger('ambari_alerts')
+
+alert_behaviour_properties = {"alert_behaviour_type" : ALERT_BEHAVIOUR_TYPE, "alert_success_percentage" : ALERT_SUCCESS_PERCENTAGE,
+                              "alert_timeout_return_value" : ALERT_TIMEOUT_RETURN_VALUE, "alert_timeout_secs" : ALERT_TIMEOUT_SECS,
+                              "alert_flip_interval_mins" : ALERT_FLIP_INTERVAL_MINS}
+
+def get_tokens():
+  """
+  Returns a tuple of tokens in the format {{site/property}} that will be used
+  to build the dictionary passed into execute
+  """
+  return (ALERT_BEHAVIOUR_TYPE, ALERT_SUCCESS_PERCENTAGE, ALERT_TIMEOUT_RETURN_VALUE, ALERT_TIMEOUT_SECS,
+          ALERT_FLIP_INTERVAL_MINS)
+
+
+def execute(configurations={}, parameters={}, host_name=None):
+  """
+  Returns a tuple containing the result code and a pre-formatted result label
+
+  Keyword arguments:
+  configurations (dictionary): a mapping of configuration key to value
+  parameters (dictionary): a mapping of script parameter key to value
+  host_name (string): the name of this host where the alert is running
+  """
+
+  return simulate_perf_cluster_alert_behaviour(alert_behaviour_properties, configurations)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/scripts/dwarf.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/scripts/dwarf.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/scripts/dwarf.py
index 370d03d..699e35b 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/scripts/dwarf.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SLEEPY/package/scripts/dwarf.py
@@ -33,6 +33,10 @@ class Sleepy(Dummy):
   def __init__(self):
     super(Sleepy, self).__init__()
     self.component_name = "SLEEPY"
+    self.principal_conf_name = "sleepy-site"
+    self.principal_name = "sleepy.sleepy.kerberos.principal"
+    self.keytab_conf_name = "sleepy-site"
+    self.keytab_name = "sleepy.sleepy.keytab.file"
 
 if __name__ == "__main__":
   Sleepy().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/alerts.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/alerts.json
new file mode 100644
index 0000000..c05127c
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/alerts.json
@@ -0,0 +1,20 @@
+{
+    "SNOW": {
+
+        "SNOW_WHITE": [
+            {
+                "name": "snow_process",
+                "label": "Snow Process",
+                "description": "Alert for snow component process status",
+                "interval": 1,
+                "scope": "HOST",
+                "enabled": true,
+                "source": {
+                    "type": "SCRIPT",
+                    "path": "PERF/1.0/services/SNOW/package/alerts/alert_snow_process.py",
+                    "parameters": []
+                }
+            }
+        ]
+    }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-alert-config.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-alert-config.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-alert-config.xml
new file mode 100644
index 0000000..392eea7
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-alert-config.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_final="true">
+
+    <property>
+        <name>alert.behavior.type</name>
+        <value>percentage</value>
+        <description>
+            This property describes type of alert behaviour.
+            There are three types percentage, timeout, flip.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.success.percentage</name>
+        <value>100</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "percentage". Here you should set percent of successful
+            alert checks.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.timeout.return.value</name>
+        <value>false</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "timeout". Here you should set result which alert will
+            return after timeout, false|true|none.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>alert.timeout.secs</name>
+        <value>120</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "timeout". Here you should set number of seconds for
+            alert to sleep.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.flip.interval.mins</name>
+        <value>3</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "flip". Here you should set number of minutes at which
+            the alert should flip from true|false.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml
index 67762a5..dfad0ac 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/configuration/snow-site.xml
@@ -33,4 +33,16 @@
     </value-attributes>
     <on-ambari-upgrade add="false"/>
   </property>
+  <property>
+    <name>snow_user</name>
+    <display-name>snow User</display-name>
+    <value>snow</value>
+    <property-type>USER</property-type>
+    <description>snow Username.</description>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/kerberos.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/kerberos.json
new file mode 100644
index 0000000..47a979a8
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/kerberos.json
@@ -0,0 +1,78 @@
+{
+  "services": [
+    {
+      "name": "SNOW",
+      "identities": [
+        {
+          "name": "/spnego"
+        },
+        {
+          "name": "snow",
+          "principal": {
+            "value": "${snow-site/snow_user}-${cluster_name|toLower()}@${realm}",
+            "type" : "user",
+            "configuration": "snow-site/snow_principal_name",
+            "local_username": "${snow-site/snow_user}"
+          },
+          "keytab": {
+            "file": "${keytab_dir}/snow.headless.keytab",
+            "owner": {
+              "name": "${snow-site/snow_user}",
+              "access": "r"
+            },
+            "group": {
+              "name": "${cluster-env/user_group}",
+              "access": "r"
+            },
+            "configuration": "snow-site/snow_user_keytab"
+          }
+        },
+        {
+          "name": "/smokeuser"
+        }
+      ],
+      "configurations": [
+      ],
+      "components": [
+        {
+          "name": "SNOW_WHITE",
+          "identities": [
+            {
+              "name": "/HDFS/NAMENODE/hdfs"
+            },
+            {
+              "name": "snow_white_snow",
+              "principal": {
+                "value": "snow/_HOST@${realm}",
+                "type" : "service",
+                "configuration": "snow-site/snow.white.kerberos.principal",
+                "local_username": "${snow-site/snow_user}"
+              },
+              "keytab": {
+                "file": "${keytab_dir}/snow.service.keytab",
+                "owner": {
+                  "name": "${snow-site/snow_user}",
+                  "access": "r"
+                },
+                "group": {
+                  "name": "${cluster-env/user_group}",
+                  "access": ""
+                },
+                "configuration": "snow-site/snow.white.keytab.file"
+              }
+            },
+            {
+              "name": "/spnego",
+              "principal": {
+                "configuration": "snow-site/snow.security.authentication.spnego.kerberos.principal"
+              },
+              "keytab": {
+                "configuration": "snow-site/snow.security.authentication.spnego.kerberos.keytab"
+              }
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml
index cbb57f6..21e685a 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/metainfo.xml
@@ -52,6 +52,11 @@
           <default>true</default>
         </theme>
       </themes>
+
+      <configuration-dependencies>
+        <config-type>snow-alert-config</config-type>
+      </configuration-dependencies>
+
     </service>
   </services>
 </metainfo>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/alerts/alert_snow_process.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/alerts/alert_snow_process.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/alerts/alert_snow_process.py
new file mode 100644
index 0000000..2df652c
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/alerts/alert_snow_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+import logging
+
+from resource_management.libraries.functions.simulate_perf_cluster_alert_behaviour import simulate_perf_cluster_alert_behaviour
+
+ALERT_BEHAVIOUR_TYPE = "{{snow-alert-config/alert.behavior.type}}"
+
+ALERT_SUCCESS_PERCENTAGE = "{{snow-alert-config/alert.success.percentage}}"
+
+ALERT_TIMEOUT_RETURN_VALUE = "{{snow-alert-config/alert.timeout.return.value}}"
+ALERT_TIMEOUT_SECS = "{{snow-alert-config/alert.timeout.secs}}"
+
+ALERT_FLIP_INTERVAL_MINS = "{{snow-alert-config/alert.flip.interval.mins}}"
+
+logger = logging.getLogger('ambari_alerts')
+
+alert_behaviour_properties = {"alert_behaviour_type" : ALERT_BEHAVIOUR_TYPE, "alert_success_percentage" : ALERT_SUCCESS_PERCENTAGE,
+                              "alert_timeout_return_value" : ALERT_TIMEOUT_RETURN_VALUE, "alert_timeout_secs" : ALERT_TIMEOUT_SECS,
+                              "alert_flip_interval_mins" : ALERT_FLIP_INTERVAL_MINS}
+
+def get_tokens():
+  """
+  Returns a tuple of tokens in the format {{site/property}} that will be used
+  to build the dictionary passed into execute
+  """
+  return (ALERT_BEHAVIOUR_TYPE, ALERT_SUCCESS_PERCENTAGE, ALERT_TIMEOUT_RETURN_VALUE, ALERT_TIMEOUT_SECS,
+          ALERT_FLIP_INTERVAL_MINS)
+
+
+def execute(configurations={}, parameters={}, host_name=None):
+  """
+  Returns a tuple containing the result code and a pre-formatted result label
+
+  Keyword arguments:
+  configurations (dictionary): a mapping of configuration key to value
+  parameters (dictionary): a mapping of script parameter key to value
+  host_name (string): the name of this host where the alert is running
+  """
+
+  return simulate_perf_cluster_alert_behaviour(alert_behaviour_properties, configurations)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py
index 41bfa8a..df2b81d 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/SNOW/package/scripts/snow_white.py
@@ -33,6 +33,10 @@ class SnowWhite(Dummy):
   def __init__(self):
     super(SnowWhite, self).__init__()
     self.component_name = "SNOW_WHITE"
+    self.principal_conf_name = "snow-site"
+    self.principal_name = "snow.white.kerberos.principal"
+    self.keytab_conf_name = "snow-site"
+    self.keytab_name = "snow.white.keytab.file"
 
 if __name__ == "__main__":
   SnowWhite().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/alerts.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/alerts.json
index c4a58bb..67cf881 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/alerts.json
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/alerts.json
@@ -1,185 +1,25 @@
 {
   "MAPREDUCE2": {
-    "service": [],
     "HISTORYSERVER": [
       {
-        "name": "mapreduce_history_server_webui",
-        "label": "History Server Web UI",
-        "description": "This host-level alert is triggered if the History Server Web UI is unreachable.",
+        "name": "mapreduce_history_process",
+        "label": "History Server process",
+        "description": "Alert for history server process status",
         "interval": 1,
-        "scope": "ANY",
-        "source": {
-          "type": "WEB",
-          "uri": {
-            "http": "{{mapred-site/mapreduce.jobhistory.webapp.address}}",
-            "https": "{{mapred-site/mapreduce.jobhistory.webapp.https.address}}",
-            "https_property": "{{mapred-site/mapreduce.jobhistory.http.policy}}",
-            "https_property_value": "HTTPS_ONLY",
-            "kerberos_keytab": "{{mapred-site/mapreduce.jobhistory.webapp.spnego-keytab-file}}",
-            "kerberos_principal": "{{mapred-site/mapreduce.jobhistory.webapp.spnego-principal}}",
-            "connection_timeout": 5.0
-          },
-          "reporting": {
-            "ok": {
-              "text": "HTTP {0} response in {2:.3f}s"
-            },
-            "warning":{
-              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
-            },
-            "critical": {
-              "text": "Connection failed to {1} ({3})"
-            }
-          }
-        }
-      },
-      {
-        "name": "mapreduce_history_server_cpu",
-        "label": "History Server CPU Utilization",
-        "description": "This host-level alert is triggered if the percent of CPU utilization on the History Server exceeds the configured critical threshold. The threshold values are in percent.",
-        "interval": 5,
-        "scope": "ANY",
-        "enabled": true,
-        "source": {
-          "type": "METRIC",
-          "uri": {
-            "http": "{{mapred-site/mapreduce.jobhistory.webapp.address}}",
-            "kerberos_keytab": "{{mapred-site/mapreduce.jobhistory.webapp.spnego-keytab-file}}",
-            "kerberos_principal": "{{mapred-site/mapreduce.jobhistory.webapp.spnego-principal}}",
-            "https": "{{mapred-site/mapreduce.jobhistory.webapp.https.address}}",
-            "https_property": "{{mapred-site/mapreduce.jobhistory.http.policy}}",
-            "https_property_value": "HTTPS_ONLY",
-            "connection_timeout": 5.0
-          },
-          "reporting": {
-            "ok": {
-              "text": "{1} CPU, load {0:.1%}"
-            },
-            "warning": {
-              "text": "{1} CPU, load {0:.1%}",
-              "value": 200
-            },
-            "critical": {
-              "text": "{1} CPU, load {0:.1%}",
-              "value": 250
-            },
-            "units" : "%",
-            "type": "PERCENT"
-          },
-          "jmx": {
-            "property_list": [
-              "java.lang:type=OperatingSystem/SystemCpuLoad",
-              "java.lang:type=OperatingSystem/AvailableProcessors"
-            ],
-            "value": "{0} * 100"
-          }
-        }
-      },
-      {
-        "name": "mapreduce_history_server_rpc_latency",
-        "label": "History Server RPC Latency",
-        "description": "This host-level alert is triggered if the History Server operations RPC latency exceeds the configured critical threshold. Typically an increase in the RPC processing time increases the RPC queue length, causing the average queue wait time to increase for operations. The threshold values are in milliseconds.",
-        "interval": 5,
-        "scope": "ANY",
+        "scope": "HOST",
         "enabled": true,
         "source": {
-          "type": "METRIC",
-          "uri": {
-            "http": "{{mapred-site/mapreduce.jobhistory.webapp.address}}",
-            "https": "{{mapred-site/mapreduce.jobhistory.webapp.https.address}}",
-            "kerberos_keytab": "{{mapred-site/mapreduce.jobhistory.webapp.spnego-keytab-file}}",
-            "kerberos_principal": "{{mapred-site/mapreduce.jobhistory.webapp.spnego-principal}}",
-            "https_property": "{{mapred-site/mapreduce.jobhistory.http.policy}}",
-            "https_property_value": "HTTPS_ONLY",
-            "connection_timeout": 5.0
-          },
-          "reporting": {
-            "ok": {
-              "text": "Average Queue Time:[{0}], Average Processing Time:[{1}]"
-            },
-            "warning": {
-              "text": "Average Queue Time:[{0}], Average Processing Time:[{1}]",
-              "value": 3000
-            },          
-            "critical": {
-              "text": "Average Queue Time:[{0}], Average Processing Time:[{1}]",
-              "value": 5000
-            },
-            "units" : "ms"
-          },
-          "jmx": {
-            "property_list": [
-              "Hadoop:service=JobHistoryServer,name=RpcActivityForPort*/RpcQueueTimeAvgTime",
-              "Hadoop:service=JobHistoryServer,name=RpcActivityForPort*/RpcProcessingTimeAvgTime"
-            ],
-            "value": "{0}"
-          }
+          "type": "SCRIPT",
+          "path": "PERF/1.0/services/YARN/package/alerts/alert_history_process.py",
+          "parameters": []
         }
       }
     ]
   },
   "YARN": {
-    "service": [
-      {
-        "name": "yarn_nodemanager_webui_percent",
-        "label": "Percent NodeManagers Available",
-        "description": "This alert is triggered if the number of down NodeManagers in the cluster is greater than the configured critical threshold. It aggregates the results of NodeManager process checks.",
-        "interval": 1,
-        "scope": "SERVICE",
-        "enabled": true,
-        "source": {
-          "type": "AGGREGATE",
-          "alert_name": "yarn_nodemanager_webui",
-          "reporting": {
-            "ok": {
-              "text": "affected: [{1}], total: [{0}]"
-            },
-            "warning": {
-              "text": "affected: [{1}], total: [{0}]",
-              "value": 10
-            },
-            "critical": {
-              "text": "affected: [{1}], total: [{0}]",
-              "value": 30
-            },
-            "units" : "%",
-            "type": "PERCENT"
-          }
-        }
-      }
-    ],
+
     "NODEMANAGER": [
       {
-        "name": "yarn_nodemanager_webui",
-        "label": "NodeManager Web UI",
-        "description": "This host-level alert is triggered if the NodeManager Web UI is unreachable.",
-        "interval": 1,
-        "scope": "HOST",
-        "source": {
-          "type": "WEB",
-          "uri": {
-            "http": "{{yarn-site/yarn.nodemanager.webapp.address}}",
-            "https": "{{yarn-site/yarn.nodemanager.webapp.https.address}}",
-            "https_property": "{{yarn-site/yarn.http.policy}}",
-            "https_property_value": "HTTPS_ONLY",
-            "default_port": 8042,
-            "kerberos_keytab": "{{yarn-site/yarn.nodemanager.webapp.spnego-keytab-file}}",
-            "kerberos_principal": "{{yarn-site/yarn.nodemanager.webapp.spnego-principal}}",
-            "connection_timeout": 5.0
-          },
-          "reporting": {
-            "ok": {
-              "text": "HTTP {0} response in {2:.3f}s"
-            },
-            "warning":{
-              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
-            },
-            "critical": {
-              "text": "Connection failed to {1} ({3})"
-            }
-          }
-        }
-      },
-      {
         "name": "yarn_nodemanager_health",
         "label": "NodeManager Health",
         "description": "This host-level alert checks the node health property available from the NodeManager component.",
@@ -188,7 +28,7 @@
         "enabled": true,
         "source": {
           "type": "SCRIPT",
-          "path": "YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py",
+          "path": "PERF/1.0/services/YARN/package/alerts/alert_nodemanager_health.py",
           "parameters": [
             {
               "name": "connection.timeout",
@@ -205,186 +45,31 @@
     ],
     "RESOURCEMANAGER": [
       {
-        "name": "yarn_resourcemanager_webui",
-        "label": "ResourceManager Web UI",
-        "description": "This host-level alert is triggered if the ResourceManager Web UI is unreachable.",
+        "name": "yarn_resourcemanager_process",
+        "label": "ResourceManager process",
+        "description": "Alert for resourcemanager process status",
         "interval": 1,
-        "scope": "ANY",
-        "source": {
-          "type": "WEB",
-          "uri": {
-            "http": "{{yarn-site/yarn.resourcemanager.webapp.address}}",
-            "https": "{{yarn-site/yarn.resourcemanager.webapp.https.address}}",
-            "https_property": "{{yarn-site/yarn.http.policy}}",
-            "https_property_value": "HTTPS_ONLY",
-            "kerberos_keytab": "{{yarn-site/yarn.resourcemanager.webapp.spnego-keytab-file}}",
-            "kerberos_principal": "{{yarn-site/yarn.resourcemanager.webapp.spnego-principal}}",
-            "connection_timeout": 5.0,
-            "high_availability": {
-              "alias_key" : "{{yarn-site/yarn.resourcemanager.ha.rm-ids}}",
-              "http_pattern" : "{{yarn-site/yarn.resourcemanager.webapp.address.{{alias}}}}",
-              "https_pattern" : "{{yarn-site/yarn.resourcemanager.webapp.https.address.{{alias}}}}"
-            }
-          },
-          "reporting": {
-            "ok": {
-              "text": "HTTP {0} response in {2:.3f}s"
-            },
-            "warning":{
-              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
-            },
-            "critical": {
-              "text": "Connection failed to {1} ({3})"
-            }
-          }
-        }
-      },
-      {
-        "name": "yarn_resourcemanager_cpu",
-        "label": "ResourceManager CPU Utilization",
-        "description": "This host-level alert is triggered if CPU utilization of the ResourceManager exceeds certain warning and critical thresholds. It checks the ResourceManager JMX Servlet for the SystemCPULoad property. The threshold values are in percent.",
-        "interval": 5,
-        "scope": "ANY",
-        "enabled": true,
-        "source": {
-          "type": "METRIC",
-          "uri": {
-            "http": "{{yarn-site/yarn.resourcemanager.webapp.address}}",
-            "https": "{{yarn-site/yarn.resourcemanager.webapp.https.address}}",
-            "kerberos_keytab": "{{yarn-site/yarn.resourcemanager.webapp.spnego-keytab-file}}",
-            "kerberos_principal": "{{yarn-site/yarn.resourcemanager.webapp.spnego-principal}}",
-            "https_property": "{{yarn-site/yarn.http.policy}}",
-            "https_property_value": "HTTPS_ONLY",
-            "connection_timeout": 5.0,
-            "high_availability": {
-              "alias_key" : "{{yarn-site/yarn.resourcemanager.ha.rm-ids}}",
-              "http_pattern" : "{{yarn-site/yarn.resourcemanager.webapp.address.{{alias}}}}",
-              "https_pattern" : "{{yarn-site/yarn.resourcemanager.webapp.https.address.{{alias}}}}"
-            }
-          },
-          "reporting": {
-            "ok": {
-              "text": "{1} CPU, load {0:.1%}"
-            },
-            "warning": {
-              "text": "{1} CPU, load {0:.1%}",
-              "value": 200
-            },
-            "critical": {
-              "text": "{1} CPU, load {0:.1%}",
-              "value": 250
-            },
-            "units" : "%",
-            "type": "PERCENT"
-          },
-          "jmx": {
-            "property_list": [
-              "java.lang:type=OperatingSystem/SystemCpuLoad",
-              "java.lang:type=OperatingSystem/AvailableProcessors"
-            ],
-            "value": "{0} * 100"
-          }
-        }
-      },
-      {
-        "name": "yarn_resourcemanager_rpc_latency",
-        "label": "ResourceManager RPC Latency",
-        "description": "This host-level alert is triggered if the ResourceManager operations RPC latency exceeds the configured critical threshold. Typically an increase in the RPC processing time increases the RPC queue length, causing the average queue wait time to increase for ResourceManager operations. The threshold values are in milliseconds.",
-        "interval": 5,
-        "scope": "ANY",
-        "enabled": true,
-        "source": {
-          "type": "METRIC",
-          "uri": {
-            "http": "{{yarn-site/yarn.resourcemanager.webapp.address}}",
-            "https": "{{yarn-site/yarn.resourcemanager.webapp.https.address}}",
-            "kerberos_keytab": "{{yarn-site/yarn.resourcemanager.webapp.spnego-keytab-file}}",
-            "kerberos_principal": "{{yarn-site/yarn.resourcemanager.webapp.spnego-principal}}",
-            "https_property": "{{yarn-site/yarn.http.policy}}",
-            "https_property_value": "HTTPS_ONLY",
-            "connection_timeout": 5.0,
-            "high_availability": {
-              "alias_key" : "{{yarn-site/yarn.resourcemanager.ha.rm-ids}}",
-              "http_pattern" : "{{yarn-site/yarn.resourcemanager.webapp.address.{{alias}}}}",
-              "https_pattern" : "{{yarn-site/yarn.resourcemanager.webapp.https.address.{{alias}}}}"
-            }
-          },
-          "reporting": {
-            "ok": {
-              "text": "Average Queue Time:[{0}], Average Processing Time:[{1}]"
-            },
-            "warning": {
-              "text": "Average Queue Time:[{0}], Average Processing Time:[{1}]",
-              "value": 3000
-            },          
-            "critical": {
-              "text": "Average Queue Time:[{0}], Average Processing Time:[{1}]",
-              "value": 5000
-            },
-            "units" : "ms"
-          },
-          "jmx": {
-            "property_list": [
-              "Hadoop:service=ResourceManager,name=RpcActivityForPort*/RpcQueueTimeAvgTime",
-              "Hadoop:service=ResourceManager,name=RpcActivityForPort*/RpcProcessingTimeAvgTime"
-            ],
-            "value": "{0}"
-          }
-        }
-      },
-      {
-        "name": "nodemanager_health_summary",
-        "label": "NodeManager Health Summary",
-        "description": "This service-level alert is triggered if there are unhealthy NodeManagers",
-        "interval": 1,
-        "scope": "SERVICE",
+        "scope": "HOST",
         "enabled": true,
         "source": {
           "type": "SCRIPT",
-          "path": "YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py",
-          "parameters": [
-            {
-              "name": "connection.timeout",
-              "display_name": "Connection Timeout",
-              "value": 5.0,
-              "type": "NUMERIC",
-              "description": "The maximum time before this alert is considered to be CRITICAL",
-              "units": "seconds",
-              "threshold": "CRITICAL"
-            }
-          ]
+          "path": "PERF/1.0/services/YARN/package/alerts/alert_resourcemanager_process.py",
+          "parameters": []
         }
       }
     ],
     "APP_TIMELINE_SERVER": [
       {
-        "name": "yarn_app_timeline_server_webui",
-        "label": "App Timeline Web UI",
-        "description": "This host-level alert is triggered if the App Timeline Server Web UI is unreachable.",
+        "name": "yarn_app_timeline_server_process",
+        "label": "App Timeline process",
+        "description": "Alert for app timeline server process status",
         "interval": 1,
-        "scope": "ANY",
+        "scope": "HOST",
+        "enabled": true,
         "source": {
-          "type": "WEB",
-          "uri": {
-            "http": "{{yarn-site/yarn.timeline-service.webapp.address}}/ws/v1/timeline",
-            "https": "{{yarn-site/yarn.timeline-service.webapp.https.address}}/ws/v1/timeline",
-            "https_property": "{{yarn-site/yarn.http.policy}}",
-            "https_property_value": "HTTPS_ONLY",
-            "kerberos_keytab": "{{yarn-site/yarn.timeline-service.http-authentication.kerberos.keytab}}",
-            "kerberos_principal": "{{yarn-site/yarn.timeline-service.http-authentication.kerberos.principal}}",
-            "connection_timeout": 5.0
-          },
-          "reporting": {
-            "ok": {
-              "text": "HTTP {0} response in {2:.3f}s"
-            },
-            "warning":{
-              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
-            },
-            "critical": {
-              "text": "Connection failed to {1} ({3})"
-            }
-          }
+          "type": "SCRIPT",
+          "path": "PERF/1.0/services/YARN/package/alerts/alert_timeline_process.py",
+          "parameters": []
         }
       }
     ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/configuration/yarn-alert-config.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/configuration/yarn-alert-config.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/configuration/yarn-alert-config.xml
new file mode 100644
index 0000000..392eea7
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/configuration/yarn-alert-config.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_final="true">
+
+    <property>
+        <name>alert.behavior.type</name>
+        <value>percentage</value>
+        <description>
+            This property describes type of alert behaviour.
+            There are three types percentage, timeout, flip.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.success.percentage</name>
+        <value>100</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "percentage". Here you should set percent of successful
+            alert checks.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.timeout.return.value</name>
+        <value>false</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "timeout". Here you should set result which alert will
+            return after timeout, false|true|none.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>alert.timeout.secs</name>
+        <value>120</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "timeout". Here you should set number of seconds for
+            alert to sleep.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.flip.interval.mins</name>
+        <value>3</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "flip". Here you should set number of minutes at which
+            the alert should flip from true|false.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/metainfo.xml
index 8b18e73..bb2191b 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/metainfo.xml
@@ -122,6 +122,7 @@
           -->
 
           <configuration-dependencies>
+            <config-type>yarn-alert-config</config-type>
             <config-type>capacity-scheduler</config-type>
             <config-type>hdfs-site</config-type>
           </configuration-dependencies>
@@ -193,6 +194,7 @@
       </components>
 
       <configuration-dependencies>
+        <config-type>yarn-alert-config</config-type>
         <config-type>yarn-site</config-type>
         <config-type>yarn-env</config-type>
         <config-type>hdfs-site</config-type>
@@ -324,6 +326,7 @@
       </requiredServices>
 
       <configuration-dependencies>
+        <config-type>yarn-alert-config</config-type>
         <config-type>hdfs-site</config-type>
         <config-type>hadoop-env</config-type>
         <config-type>core-site</config-type>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_history_process.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_history_process.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_history_process.py
new file mode 100644
index 0000000..8733679
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_history_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+import logging
+
+from resource_management.libraries.functions.simulate_perf_cluster_alert_behaviour import simulate_perf_cluster_alert_behaviour
+
+ALERT_BEHAVIOUR_TYPE = "{{yarn-alert-config/alert.behavior.type}}"
+
+ALERT_SUCCESS_PERCENTAGE = "{{yarn-alert-config/alert.success.percentage}}"
+
+ALERT_TIMEOUT_RETURN_VALUE = "{{yarn-alert-config/alert.timeout.return.value}}"
+ALERT_TIMEOUT_SECS = "{{yarn-alert-config/alert.timeout.secs}}"
+
+ALERT_FLIP_INTERVAL_MINS = "{{yarn-alert-config/alert.flip.interval.mins}}"
+
+logger = logging.getLogger('ambari_alerts')
+
+alert_behaviour_properties = {"alert_behaviour_type" : ALERT_BEHAVIOUR_TYPE, "alert_success_percentage" : ALERT_SUCCESS_PERCENTAGE,
+                              "alert_timeout_return_value" : ALERT_TIMEOUT_RETURN_VALUE, "alert_timeout_secs" : ALERT_TIMEOUT_SECS,
+                              "alert_flip_interval_mins" : ALERT_FLIP_INTERVAL_MINS}
+
+def get_tokens():
+  """
+  Returns a tuple of tokens in the format {{site/property}} that will be used
+  to build the dictionary passed into execute
+  """
+  return (ALERT_BEHAVIOUR_TYPE, ALERT_SUCCESS_PERCENTAGE, ALERT_TIMEOUT_RETURN_VALUE, ALERT_TIMEOUT_SECS,
+          ALERT_FLIP_INTERVAL_MINS)
+
+
+def execute(configurations={}, parameters={}, host_name=None):
+  """
+  Returns a tuple containing the result code and a pre-formatted result label
+
+  Keyword arguments:
+  configurations (dictionary): a mapping of configuration key to value
+  parameters (dictionary): a mapping of script parameter key to value
+  host_name (string): the name of this host where the alert is running
+  """
+
+  return simulate_perf_cluster_alert_behaviour(alert_behaviour_properties, configurations)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanager_health.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanager_health.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanager_health.py
index d2cfe26..8733679 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanager_health.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanager_health.py
@@ -20,33 +20,31 @@ limitations under the License.
 
 import logging
 
-RESULT_CODE_OK = 'OK'
-RESULT_CODE_CRITICAL = 'CRITICAL'
-RESULT_CODE_UNKNOWN = 'UNKNOWN'
+from resource_management.libraries.functions.simulate_perf_cluster_alert_behaviour import simulate_perf_cluster_alert_behaviour
 
-OK_MESSAGE = 'NodeManager Healthy'
+ALERT_BEHAVIOUR_TYPE = "{{yarn-alert-config/alert.behavior.type}}"
 
-NODEMANAGER_HTTP_ADDRESS_KEY = '{{yarn-site/yarn.nodemanager.webapp.address}}'
-NODEMANAGER_HTTPS_ADDRESS_KEY = '{{yarn-site/yarn.nodemanager.webapp.https.address}}'
-YARN_HTTP_POLICY_KEY = '{{yarn-site/yarn.http.policy}}'
+ALERT_SUCCESS_PERCENTAGE = "{{yarn-alert-config/alert.success.percentage}}"
 
-KERBEROS_KEYTAB = '{{yarn-site/yarn.nodemanager.webapp.spnego-keytab-file}}'
-KERBEROS_PRINCIPAL = '{{yarn-site/yarn.nodemanager.webapp.spnego-principal}}'
-SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}'
-SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
-EXECUTABLE_SEARCH_PATHS = '{{kerberos-env/executable_search_paths}}'
+ALERT_TIMEOUT_RETURN_VALUE = "{{yarn-alert-config/alert.timeout.return.value}}"
+ALERT_TIMEOUT_SECS = "{{yarn-alert-config/alert.timeout.secs}}"
+
+ALERT_FLIP_INTERVAL_MINS = "{{yarn-alert-config/alert.flip.interval.mins}}"
 
 logger = logging.getLogger('ambari_alerts')
 
+alert_behaviour_properties = {"alert_behaviour_type" : ALERT_BEHAVIOUR_TYPE, "alert_success_percentage" : ALERT_SUCCESS_PERCENTAGE,
+                              "alert_timeout_return_value" : ALERT_TIMEOUT_RETURN_VALUE, "alert_timeout_secs" : ALERT_TIMEOUT_SECS,
+                              "alert_flip_interval_mins" : ALERT_FLIP_INTERVAL_MINS}
 
 def get_tokens():
   """
   Returns a tuple of tokens in the format {{site/property}} that will be used
   to build the dictionary passed into execute
   """
-  return (NODEMANAGER_HTTP_ADDRESS_KEY,NODEMANAGER_HTTPS_ADDRESS_KEY, EXECUTABLE_SEARCH_PATHS,
-  YARN_HTTP_POLICY_KEY, SMOKEUSER_KEY, KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, SECURITY_ENABLED_KEY)
-  
+  return (ALERT_BEHAVIOUR_TYPE, ALERT_SUCCESS_PERCENTAGE, ALERT_TIMEOUT_RETURN_VALUE, ALERT_TIMEOUT_SECS,
+          ALERT_FLIP_INTERVAL_MINS)
+
 
 def execute(configurations={}, parameters={}, host_name=None):
   """
@@ -57,11 +55,5 @@ def execute(configurations={}, parameters={}, host_name=None):
   parameters (dictionary): a mapping of script parameter key to value
   host_name (string): the name of this host where the alert is running
   """
-  result_code = RESULT_CODE_UNKNOWN
-
-  if configurations is None:
-    return (result_code, ['There were no configurations supplied to the script.'])
 
-  result_code = RESULT_CODE_OK
-  label = OK_MESSAGE
-  return (result_code, [label])
+  return simulate_perf_cluster_alert_behaviour(alert_behaviour_properties, configurations)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanagers_summary.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanagers_summary.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanagers_summary.py
deleted file mode 100644
index 81527f6..0000000
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_nodemanagers_summary.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/usr/bin/env python
-
-"""
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-"""
-
-import logging
-
-RESULT_CODE_OK = 'OK'
-RESULT_CODE_CRITICAL = 'CRITICAL'
-RESULT_CODE_UNKNOWN = 'UNKNOWN'
-
-OK_MESSAGE = 'All NodeManagers are healthy'
-
-NODEMANAGER_HTTP_ADDRESS_KEY = '{{yarn-site/yarn.resourcemanager.webapp.address}}'
-NODEMANAGER_HTTPS_ADDRESS_KEY = '{{yarn-site/yarn.resourcemanager.webapp.https.address}}'
-YARN_HTTP_POLICY_KEY = '{{yarn-site/yarn.http.policy}}'
-
-KERBEROS_KEYTAB = '{{yarn-site/yarn.nodemanager.webapp.spnego-keytab-file}}'
-KERBEROS_PRINCIPAL = '{{yarn-site/yarn.nodemanager.webapp.spnego-principal}}'
-SECURITY_ENABLED_KEY = '{{cluster-env/security_enabled}}'
-SMOKEUSER_KEY = '{{cluster-env/smokeuser}}'
-EXECUTABLE_SEARCH_PATHS = '{{kerberos-env/executable_search_paths}}'
-
-logger = logging.getLogger('ambari_alerts')
-
-
-def get_tokens():
-  """
-  Returns a tuple of tokens in the format {{site/property}} that will be used
-  to build the dictionary passed into execute
-  """
-  return NODEMANAGER_HTTP_ADDRESS_KEY, NODEMANAGER_HTTPS_ADDRESS_KEY, EXECUTABLE_SEARCH_PATHS, \
-    YARN_HTTP_POLICY_KEY, SMOKEUSER_KEY, KERBEROS_KEYTAB, KERBEROS_PRINCIPAL, SECURITY_ENABLED_KEY
-
-
-def execute(configurations={}, parameters={}, host_name=None):
-  """
-  Returns a tuple containing the result code and a pre-formatted result label
-
-  Keyword arguments:
-  configurations (dictionary): a mapping of configuration key to value
-  parameters (dictionary): a mapping of script parameter key to value
-  host_name (string): the name of this host where the alert is running
-  """
-  result_code = RESULT_CODE_UNKNOWN
-
-  if configurations is None:
-    return (result_code, ['There were no configurations supplied to the script.'])
-
-  result_code = RESULT_CODE_OK
-  label = OK_MESSAGE
-
-  return (result_code, [label])

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_resourcemanager_process.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_resourcemanager_process.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_resourcemanager_process.py
new file mode 100644
index 0000000..8733679
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_resourcemanager_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+import logging
+
+from resource_management.libraries.functions.simulate_perf_cluster_alert_behaviour import simulate_perf_cluster_alert_behaviour
+
+ALERT_BEHAVIOUR_TYPE = "{{yarn-alert-config/alert.behavior.type}}"
+
+ALERT_SUCCESS_PERCENTAGE = "{{yarn-alert-config/alert.success.percentage}}"
+
+ALERT_TIMEOUT_RETURN_VALUE = "{{yarn-alert-config/alert.timeout.return.value}}"
+ALERT_TIMEOUT_SECS = "{{yarn-alert-config/alert.timeout.secs}}"
+
+ALERT_FLIP_INTERVAL_MINS = "{{yarn-alert-config/alert.flip.interval.mins}}"
+
+logger = logging.getLogger('ambari_alerts')
+
+alert_behaviour_properties = {"alert_behaviour_type" : ALERT_BEHAVIOUR_TYPE, "alert_success_percentage" : ALERT_SUCCESS_PERCENTAGE,
+                              "alert_timeout_return_value" : ALERT_TIMEOUT_RETURN_VALUE, "alert_timeout_secs" : ALERT_TIMEOUT_SECS,
+                              "alert_flip_interval_mins" : ALERT_FLIP_INTERVAL_MINS}
+
+def get_tokens():
+  """
+  Returns a tuple of tokens in the format {{site/property}} that will be used
+  to build the dictionary passed into execute
+  """
+  return (ALERT_BEHAVIOUR_TYPE, ALERT_SUCCESS_PERCENTAGE, ALERT_TIMEOUT_RETURN_VALUE, ALERT_TIMEOUT_SECS,
+          ALERT_FLIP_INTERVAL_MINS)
+
+
+def execute(configurations={}, parameters={}, host_name=None):
+  """
+  Returns a tuple containing the result code and a pre-formatted result label
+
+  Keyword arguments:
+  configurations (dictionary): a mapping of configuration key to value
+  parameters (dictionary): a mapping of script parameter key to value
+  host_name (string): the name of this host where the alert is running
+  """
+
+  return simulate_perf_cluster_alert_behaviour(alert_behaviour_properties, configurations)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_timeline_process.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_timeline_process.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_timeline_process.py
new file mode 100644
index 0000000..8733679
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/alerts/alert_timeline_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+import logging
+
+from resource_management.libraries.functions.simulate_perf_cluster_alert_behaviour import simulate_perf_cluster_alert_behaviour
+
+ALERT_BEHAVIOUR_TYPE = "{{yarn-alert-config/alert.behavior.type}}"
+
+ALERT_SUCCESS_PERCENTAGE = "{{yarn-alert-config/alert.success.percentage}}"
+
+ALERT_TIMEOUT_RETURN_VALUE = "{{yarn-alert-config/alert.timeout.return.value}}"
+ALERT_TIMEOUT_SECS = "{{yarn-alert-config/alert.timeout.secs}}"
+
+ALERT_FLIP_INTERVAL_MINS = "{{yarn-alert-config/alert.flip.interval.mins}}"
+
+logger = logging.getLogger('ambari_alerts')
+
+alert_behaviour_properties = {"alert_behaviour_type" : ALERT_BEHAVIOUR_TYPE, "alert_success_percentage" : ALERT_SUCCESS_PERCENTAGE,
+                              "alert_timeout_return_value" : ALERT_TIMEOUT_RETURN_VALUE, "alert_timeout_secs" : ALERT_TIMEOUT_SECS,
+                              "alert_flip_interval_mins" : ALERT_FLIP_INTERVAL_MINS}
+
+def get_tokens():
+  """
+  Returns a tuple of tokens in the format {{site/property}} that will be used
+  to build the dictionary passed into execute
+  """
+  return (ALERT_BEHAVIOUR_TYPE, ALERT_SUCCESS_PERCENTAGE, ALERT_TIMEOUT_RETURN_VALUE, ALERT_TIMEOUT_SECS,
+          ALERT_FLIP_INTERVAL_MINS)
+
+
+def execute(configurations={}, parameters={}, host_name=None):
+  """
+  Returns a tuple containing the result code and a pre-formatted result label
+
+  Keyword arguments:
+  configurations (dictionary): a mapping of configuration key to value
+  parameters (dictionary): a mapping of script parameter key to value
+  host_name (string): the name of this host where the alert is running
+  """
+
+  return simulate_perf_cluster_alert_behaviour(alert_behaviour_properties, configurations)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/application_timeline_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/application_timeline_server.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/application_timeline_server.py
index 4b32de7..d179b1f 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/application_timeline_server.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/application_timeline_server.py
@@ -33,6 +33,10 @@ class ApplicationTimelineServer(Dummy):
   def __init__(self):
     super(ApplicationTimelineServer, self).__init__()
     self.component_name = "APP_TIMELINE_SERVER"
+    self.principal_conf_name = "yarn-site"
+    self.principal_name = "yarn.timeline-service.principal"
+    self.keytab_conf_name = "yarn-site"
+    self.keytab_name = "yarn.timeline-service.keytab"
 
 if __name__ == "__main__":
   ApplicationTimelineServer().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/historyserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/historyserver.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/historyserver.py
index cba85b5..0570987 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/historyserver.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/historyserver.py
@@ -33,6 +33,10 @@ class HistoryServer(Dummy):
   def __init__(self):
     super(HistoryServer, self).__init__()
     self.component_name = "HISTORYSERVER"
+    self.principal_conf_name = "mapred-site"
+    self.principal_name = "mapreduce.jobhistory.principal"
+    self.keytab_conf_name = "mapred-site"
+    self.keytab_name = "mapreduce.jobhistory.keytab"
 
 if __name__ == "__main__":
   HistoryServer().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/nodemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/nodemanager.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/nodemanager.py
index 883c3ad..21db94f 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/nodemanager.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/nodemanager.py
@@ -33,6 +33,10 @@ class Nodemanager(Dummy):
   def __init__(self):
     super(Nodemanager, self).__init__()
     self.component_name = "NODEMANAGER"
+    self.principal_conf_name = "yarn-site"
+    self.principal_name = "yarn.nodemanager.principal"
+    self.keytab_conf_name = "yarn-site"
+    self.keytab_name = "yarn.nodemanager.keytab"
 
 if __name__ == "__main__":
   Nodemanager().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/resourcemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/resourcemanager.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/resourcemanager.py
index 7f80077..5f6c535 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/resourcemanager.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/YARN/package/scripts/resourcemanager.py
@@ -33,6 +33,10 @@ class Resourcemanager(Dummy):
   def __init__(self):
     super(Resourcemanager, self).__init__()
     self.component_name = "RESOURCEMANAGER"
+    self.principal_conf_name = "yarn-site"
+    self.principal_name = "yarn.resourcemanager.principal"
+    self.keytab_conf_name = "yarn-site"
+    self.keytab_name = "yarn.resourcemanager.keytab"
 
   def decommission(self, env):
     print "Decommission"

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/alerts.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/alerts.json
new file mode 100644
index 0000000..4af7ae9
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/alerts.json
@@ -0,0 +1,20 @@
+{
+    "ZOOKEEPER": {
+
+        "ZOOKEEPER_SERVER": [
+            {
+                "name": "zookeeper_server_process",
+                "label": "Zookeeper server Process",
+                "description": "Alert for zk server component process status",
+                "interval": 1,
+                "scope": "HOST",
+                "enabled": true,
+                "source": {
+                    "type": "SCRIPT",
+                    "path": "PERF/1.0/services/ZOOKEEPER/package/alerts/alert_zk_server_process.py",
+                    "parameters": []
+                }
+            }
+        ]
+    }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/configuration/zk-alert-config.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/configuration/zk-alert-config.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/configuration/zk-alert-config.xml
new file mode 100644
index 0000000..392eea7
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/configuration/zk-alert-config.xml
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+
+<configuration xmlns:xi="http://www.w3.org/2001/XInclude" supports_final="true">
+
+    <property>
+        <name>alert.behavior.type</name>
+        <value>percentage</value>
+        <description>
+            This property describes type of alert behaviour.
+            There are three types percentage, timeout, flip.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.success.percentage</name>
+        <value>100</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "percentage". Here you should set percent of successful
+            alert checks.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.timeout.return.value</name>
+        <value>false</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "timeout". Here you should set result which alert will
+            return after timeout, false|true|none.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+    <property>
+        <name>alert.timeout.secs</name>
+        <value>120</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "timeout". Here you should set number of seconds for
+            alert to sleep.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+    <property>
+        <name>alert.flip.interval.mins</name>
+        <value>3</value>
+        <description>
+            This property will be actual only when alert.behaviour.type
+            set to "flip". Here you should set number of minutes at which
+            the alert should flip from true|false.
+        </description>
+        <on-ambari-upgrade add="false"/>
+    </property>
+
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/kerberos.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/kerberos.json
new file mode 100644
index 0000000..0a64ea5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/kerberos.json
@@ -0,0 +1,39 @@
+{
+  "services": [
+    {
+      "name": "ZOOKEEPER",
+      "identities": [
+        {
+          "name": "/smokeuser"
+        }
+      ],
+      "components": [
+        {
+          "name": "ZOOKEEPER_SERVER",
+          "identities": [
+            {
+              "name": "zookeeper_zk",
+              "principal": {
+                "value": "zookeeper/_HOST@${realm}",
+                "type" : "service",
+                "configuration": "zookeeper-env/zookeeper_principal_name"
+              },
+              "keytab": {
+                "file": "${keytab_dir}/zk.service.keytab",
+                "owner": {
+                  "name": "${zookeeper-env/zk_user}",
+                  "access": "r"
+                },
+                "group": {
+                  "name": "${cluster-env/user_group}",
+                  "access": ""
+                },
+                "configuration": "zookeeper-env/zookeeper_keytab_path"
+              }
+            }
+          ]
+        }
+      ]
+    }
+  ]
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/metainfo.xml
index 62ea041..57667bb 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/metainfo.xml
@@ -43,6 +43,10 @@
         </component>
       </components>
 
+      <configuration-dependencies>
+        <config-type>zk-alert-config</config-type>
+      </configuration-dependencies>
+
       <!-- No packages to install. -->
       <osSpecifics></osSpecifics>
     </service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/alerts/alert_zk_server_process.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/alerts/alert_zk_server_process.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/alerts/alert_zk_server_process.py
new file mode 100644
index 0000000..55bbbd1
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/alerts/alert_zk_server_process.py
@@ -0,0 +1,59 @@
+#!/usr/bin/env python
+
+"""
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+
+import logging
+
+from resource_management.libraries.functions.simulate_perf_cluster_alert_behaviour import simulate_perf_cluster_alert_behaviour
+
+ALERT_BEHAVIOUR_TYPE = "{{zk-alert-config/alert.behavior.type}}"
+
+ALERT_SUCCESS_PERCENTAGE = "{{zk-alert-config/alert.success.percentage}}"
+
+ALERT_TIMEOUT_RETURN_VALUE = "{{zk-alert-config/alert.timeout.return.value}}"
+ALERT_TIMEOUT_SECS = "{{zk-alert-config/alert.timeout.secs}}"
+
+ALERT_FLIP_INTERVAL_MINS = "{{zk-alert-config/alert.flip.interval.mins}}"
+
+logger = logging.getLogger('ambari_alerts')
+
+alert_behaviour_properties = {"alert_behaviour_type" : ALERT_BEHAVIOUR_TYPE, "alert_success_percentage" : ALERT_SUCCESS_PERCENTAGE,
+                              "alert_timeout_return_value" : ALERT_TIMEOUT_RETURN_VALUE, "alert_timeout_secs" : ALERT_TIMEOUT_SECS,
+                              "alert_flip_interval_mins" : ALERT_FLIP_INTERVAL_MINS}
+
+def get_tokens():
+  """
+  Returns a tuple of tokens in the format {{site/property}} that will be used
+  to build the dictionary passed into execute
+  """
+  return (ALERT_BEHAVIOUR_TYPE, ALERT_SUCCESS_PERCENTAGE, ALERT_TIMEOUT_RETURN_VALUE, ALERT_TIMEOUT_SECS,
+          ALERT_FLIP_INTERVAL_MINS)
+
+
+def execute(configurations={}, parameters={}, host_name=None):
+  """
+  Returns a tuple containing the result code and a pre-formatted result label
+
+  Keyword arguments:
+  configurations (dictionary): a mapping of configuration key to value
+  parameters (dictionary): a mapping of script parameter key to value
+  host_name (string): the name of this host where the alert is running
+  """
+
+  return simulate_perf_cluster_alert_behaviour(alert_behaviour_properties, configurations)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/scripts/zookeeper_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/scripts/zookeeper_server.py
index 92519ba..6ab88bb 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/scripts/zookeeper_server.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/ZOOKEEPER/package/scripts/zookeeper_server.py
@@ -33,6 +33,10 @@ class ZookeeperServer(Dummy):
   def __init__(self):
     super(ZookeeperServer, self).__init__()
     self.component_name = "ZOOKEEPER_SERVER"
+    self.principal_conf_name = "zookeeper-env"
+    self.principal_name = "zookeeper_principal_name"
+    self.keytab_conf_name = "zookeeper-env"
+    self.keytab_name = "zookeeper_keytab_path"
 
 if __name__ == "__main__":
   ZookeeperServer().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/stacks/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/stack_advisor.py b/ambari-server/src/main/resources/stacks/stack_advisor.py
index f6191f8..8148379 100644
--- a/ambari-server/src/main/resources/stacks/stack_advisor.py
+++ b/ambari-server/src/main/resources/stacks/stack_advisor.py
@@ -972,6 +972,18 @@ class DefaultStackAdvisor(StackAdvisor):
       return None
     return siteConfig.get("properties")
 
+  def getServicesSiteProperties(self, services, siteName):
+    if not services:
+      return None
+
+    configurations = services.get("configurations")
+    if not configurations:
+      return None
+    siteConfig = configurations.get(siteName)
+    if siteConfig is None:
+      return None
+    return siteConfig.get("properties")
+
   def putProperty(self, config, configType, services=None):
     userConfigs = {}
     changedConfigs = []
@@ -1040,14 +1052,27 @@ class DefaultStackAdvisor(StackAdvisor):
       config[configType]["property_attributes"][key][attribute] = attributeValue if isinstance(attributeValue, list) else str(attributeValue)
     return appendPropertyAttribute
 
-
-  """
-  Returns the hosts which are running the given component.
-  """
   def getHosts(self, componentsList, componentName):
+    """
+    Returns the hosts which are running the given component.
+    """
     hostNamesList = [component["hostnames"] for component in componentsList if component["component_name"] == componentName]
     return hostNamesList[0] if len(hostNamesList) > 0 else []
 
+  def getMountPoints(self, hosts):
+    """
+    Return list of mounts available on the hosts
+
+    :type hosts dict
+    """
+    mount_points = []
+
+    for item in hosts["items"]:
+      if "disk_info" in item["Hosts"]:
+        mount_points.append(item["Hosts"]["disk_info"])
+
+    return mount_points
+
   def isSecurityEnabled(self, services):
     """
     Determines if security is enabled by testing the value of cluster-env/security enabled.
@@ -1084,3 +1109,179 @@ class DefaultStackAdvisor(StackAdvisor):
 
   def getServiceNames(self, services):
     return [service["StackServices"]["service_name"] for service in services["services"]]
+
+  def filterHostMounts(self, hosts, services):
+    """
+    Filter mounts on the host using agent_mounts_ignore_list, by excluding and record with mount-point
+     mentioned in agent_mounts_ignore_list.
+
+    This function updates hosts dictionary
+
+    Example:
+
+      agent_mounts_ignore_list : "/run/secrets"
+
+      Hosts record :
+
+       "disk_info" : [
+          {
+              ...
+            "mountpoint" : "/"
+          },
+          {
+              ...
+            "mountpoint" : "/run/secrets"
+          }
+        ]
+
+      Result would be :
+
+        "disk_info" : [
+          {
+              ...
+            "mountpoint" : "/"
+          }
+        ]
+
+    :type hosts dict
+    :type services dict
+    """
+    if not services or "items" not in hosts:
+      return hosts
+
+    banned_filesystems = ["devtmpfs", "tmpfs", "vboxsf", "cdfs"]
+    banned_mount_points = ["/etc/resolv.conf", "/etc/hostname", "/boot", "/mnt", "/tmp", "/run/secrets"]
+
+    cluster_env = self.getServicesSiteProperties(services, "cluster-env")
+    ignore_list = []
+
+    if cluster_env and "agent_mounts_ignore_list" in cluster_env and cluster_env["agent_mounts_ignore_list"].strip():
+      ignore_list = [x.strip() for x in cluster_env["agent_mounts_ignore_list"].strip().split(",")]
+
+    ignore_list.extend(banned_mount_points)
+
+    for host in hosts["items"]:
+      if "Hosts" not in host and "disk_info" not in host["Hosts"]:
+        continue
+
+      host = host["Hosts"]
+      disk_info = []
+
+      for disk in host["disk_info"]:
+        if disk["mountpoint"] not in ignore_list\
+          and disk["type"].lower() not in banned_filesystems:
+          disk_info.append(disk)
+
+      host["disk_info"] = disk_info
+
+    return hosts
+
+  def __getSameHostMounts(self, hosts):
+    """
+    Return list of the mounts which are same and present on all hosts
+
+    :type hosts dict
+    :rtype list
+    """
+    if not hosts:
+      return None
+
+    hostMounts = self.getMountPoints(hosts)
+    mounts = []
+    for m in hostMounts:
+      host_mounts = set([item["mountpoint"] for item in m])
+      mounts = host_mounts if not mounts else mounts & host_mounts
+
+    return sorted(mounts)
+
+  def getMountPathVariations(self, initial_value, component_name, services, hosts):
+    """
+    Recommends best fitted mount by prefixing path with it.
+
+    :return return list of paths with properly selected paths. If no recommendation possible,
+     would be returned empty list
+
+    :type initial_value str
+    :type component_name str
+    :type services dict
+    :type hosts dict
+    :rtype list
+    """
+    available_mounts = []
+
+    if not initial_value:
+      return available_mounts
+
+    mounts = self.__getSameHostMounts(hosts)
+    sep = "/"
+
+    if not mounts:
+      return available_mounts
+
+    for mount in mounts:
+      new_mount = initial_value if mount == "/" else os.path.join(mount + sep, initial_value.lstrip(sep))
+      if new_mount not in available_mounts:
+        available_mounts.append(new_mount)
+
+    # no list transformations after filling the list, because this will cause item order change
+    return available_mounts
+
+  def getMountPathVariation(self, initial_value, component_name, services, hosts):
+    """
+    Recommends best fitted mount by prefixing path with it.
+
+    :return return list of paths with properly selected paths. If no recommendation possible,
+     would be returned empty list
+
+    :type initial_value str
+        :type component_name str
+    :type services dict
+    :type hosts dict
+    :rtype str
+    """
+    try:
+      return [self.getMountPathVariations(initial_value, component_name, services, hosts)[0]]
+    except IndexError:
+      return []
+
+  def updateMountProperties(self, siteConfig, propertyDefinitions, configurations,  services, hosts):
+    """
+    Update properties according to recommendations for available mount-points
+
+    propertyDefinitions is an array of set : property name, component name, initial value, recommendation type
+
+     Where,
+
+       property name - name of the property
+       component name, name of the component to which belongs this property
+       initial value - initial path
+       recommendation type - could be "multi" or "single". This describes recommendation strategy, to use only one disk
+        or use all available space on the host
+
+    :type propertyDefinitions list
+    :type siteConfig str
+    :type configurations dict
+    :type services dict
+    :type hosts dict
+    """
+
+    props = self.getServicesSiteProperties(services, siteConfig)
+    put_f = self.putProperty(configurations, siteConfig, services)
+
+    for prop_item in propertyDefinitions:
+      name, component, default_value, rc_type = prop_item
+      recommendation = None
+
+      if props is None or name not in props:
+        if rc_type == "multi":
+          recommendation = self.getMountPathVariations(default_value, component, services, hosts)
+        else:
+          recommendation = self.getMountPathVariation(default_value, component, services, hosts)
+      elif props and name in props and props[name] == default_value:
+        if rc_type == "multi":
+          recommendation = self.getMountPathVariations(default_value, component, services, hosts)
+        else:
+          recommendation = self.getMountPathVariation(default_value, component, services, hosts)
+
+      if recommendation:
+        put_f(name, ",".join(recommendation))

http://git-wip-us.apache.org/repos/asf/ambari/blob/4278c4a4/ambari-server/src/main/resources/upgrade-pack.xsd
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/upgrade-pack.xsd b/ambari-server/src/main/resources/upgrade-pack.xsd
index 2871f05..aeec803 100644
--- a/ambari-server/src/main/resources/upgrade-pack.xsd
+++ b/ambari-server/src/main/resources/upgrade-pack.xsd
@@ -66,6 +66,11 @@
   <xs:simpleType name="config-condition-comparison-type">
     <xs:restriction base="xs:string">
       <xs:enumeration value="equals" />
+      <xs:enumeration value="not-equals" />
+      <xs:enumeration value="contains" />
+      <xs:enumeration value="not-contains" />
+      <xs:enumeration value="exists" />
+      <xs:enumeration value="not-exists" />
     </xs:restriction>
   </xs:simpleType>
   
@@ -76,7 +81,8 @@
       <xs:extension base="abstract-condition-type">  
         <xs:attribute name="type" type="xs:Name" use="required"/>
         <xs:attribute name="property" type="xs:Name" use="required"/>
-        <xs:attribute name="value" type="xs:string" use="required"/>
+        <xs:attribute name="value" type="xs:string" use="optional"/>
+        <xs:attribute name="return_value_if_config_missing" type="xs:boolean" use="optional"/>
         <xs:attribute name="comparison" type="config-condition-comparison-type" use="required"/>
       </xs:extension>
     </xs:complexContent>
@@ -392,7 +398,15 @@
         <xs:element name="type" type="upgrade-kind-type" />
         <xs:element name="prerequisite-checks" type="prerequisite-check-type" minOccurs="0" />
         <xs:element name="upgrade-path" type="upgrade-path-type" minOccurs="0" /> 
-        <xs:element name="order" type="order-type" />
+        <xs:element name="order" type="order-type">
+          <xs:unique name="unique-by-group">
+            <xs:annotation>
+              <xs:documentation>Ensures that the element "processing" does not have duplicate services</xs:documentation>
+            </xs:annotation>
+            <xs:selector xpath="group" />
+            <xs:field xpath="@name" />
+          </xs:unique>
+        </xs:element>
         <xs:element name="processing" type="processing-type">
           <xs:unique name="unique-by-service">
             <xs:annotation>