Re: Review Request 62744: Alerts for OneFS mpack

2017-10-12 Thread Jonathan Hurley

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review187778
---


Ship it!




Ship It!

- Jonathan Hurley


On Oct. 12, 2017, 7:39 a.m., Attila Magyar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> ---
> 
> (Updated Oct. 12, 2017, 7:39 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
> https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -
> 
>   ambari-server/docs/configuration/index.md 9dbe9c4 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
>  1b4d741 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
>  968e9b6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
>  11eee05 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
>  d3237a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/5/
> 
> 
> Testing
> ---
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
> "service": [
>   { 
> "name": "onefs_namenode_cpu",
> "label": "OneFS NameNode Host CPU Utilization",
> "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
> "interval": 1,
> "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
> "scope": "HOST",
> "enabled": true,
> "source": {
>   "type": "SERVER",
>   "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
>   "uri": {
> "http": "${hdfs-site/dfs.namenode.http-address}",
> "https": "${hdfs-site/dfs.namenode.https-address}",
> "https_property": "${hdfs-site/dfs.http.policy}",
> "https_property_value": "HTTPS_ONLY",
> "connection_timeout": 5.0
>   },
>   "reporting": {
> "ok": {
>   "text": "{1} CPU, load {0,number,percent}"
> },
> "warning": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 5
> },
> "critical": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 20
> },
> "units" : "%",
> "type": "PERCENT"
>},
>"jmx": {
>  "property_list": [
>   "java.lang:type=OperatingSystem/SystemCpuLoad",
>   "java.lang:type=OperatingSystem/AvailableProcessors"
>  ]
>}
>   }
>   }
> ]
>   }
> }
> 1,1   Top
> 
> 
> Thanks,
> 
> Attila Magyar
> 
>



Re: Review Request 62744: Alerts for OneFS mpack

2017-10-12 Thread Sebastian Toader

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review187773
---


Ship it!




Ship It!

- Sebastian Toader


On Oct. 12, 2017, 1:39 p.m., Attila Magyar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> ---
> 
> (Updated Oct. 12, 2017, 1:39 p.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
> https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -
> 
>   ambari-server/docs/configuration/index.md 9dbe9c4 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
>  1b4d741 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
>  968e9b6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
>  11eee05 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
>  d3237a9 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/5/
> 
> 
> Testing
> ---
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
> "service": [
>   { 
> "name": "onefs_namenode_cpu",
> "label": "OneFS NameNode Host CPU Utilization",
> "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
> "interval": 1,
> "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
> "scope": "HOST",
> "enabled": true,
> "source": {
>   "type": "SERVER",
>   "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
>   "uri": {
> "http": "${hdfs-site/dfs.namenode.http-address}",
> "https": "${hdfs-site/dfs.namenode.https-address}",
> "https_property": "${hdfs-site/dfs.http.policy}",
> "https_property_value": "HTTPS_ONLY",
> "connection_timeout": 5.0
>   },
>   "reporting": {
> "ok": {
>   "text": "{1} CPU, load {0,number,percent}"
> },
> "warning": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 5
> },
> "critical": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 20
> },
> "units" : "%",
> "type": "PERCENT"
>},
>"jmx": {
>  "property_list": [
>   "java.lang:type=OperatingSystem/SystemCpuLoad",
>   "java.lang:type=OperatingSystem/AvailableProcessors"
>  ]
>}
>   }
>   }
> ]
>   }
> }
> 1,1   Top
> 
> 
> Thanks,
> 
> Attila Magyar
> 
>



Re: Review Request 62744: Alerts for OneFS mpack

2017-10-12 Thread Attila Magyar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/
---

(Updated Oct. 12, 2017, 11:39 a.m.)


Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.


Changes
---

configurable thread pool size


Bugs: AMBARI-22115
https://issues.apache.org/jira/browse/AMBARI-22115


Repository: ambari


Description
---

This is part of AMBARI-22115. We need to define alerts on JMX metrics which are 
pulled from a cluster that is not necessarily managed by Ambari. Therefore 
alerts can't run on ambari-agent host. I introduced a new SERVER type alert 
called JmxServerSideAlert that can pull the jmx metrics from a arbitrary url. 
The url comes from the alerts.json and it may contain placeholders like 
${hdfs-site/dfs.namenode.http-address}. This works similarly than the Python 
class MetricAlert.


Diffs (updated)
-

  ambari-server/docs/configuration/index.md 9dbe9c4 
  
ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/configuration/Configuration.java
 1b4d741 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
 968e9b6 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
 81d72fb 
  ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 5d2ecc6 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java 
93801d5 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
 11eee05 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java 
4aeba45 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
 c58867a 
  
ambari-server/src/main/java/org/apache/ambari/server/state/services/AmbariServerAlertService.java
 d3237a9 
  
ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java 
PRE-CREATION 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
 PRE-CREATION 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
 PRE-CREATION 


Diff: https://reviews.apache.org/r/62744/diff/5/

Changes: https://reviews.apache.org/r/62744/diff/4-5/


Testing
---

Used the following alerts.json to test it

{   
  "ONEFS":{
"service": [
  { 
"name": "onefs_namenode_cpu",
"label": "OneFS NameNode Host CPU Utilization",
"description": "This host-level alert is triggered if CPU utilization 
of the NameNode exceeds certain warning and critical thresholds. It checks the 
NameNode JMX Servlet for the SystemCPULoad property. The threshold values are 
in percent.",
"interval": 1,
"help_url": 
"https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
"scope": "HOST",
"enabled": true,
"source": {
  "type": "SERVER",
  "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
  "uri": {
"http": "${hdfs-site/dfs.namenode.http-address}",
"https": "${hdfs-site/dfs.namenode.https-address}",
"https_property": "${hdfs-site/dfs.http.policy}",
"https_property_value": "HTTPS_ONLY",
"connection_timeout": 5.0
  },
  "reporting": {
"ok": {
  "text": "{1} CPU, load {0,number,percent}"
},
"warning": {
  "text": "{1} CPU, load {0,number,percent}",
  "value": 5
},
"critical": {
  "text": "{1} CPU, load {0,number,percent}",
  "value": 20
},
"units" : "%",
"type": "PERCENT"
   },
   "jmx": {
 "property_list": [
  "java.lang:type=OperatingSystem/SystemCpuLoad",
  "java.lang:type=OperatingSystem/AvailableProcessors"
 ]
   }
  }
  }
]
  }
}
1,1   Top


Thanks,

Attila Magyar



Re: Review Request 62744: Alerts for OneFS mpack

2017-10-04 Thread Jonathan Hurley

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review187100
---



As part of this review, I think we need to change how the 
AmbariServerAlertService creates its threadpool for the AlertRunnables:


  /**
   * The executor to use to run all {@link Runnable} alert classes.
   */
  private final ScheduledExecutorService m_scheduledExecutorService = 
Executors.newScheduledThreadPool(3);


Can you convert this into a configuration property? With the ability to add 
Server-side alerts, we need this thread pool to be bigger.

- Jonathan Hurley


On Oct. 4, 2017, 4:16 a.m., Attila Magyar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> ---
> 
> (Updated Oct. 4, 2017, 4:16 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
> https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
>  11eee05 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/4/
> 
> 
> Testing
> ---
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
> "service": [
>   { 
> "name": "onefs_namenode_cpu",
> "label": "OneFS NameNode Host CPU Utilization",
> "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
> "interval": 1,
> "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
> "scope": "HOST",
> "enabled": true,
> "source": {
>   "type": "SERVER",
>   "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
>   "uri": {
> "http": "${hdfs-site/dfs.namenode.http-address}",
> "https": "${hdfs-site/dfs.namenode.https-address}",
> "https_property": "${hdfs-site/dfs.http.policy}",
> "https_property_value": "HTTPS_ONLY",
> "connection_timeout": 5.0
>   },
>   "reporting": {
> "ok": {
>   "text": "{1} CPU, load {0,number,percent}"
> },
> "warning": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 5
> },
> "critical": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 20
> },
> "units" : "%",
> "type": "PERCENT"
>},
>"jmx": {
>  "property_list": [
>   "java.lang:type=OperatingSystem/SystemCpuLoad",
>   "java.lang:type=OperatingSystem/AvailableProcessors"
>  ]
>}
>   }
>   }
> ]
>   }
> }
> 1,1   Top
> 
> 
> Thanks,
> 
> Attila Magyar
> 
>



Re: Review Request 62744: Alerts for OneFS mpack

2017-10-04 Thread Attila Magyar


> On Oct. 3, 2017, 5:34 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
> > Lines 20-21 (patched)
> > 
> >
> > This is a funny looking import.  Use java.util.Collections directly.
> 
> Attila Magyar wrote:
> is there a particular reason for this or just aesthetics?

I've just realized what you meant, misunderstood your comment at first. Fixed 
the import.


- Attila


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review186980
---


On Oct. 4, 2017, 8:16 a.m., Attila Magyar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> ---
> 
> (Updated Oct. 4, 2017, 8:16 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
> https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
>  11eee05 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/3/
> 
> 
> Testing
> ---
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
> "service": [
>   { 
> "name": "onefs_namenode_cpu",
> "label": "OneFS NameNode Host CPU Utilization",
> "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
> "interval": 1,
> "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
> "scope": "HOST",
> "enabled": true,
> "source": {
>   "type": "SERVER",
>   "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
>   "uri": {
> "http": "${hdfs-site/dfs.namenode.http-address}",
> "https": "${hdfs-site/dfs.namenode.https-address}",
> "https_property": "${hdfs-site/dfs.http.policy}",
> "https_property_value": "HTTPS_ONLY",
> "connection_timeout": 5.0
>   },
>   "reporting": {
> "ok": {
>   "text": "{1} CPU, load {0,number,percent}"
> },
> "warning": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 5
> },
> "critical": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 20
> },
> "units" : "%",
> "type": "PERCENT"
>},
>"jmx": {
>  "property_list": [
>   "java.lang:type=OperatingSystem/SystemCpuLoad",
>   "java.lang:type=OperatingSystem/AvailableProcessors"
>  ]
>}
>   }
>   }
> ]
>   }
> }
> 1,1   Top
> 
> 
> Thanks,
> 
> Attila Magyar
> 
>



Re: Review Request 62744: Alerts for OneFS mpack

2017-10-04 Thread Attila Magyar


> On Oct. 3, 2017, 11:48 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
> > Lines 83 (patched)
> > 
> >
> > It's interesting to use the MetricsRetrievalService here. This service 
> > was created for use with the web client since it polls every few seconds. 
> > We figured it's better to respond quickly with metric data that migth be a 
> > few seconds old.
> > 
> > In this case, the alert only runs once every X minutes, so it's going 
> > to always be working with data that was retrieved X minutes ago. 
> > 
> > Is that the desired behavior?

Is there any other service that can provide real time data or should I write my 
own?


> On Oct. 3, 2017, 11:48 p.m., Jonathan Hurley wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
> > Lines 225-231 (patched)
> > 
> >
> > Do you need to worry about the SKIPPED state here?

I don't think skipped alerts will reach that point, but I added a case to 
handle them gracefully.


- Attila


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review187025
---


On Oct. 4, 2017, 8:16 a.m., Attila Magyar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> ---
> 
> (Updated Oct. 4, 2017, 8:16 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
> https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
>  11eee05 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/2/
> 
> 
> Testing
> ---
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
> "service": [
>   { 
> "name": "onefs_namenode_cpu",
> "label": "OneFS NameNode Host CPU Utilization",
> "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
> "interval": 1,
> "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
> "scope": "HOST",
> "enabled": true,
> "source": {
>   "type": "SERVER",
>   "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
>   "uri": {
> "http": "${hdfs-site/dfs.namenode.http-address}",
> "https": "${hdfs-site/dfs.namenode.https-address}",
> "https_property": "${hdfs-site/dfs.http.policy}",
> "https_property_value": "HTTPS_ONLY",
> "connection_timeout": 5.0
>   },
>   "reporting": {
> "ok": {
>   "text": "{1} CPU, load {0,number,percent}"
> },
> 

Re: Review Request 62744: Alerts for OneFS mpack

2017-10-04 Thread Attila Magyar


> On Oct. 3, 2017, 5:34 p.m., Nate Cole wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
> > Lines 20-21 (patched)
> > 
> >
> > This is a funny looking import.  Use java.util.Collections directly.

is there a particular reason for this or just aesthetics?


- Attila


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review186980
---


On Oct. 4, 2017, 8:16 a.m., Attila Magyar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> ---
> 
> (Updated Oct. 4, 2017, 8:16 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
> https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
>  11eee05 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/2/
> 
> 
> Testing
> ---
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
> "service": [
>   { 
> "name": "onefs_namenode_cpu",
> "label": "OneFS NameNode Host CPU Utilization",
> "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
> "interval": 1,
> "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
> "scope": "HOST",
> "enabled": true,
> "source": {
>   "type": "SERVER",
>   "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
>   "uri": {
> "http": "${hdfs-site/dfs.namenode.http-address}",
> "https": "${hdfs-site/dfs.namenode.https-address}",
> "https_property": "${hdfs-site/dfs.http.policy}",
> "https_property_value": "HTTPS_ONLY",
> "connection_timeout": 5.0
>   },
>   "reporting": {
> "ok": {
>   "text": "{1} CPU, load {0,number,percent}"
> },
> "warning": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 5
> },
> "critical": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 20
> },
> "units" : "%",
> "type": "PERCENT"
>},
>"jmx": {
>  "property_list": [
>   "java.lang:type=OperatingSystem/SystemCpuLoad",
>   "java.lang:type=OperatingSystem/AvailableProcessors"
>  ]
>}
>   }
>   }
> ]
>   }
> }
> 1,1   Top
> 
> 
> Thanks,
> 
> Attila Magyar
> 
>



Re: Review Request 62744: Alerts for OneFS mpack

2017-10-04 Thread Attila Magyar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/
---

(Updated Oct. 4, 2017, 8:16 a.m.)


Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.


Changes
---

address some reviewer comments


Bugs: AMBARI-22115
https://issues.apache.org/jira/browse/AMBARI-22115


Repository: ambari


Description
---

This is part of AMBARI-22115. We need to define alerts on JMX metrics which are 
pulled from a cluster that is not necessarily managed by Ambari. Therefore 
alerts can't run on ambari-agent host. I introduced a new SERVER type alert 
called JmxServerSideAlert that can pull the jmx metrics from a arbitrary url. 
The url comes from the alerts.json and it may contain placeholders like 
${hdfs-site/dfs.namenode.http-address}. This works similarly than the Python 
class MetricAlert.


Diffs (updated)
-

  
ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
 81d72fb 
  ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 5d2ecc6 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java 
93801d5 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/MetricSource.java
 11eee05 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java 
4aeba45 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
 c58867a 
  
ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java 
PRE-CREATION 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
 PRE-CREATION 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
 PRE-CREATION 


Diff: https://reviews.apache.org/r/62744/diff/2/

Changes: https://reviews.apache.org/r/62744/diff/1-2/


Testing
---

Used the following alerts.json to test it

{   
  "ONEFS":{
"service": [
  { 
"name": "onefs_namenode_cpu",
"label": "OneFS NameNode Host CPU Utilization",
"description": "This host-level alert is triggered if CPU utilization 
of the NameNode exceeds certain warning and critical thresholds. It checks the 
NameNode JMX Servlet for the SystemCPULoad property. The threshold values are 
in percent.",
"interval": 1,
"help_url": 
"https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
"scope": "HOST",
"enabled": true,
"source": {
  "type": "SERVER",
  "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
  "uri": {
"http": "${hdfs-site/dfs.namenode.http-address}",
"https": "${hdfs-site/dfs.namenode.https-address}",
"https_property": "${hdfs-site/dfs.http.policy}",
"https_property_value": "HTTPS_ONLY",
"connection_timeout": 5.0
  },
  "reporting": {
"ok": {
  "text": "{1} CPU, load {0,number,percent}"
},
"warning": {
  "text": "{1} CPU, load {0,number,percent}",
  "value": 5
},
"critical": {
  "text": "{1} CPU, load {0,number,percent}",
  "value": 20
},
"units" : "%",
"type": "PERCENT"
   },
   "jmx": {
 "property_list": [
  "java.lang:type=OperatingSystem/SystemCpuLoad",
  "java.lang:type=OperatingSystem/AvailableProcessors"
 ]
   }
  }
  }
]
  }
}
1,1   Top


Thanks,

Attila Magyar



Re: Review Request 62744: Alerts for OneFS mpack

2017-10-03 Thread Jonathan Hurley

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review187025
---




ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 52 (patched)


This should be configurable via the definiion.



ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 73 (patched)


/jmx should probably be parameterized? Or just make as part of the URI on 
the definition.



ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 80 (patched)


Documentation.



ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 83 (patched)


It's interesting to use the MetricsRetrievalService here. This service was 
created for use with the web client since it polls every few seconds. We 
figured it's better to respond quickly with metric data that migth be a few 
seconds old.

In this case, the alert only runs once every X minutes, so it's going to 
always be working with data that was retrieved X minutes ago. 

Is that the desired behavior?



ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 86 (patched)


Documentation.



ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
Lines 211 (patched)


Documentation.

Also - maybe call this something like `buildAlert` or `getAlert` to follow 
Java convention.



ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
Lines 225-231 (patched)


Do you need to worry about the SKIPPED state here?


- Jonathan Hurley


On Oct. 3, 2017, 7:01 a.m., Attila Magyar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> ---
> 
> (Updated Oct. 3, 2017, 7:01 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
> https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/1/
> 
> 
> Testing
> ---
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
> "service": [
>   { 
> "name": "onefs_namenode_cpu",
> "label": "OneFS NameNode Host CPU Utilization",
> "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
> "interval": 1,
> "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
> "scope": "HOST",
> "enabled": true,
> 

Re: Review Request 62744: Alerts for OneFS mpack

2017-10-03 Thread Nate Cole

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/#review186980
---


Fix it, then Ship it!





ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 20-21 (patched)


This is a funny looking import.  Use java.util.Collections directly.



ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
Lines 53-55 (patched)


nit: formatting; @Inject usually goes on its own line



ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java
Lines 24-25 (patched)


javadoc would be helpful



ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
Lines 227-231 (patched)


nit: formatting is a bit off


- Nate Cole


On Oct. 3, 2017, 7:01 a.m., Attila Magyar wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/62744/
> ---
> 
> (Updated Oct. 3, 2017, 7:01 a.m.)
> 
> 
> Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.
> 
> 
> Bugs: AMBARI-22115
> https://issues.apache.org/jira/browse/AMBARI-22115
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> This is part of AMBARI-22115. We need to define alerts on JMX metrics which 
> are pulled from a cluster that is not necessarily managed by Ambari. 
> Therefore alerts can't run on ambari-agent host. I introduced a new SERVER 
> type alert called JmxServerSideAlert that can pull the jmx metrics from a 
> arbitrary url. The url comes from the alerts.json and it may contain 
> placeholders like ${hdfs-site/dfs.namenode.http-address}. This works 
> similarly than the Python class MetricAlert.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
>  PRE-CREATION 
>   ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
> PRE-CREATION 
>   
> ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
>  81d72fb 
>   ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 
> 5d2ecc6 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java
>  93801d5 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
>  4aeba45 
>   
> ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
>  c58867a 
>   
> ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
>  PRE-CREATION 
>   
> ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
>  PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/62744/diff/1/
> 
> 
> Testing
> ---
> 
> Used the following alerts.json to test it
> 
> {   
>   "ONEFS":{
> "service": [
>   { 
> "name": "onefs_namenode_cpu",
> "label": "OneFS NameNode Host CPU Utilization",
> "description": "This host-level alert is triggered if CPU utilization 
> of the NameNode exceeds certain warning and critical thresholds. It checks 
> the NameNode JMX Servlet for the SystemCPULoad property. The threshold values 
> are in percent.",
> "interval": 1,
> "help_url": 
> "https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
> "scope": "HOST",
> "enabled": true,
> "source": {
>   "type": "SERVER",
>   "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
>   "uri": {
> "http": "${hdfs-site/dfs.namenode.http-address}",
> "https": "${hdfs-site/dfs.namenode.https-address}",
> "https_property": "${hdfs-site/dfs.http.policy}",
> "https_property_value": "HTTPS_ONLY",
> "connection_timeout": 5.0
>   },
>   "reporting": {
> "ok": {
>   "text": "{1} CPU, load {0,number,percent}"
> },
> "warning": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 5
> },
> "critical": {
>   "text": "{1} CPU, load {0,number,percent}",
>   "value": 20
> },
> "units" : "%",
> "type": "PERCENT"
>},
>"jmx": {
>  "property_list": [
>   "java.lang:type=OperatingSystem/SystemCpuLoad",
>   

Review Request 62744: Alerts for OneFS mpack

2017-10-03 Thread Attila Magyar

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/62744/
---

Review request for Ambari, Jonathan Hurley, Nate Cole, and Sebastian Toader.


Bugs: AMBARI-22115
https://issues.apache.org/jira/browse/AMBARI-22115


Repository: ambari


Description
---

This is part of AMBARI-22115. We need to define alerts on JMX metrics which are 
pulled from a cluster that is not necessarily managed by Ambari. Therefore 
alerts can't run on ambari-agent host. I introduced a new SERVER type alert 
called JmxServerSideAlert that can pull the jmx metrics from a arbitrary url. 
The url comes from the alerts.json and it may contain placeholders like 
${hdfs-site/dfs.namenode.http-address}. This works similarly than the Python 
class MetricAlert.


Diffs
-

  
ambari-server/src/main/java/org/apache/ambari/server/alerts/JmxServerSideAlert.java
 PRE-CREATION 
  ambari-server/src/main/java/org/apache/ambari/server/alerts/Threshold.java 
PRE-CREATION 
  
ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
 81d72fb 
  ambari-server/src/main/java/org/apache/ambari/server/state/Alert.java 5d2ecc6 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/AlertUri.java 
93801d5 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java 
4aeba45 
  
ambari-server/src/main/java/org/apache/ambari/server/state/alert/ServerSource.java
 c58867a 
  
ambari-server/src/test/java/org/apache/ambari/server/alerts/ThresholdTest.java 
PRE-CREATION 
  
ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
 PRE-CREATION 
  
ambari-server/src/test/java/org/apache/ambari/server/state/alert/AlertUriTest.java
 PRE-CREATION 


Diff: https://reviews.apache.org/r/62744/diff/1/


Testing
---

Used the following alerts.json to test it

{   
  "ONEFS":{
"service": [
  { 
"name": "onefs_namenode_cpu",
"label": "OneFS NameNode Host CPU Utilization",
"description": "This host-level alert is triggered if CPU utilization 
of the NameNode exceeds certain warning and critical thresholds. It checks the 
NameNode JMX Servlet for the SystemCPULoad property. The threshold values are 
in percent.",
"interval": 1,
"help_url": 
"https://cwiki.apache.org/confluence/display/AMBARI/Ambari+Alerts#AmbariAlerts-ambari_agent_heartbeat;,
"scope": "HOST",
"enabled": true,
"source": {
  "type": "SERVER",
  "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
  "uri": {
"http": "${hdfs-site/dfs.namenode.http-address}",
"https": "${hdfs-site/dfs.namenode.https-address}",
"https_property": "${hdfs-site/dfs.http.policy}",
"https_property_value": "HTTPS_ONLY",
"connection_timeout": 5.0
  },
  "reporting": {
"ok": {
  "text": "{1} CPU, load {0,number,percent}"
},
"warning": {
  "text": "{1} CPU, load {0,number,percent}",
  "value": 5
},
"critical": {
  "text": "{1} CPU, load {0,number,percent}",
  "value": 20
},
"units" : "%",
"type": "PERCENT"
   },
   "jmx": {
 "property_list": [
  "java.lang:type=OperatingSystem/SystemCpuLoad",
  "java.lang:type=OperatingSystem/AvailableProcessors"
 ]
   }
  }
  }
]
  }
}
1,1   Top


Thanks,

Attila Magyar