Browse Source

AMBARI-11173 - Alerts: Expose Customizable Timeout Parameter For WEB Alerts (jonathanhurley)

Jonathan Hurley 10 năm trước cách đây
mục cha
commit
e5e1c3d797
17 tập tin đã thay đổi với 116 bổ sung34 xóa
  1. 12 3
      ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py
  2. 14 5
      ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
  3. 15 1
      ambari-agent/src/test/python/ambari_agent/TestAlerts.py
  4. 6 0
      ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
  5. 2 1
      ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/alerts.json
  6. 2 1
      ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
  7. 2 1
      ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/alerts.json
  8. 4 2
      ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/alerts.json
  9. 11 2
      ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
  10. 2 1
      ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
  11. 2 1
      ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
  12. 3 2
      ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/alerts.json
  13. 13 5
      ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/alerts.json
  14. 2 1
      ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HBASE/alerts.json
  15. 11 2
      ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
  16. 2 1
      ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
  17. 13 5
      ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/alerts.json

+ 12 - 3
ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py

@@ -31,13 +31,16 @@ from resource_management.libraries.functions.get_port_from_url import get_port_f
 
 logger = logging.getLogger()
 
-CONNECTION_TIMEOUT = 5.0
+# default timeout
+DEFAULT_CONNECTION_TIMEOUT = 5.0
 
 class MetricAlert(BaseAlert):
   
   def __init__(self, alert_meta, alert_source_meta):
     super(MetricAlert, self).__init__(alert_meta, alert_source_meta)
- 
+
+    connection_timeout = DEFAULT_CONNECTION_TIMEOUT
+
     self.metric_info = None    
     if 'jmx' in alert_source_meta:
       self.metric_info = JmxMetric(alert_source_meta['jmx'])
@@ -48,6 +51,12 @@ class MetricAlert(BaseAlert):
       uri = alert_source_meta['uri']
       self.uri_property_keys = self._lookup_uri_property_keys(uri)
 
+      if 'connection_timeout' in uri:
+        connection_timeout = uri['connection_timeout']
+
+    # python uses 5.0, not 5
+    self.connection_timeout = float(connection_timeout)
+
 
   def _collect(self):
     if self.metric_info is None:
@@ -159,7 +168,7 @@ class MetricAlert(BaseAlert):
       response = None
       try:
         url_opener = urllib2.build_opener(RefreshHeaderProcessor())
-        response = url_opener.open(url, timeout=CONNECTION_TIMEOUT)
+        response = url_opener.open(url, timeout=self.connection_timeout)
         content = response.read()
       finally:
         # explicitely close the connection as we've seen python hold onto these

+ 14 - 5
ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py

@@ -48,8 +48,8 @@ except ImportError:
 
 logger = logging.getLogger()
 
-CONNECTION_TIMEOUT = 10.0
-CURL_CONNECTION_TIMEOUT = "10"
+# default timeout
+DEFAULT_CONNECTION_TIMEOUT = 5
 
 WebResponse = namedtuple('WebResponse', 'status_code time_millis error_msg')
 
@@ -57,13 +57,22 @@ class WebAlert(BaseAlert):
 
   def __init__(self, alert_meta, alert_source_meta, config):
     super(WebAlert, self).__init__(alert_meta, alert_source_meta)
-    
+
+    connection_timeout = DEFAULT_CONNECTION_TIMEOUT
+
     # extract any lookup keys from the URI structure
     self.uri_property_keys = None
     if 'uri' in alert_source_meta:
       uri = alert_source_meta['uri']
       self.uri_property_keys = self._lookup_uri_property_keys(uri)
 
+      if 'connection_timeout' in uri:
+        connection_timeout = uri['connection_timeout']
+
+    # python uses 5.0, CURL uses "5"
+    self.connection_timeout = float(connection_timeout)
+    self.curl_connection_timeout = str(int(connection_timeout))
+
     self.config = config
 
 
@@ -203,7 +212,7 @@ class WebAlert(BaseAlert):
 
         try:
           curl = subprocess.Popen(['curl', '--negotiate', '-u', ':', '-b', cookie_file, '-c', cookie_file, '-sL', '-w',
-            '%{http_code}', url, '--connect-timeout', CURL_CONNECTION_TIMEOUT,
+            '%{http_code}', url, '--connect-timeout', self.curl_connection_timeout,
             '-o', '/dev/null'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=kerberos_env)
 
           curl_stdout, curl_stderr = curl.communicate()
@@ -246,7 +255,7 @@ class WebAlert(BaseAlert):
     start_time = time.time()
 
     try:
-      response = urllib2.urlopen(url, timeout=CONNECTION_TIMEOUT)
+      response = urllib2.urlopen(url, timeout=self.connection_timeout)
       response_code = response.getcode()
       time_millis = time.time() - start_time
 

+ 15 - 1
ambari-agent/src/test/python/ambari_agent/TestAlerts.py

@@ -956,6 +956,19 @@ class TestAlerts(TestCase):
     self.assertFalse(parent_mock.open.called)
 
 
+  def test_uri_timeout(self):
+    # the web alert will have a timeout value
+    definition_json = self._get_web_alert_definition()
+    alert = WebAlert(definition_json, definition_json['source'], None)
+    self.assertEquals(5.678, alert.connection_timeout)
+    self.assertEquals("5", alert.curl_connection_timeout)
+
+    # the metric definition will not and should default to 5.0
+    definition_json = self._get_metric_alert_definition()
+    alert = MetricAlert(definition_json, definition_json['source'])
+    self.assertEquals(5.0, alert.connection_timeout)
+
+
   def __get_cluster_configuration(self):
     """
     Gets an instance of the cluster cache where the file read and write
@@ -1113,7 +1126,8 @@ class TestAlerts(TestCase):
           "http": "{{hdfs-site/dfs.datanode.http.address}}",
           "https": "{{hdfs-site/dfs.datanode.https.address}}",
           "https_property": "{{hdfs-site/dfs.http.policy}}",
-          "https_property_value": "HTTPS_ONLY"
+          "https_property_value": "HTTPS_ONLY",
+          "connection_timeout": 5.678
         },
         "reporting": {
           "ok": {

+ 6 - 0
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java

@@ -74,6 +74,12 @@ public class AlertUri {
   @SerializedName("default_port")
   private int m_port = 0;
 
+  /**
+   * An optional timeout value for connections.
+   */
+  @SerializedName("connection_timeout")
+  private float m_connectionTimeout = 5.0f;
+
   /**
    * If present, then the component supports HA mode and the properties
    * contained within need to be checked to see if an HA URI is required to be

+ 2 - 1
ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/alerts.json

@@ -90,7 +90,8 @@
           "type": "METRIC",
           "uri": {
             "http": "{{ams-hbase-site/hbase.master.info.port}}",
-            "default_port": 61310
+            "default_port": 61310,
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 2 - 1
ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json

@@ -43,7 +43,8 @@
             "https_property_value": "true",
             "default_port": 21000,
             "kerberos_keytab": "{{application-properties/http_authentication_kerberos_keytab}}",
-            "kerberos_principal": "{{application-properties/http_authentication_kerberos_principal}}"
+            "kerberos_principal": "{{application-properties/http_authentication_kerberos_principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 2 - 1
ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/alerts.json

@@ -40,7 +40,8 @@
             "http": "{{falcon-env/falcon_port}}",
             "default_port": 15000,
             "kerberos_keytab": "{{falcon-startup.properties/*.falcon.http.authentication.kerberos.keytab}}",
-            "kerberos_principal": "{{falcon-startup.properties/*.falcon.http.authentication.kerberos.principal}}"
+            "kerberos_principal": "{{falcon-startup.properties/*.falcon.http.authentication.kerberos.principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 4 - 2
ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/alerts.json

@@ -64,7 +64,8 @@
           "type": "METRIC",
           "uri": {
             "http": "{{hbase-site/hbase.master.info.port}}",
-            "default_port": 60010
+            "default_port": 60010,
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -100,7 +101,8 @@
           "type": "METRIC",
           "uri": {
             "http": "{{hbase-site/hbase.master.info.port}}",
-            "default_port": 60010
+            "default_port": 60010,
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 11 - 2
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json

@@ -94,6 +94,7 @@
             "https_property_value": "HTTPS_ONLY",
             "kerberos_keytab": "{{hdfs-site/dfs.web.authentication.kerberos.keytab}}",
             "kerberos_principal": "{{hdfs-site/dfs.web.authentication.kerberos.principal}}",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -128,6 +129,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -172,6 +174,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -216,6 +219,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -260,6 +264,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -304,6 +309,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -347,6 +353,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -570,7 +577,8 @@
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
             "kerberos_keytab": "{{hdfs-site/dfs.web.authentication.kerberos.keytab}}",
-            "kerberos_principal": "{{hdfs-site/dfs.web.authentication.kerberos.principal}}"
+            "kerberos_principal": "{{hdfs-site/dfs.web.authentication.kerberos.principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -598,7 +606,8 @@
             "http": "{{hdfs-site/dfs.datanode.http.address}}",
             "https": "{{hdfs-site/dfs.datanode.https.address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
-            "https_property_value": "HTTPS_ONLY"
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 2 - 1
ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json

@@ -13,7 +13,8 @@
           "uri": {
             "http": "{{oozie-site/oozie.base.url}}/oozie/?user.name=oozie",
             "kerberos_keytab": "{{oozie-site/oozie.authentication.kerberos.keytab}}",
-            "kerberos_principal": "{{oozie-site/oozie.authentication.kerberos.principal}}"
+            "kerberos_principal": "{{oozie-site/oozie.authentication.kerberos.principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 2 - 1
ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json

@@ -13,7 +13,8 @@
           "uri": {
             "http": "{{oozie-site/oozie.base.url}}/oozie/?user.name=oozie",
             "kerberos_keytab": "{{oozie-site/oozie.authentication.kerberos.keytab}}",
-            "kerberos_principal": "{{oozie-site/oozie.authentication.kerberos.principal}}"
+            "kerberos_principal": "{{oozie-site/oozie.authentication.kerberos.principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 3 - 2
ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/alerts.json

@@ -62,8 +62,9 @@
           "type": "WEB",
           "uri": {
             "http": "{{storm-site/ui.port}}",
-           "kerberos_keytab": "{{storm-env/storm_ui_keytab}}",
-            "kerberos_principal": "{{storm-env/storm_ui_principal_name}}"
+            "kerberos_keytab": "{{storm-env/storm_ui_keytab}}",
+            "kerberos_principal": "{{storm-env/storm_ui_principal_name}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 13 - 5
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/alerts.json

@@ -16,7 +16,8 @@
             "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}}"
+            "kerberos_principal": "{{mapred-site/mapreduce.jobhistory.webapp.spnego-principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -44,7 +45,8 @@
             "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"
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -82,7 +84,8 @@
             "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"
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -179,7 +182,8 @@
             "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}}"
+            "kerberos_principal": "{{yarn-site/yarn.nodemanager.webapp.spnego-principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -234,6 +238,7 @@
             "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}}}}",
@@ -267,6 +272,7 @@
             "https": "{{yarn-site/yarn.resourcemanager.webapp.https.address}}",
             "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}}}}",
@@ -310,6 +316,7 @@
             "https": "{{yarn-site/yarn.resourcemanager.webapp.https.address}}",
             "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}}}}",
@@ -378,7 +385,8 @@
             "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}}"
+            "kerberos_principal": "{{yarn-site/yarn.timeline-service.http-authentication.kerberos.principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 2 - 1
ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HBASE/alerts.json

@@ -64,7 +64,8 @@
           "type": "METRIC",
           "uri": {
             "http": "{{hbase-site/hbase.master.info.port}}",
-            "default_port": 60010
+            "default_port": 60010,
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 11 - 2
ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json

@@ -94,6 +94,7 @@
             "https_property_value": "HTTPS_ONLY",
             "kerberos_keytab": "{{hdfs-site/dfs.web.authentication.kerberos.keytab}}",
             "kerberos_principal": "{{hdfs-site/dfs.web.authentication.kerberos.principal}}",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -128,6 +129,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -172,6 +174,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -216,6 +219,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -260,6 +264,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -304,6 +309,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -347,6 +353,7 @@
             "https": "{{hdfs-site/dfs.namenode.https-address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0,
             "high_availability": {
               "nameservice": "{{hdfs-site/dfs.nameservices}}",
               "alias_key" : "{{hdfs-site/dfs.ha.namenodes.{{ha-nameservice}}}}",
@@ -542,7 +549,8 @@
             "https_property": "{{hdfs-site/dfs.http.policy}}",
             "https_property_value": "HTTPS_ONLY",
             "kerberos_keytab": "{{hdfs-site/dfs.web.authentication.kerberos.keytab}}",
-            "kerberos_principal": "{{hdfs-site/dfs.web.authentication.kerberos.principal}}"
+            "kerberos_principal": "{{hdfs-site/dfs.web.authentication.kerberos.principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -570,7 +578,8 @@
             "http": "{{hdfs-site/dfs.datanode.http.address}}",
             "https": "{{hdfs-site/dfs.datanode.https.address}}",
             "https_property": "{{hdfs-site/dfs.http.policy}}",
-            "https_property_value": "HTTPS_ONLY"
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 2 - 1
ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json

@@ -11,7 +11,8 @@
         "source": {
           "type": "WEB",
           "uri": {
-            "http": "{{oozie-site/oozie.base.url}}/oozie"
+            "http": "{{oozie-site/oozie.base.url}}/oozie",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {

+ 13 - 5
ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/alerts.json

@@ -16,7 +16,8 @@
             "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}}"
+            "kerberos_principal": "{{mapred-site/mapreduce.jobhistory.webapp.spnego-principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -44,7 +45,8 @@
             "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"
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -82,7 +84,8 @@
             "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"
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -179,7 +182,8 @@
             "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}}"
+            "kerberos_principal": "{{yarn-site/yarn.nodemanager.webapp.spnego-principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {
@@ -234,6 +238,7 @@
             "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}}}}",
@@ -267,6 +272,7 @@
             "https": "{{yarn-site/yarn.resourcemanager.webapp.https.address}}",
             "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}}}}",
@@ -310,6 +316,7 @@
             "https": "{{yarn-site/yarn.resourcemanager.webapp.https.address}}",
             "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}}}}",
@@ -355,7 +362,8 @@
             "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}}"
+            "kerberos_principal": "{{yarn-site/yarn.timeline-service.http-authentication.kerberos.principal}}",
+            "connection_timeout": 5.0
           },
           "reporting": {
             "ok": {