Repository: ambari
Updated Branches:
  refs/heads/trunk 7e4f57b16 -> e5e1c3d79


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


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e5e1c3d7
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e5e1c3d7
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e5e1c3d7

Branch: refs/heads/trunk
Commit: e5e1c3d79773027ba7fa39fccb84083dd080c6ef
Parents: 7e4f57b
Author: Jonathan Hurley <jhur...@hortonworks.com>
Authored: Fri May 15 11:59:21 2015 -0400
Committer: Jonathan Hurley <jhur...@hortonworks.com>
Committed: Fri May 15 21:13:52 2015 -0400

----------------------------------------------------------------------
 .../python/ambari_agent/alerts/metric_alert.py   | 15 ++++++++++++---
 .../main/python/ambari_agent/alerts/web_alert.py | 19 ++++++++++++++-----
 .../src/test/python/ambari_agent/TestAlerts.py   | 16 +++++++++++++++-
 .../ambari/server/state/alert/AlertUri.java      |  6 ++++++
 .../AMBARI_METRICS/0.1.0/alerts.json             |  3 ++-
 .../common-services/ATLAS/0.1.0.2.3/alerts.json  |  3 ++-
 .../common-services/FALCON/0.5.0.2.1/alerts.json |  3 ++-
 .../common-services/HBASE/0.96.0.2.0/alerts.json |  6 ++++--
 .../common-services/HDFS/2.1.0.2.0/alerts.json   | 13 +++++++++++--
 .../common-services/OOZIE/4.0.0.2.0/alerts.json  |  3 ++-
 .../common-services/OOZIE/5.0.0.2.3/alerts.json  |  3 ++-
 .../common-services/STORM/0.9.1.2.1/alerts.json  |  5 +++--
 .../common-services/YARN/2.1.0.2.0/alerts.json   | 18 +++++++++++++-----
 .../stacks/BIGTOP/0.8/services/HBASE/alerts.json |  3 ++-
 .../stacks/BIGTOP/0.8/services/HDFS/alerts.json  | 13 +++++++++++--
 .../stacks/BIGTOP/0.8/services/OOZIE/alerts.json |  3 ++-
 .../stacks/BIGTOP/0.8/services/YARN/alerts.json  | 18 +++++++++++++-----
 17 files changed, 116 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py 
b/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py
index 33f7508..a50b202 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/metric_alert.py
+++ b/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

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py 
b/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
index a2e3326..34e25e0 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/web_alert.py
+++ b/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
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-agent/src/test/python/ambari_agent/TestAlerts.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestAlerts.py 
b/ambari-agent/src/test/python/ambari_agent/TestAlerts.py
index af357bc..6bdb945 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestAlerts.py
+++ b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
index d4fb416..c337dec 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
@@ -75,6 +75,12 @@ public class AlertUri {
   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
    * constructed instead of using {@link #m_httpProperty} and

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/alerts.json
 
b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/alerts.json
index 2f543ef..319427d 100644
--- 
a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json 
b/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
index 5c4c06e..95d8295 100644
--- 
a/ambari-server/src/main/resources/common-services/ATLAS/0.1.0.2.3/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/alerts.json 
b/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/alerts.json
index cd1bd73..e504664 100644
--- 
a/ambari-server/src/main/resources/common-services/FALCON/0.5.0.2.1/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/alerts.json 
b/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/alerts.json
index d10897a..0b5d853 100644
--- 
a/ambari-server/src/main/resources/common-services/HBASE/0.96.0.2.0/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json 
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
index 9502e14..cd7f31e 100644
--- 
a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json 
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
index 78e5142..a14f782 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json 
b/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
index 4bfae15..d75d1b2 100644
--- 
a/ambari-server/src/main/resources/common-services/OOZIE/5.0.0.2.3/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/alerts.json 
b/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/alerts.json
index d6f569b..f25d29b 100644
--- 
a/ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/alerts.json 
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/alerts.json
index d25dd78..db6d73d 100644
--- 
a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HBASE/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HBASE/alerts.json 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HBASE/alerts.json
index 07a8cff..8cce671 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HBASE/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
index c0b9b0b..84f74a4 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
index f13bb63..e57a4f8 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/alerts.json
+++ 
b/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": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5e1c3d7/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/alerts.json
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/alerts.json 
b/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/alerts.json
index fa1e20a..f79fa51 100644
--- 
a/ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/alerts.json
+++ 
b/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": {

Reply via email to