ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hurley" <jhur...@hortonworks.com>
Subject Re: Review Request 33660: Expose Customizable Parameters For SCRIPT Alerts
Date Wed, 29 Apr 2015 14:35:44 GMT


> On April 29, 2015, 9:47 a.m., Tom Beerbower wrote:
> > ambari-server/src/main/java/org/apache/ambari/server/state/alert/ScriptSource.java,
line 39
> > <https://reviews.apache.org/r/33660/diff/1/?file=944714#file944714line39>
> >
> >     I don't see where this list gets used anywhere?  Am I missing something?

Thanks for the review. That list is serialized via @SerializedName("parameters") so that the
resulting JSON includes the parameters.


- Jonathan


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


On April 29, 2015, 12:07 a.m., Jonathan Hurley wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/33660/
> -----------------------------------------------------------
> 
> (Updated April 29, 2015, 12:07 a.m.)
> 
> 
> Review request for Ambari, Nate Cole and Tom Beerbower.
> 
> 
> Bugs: AMBARI-10816
>     https://issues.apache.org/jira/browse/AMBARI-10816
> 
> 
> Repository: ambari
> 
> 
> Description
> -------
> 
> Ambari SCRIPT alerts currently do not expose any configurable properties or thresholds.

> 
> Example: Ability to customize "timeout=30" in the Hive Metastore Process alert
> 
> https://github.com/apache/ambari/blob/trunk/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py
> 
> {code:title=Parameters Defined In Definition JSON}
>       {
>         "name": "ambari_agent_disk_usage",
>         "label": "Ambari Agent Disk Usage",
>         "description": "This host-level alert is triggered if the amount of disk space
used on a host goes above specific thresholds. The default values are 50% for WARNING and
80% for CRITICAL.",
>         "interval": 1,
>         "scope": "HOST",
>         "enabled": true,
>         "source": {
>           "type": "SCRIPT",
>           "path": "alert_disk_space.py",
>           "parameters": [
>             {
>             "name": "minimum.free.space",
>             "display_name": "Minimum Free Space",
>             "value": 5000000000,
>             "type": "NUMERIC",
>             "description": "The overall amount of free disk space left before an alert
is triggered.",
>             "units": "bytes"
>             },
>             {
>             "name": "percent.used.space.warning.threshold",
>             "display_name": "Warning",
>             "value": 0.5,
>             "type": "PERCENT",
>             "description": "The percent of disk space consumed before a warning is triggered.",
>             "units": "%"
>             },
>             {
>             "name": "percent.free.space.critical.threshold",
>             "display_name": "Critical",
>             "value": 0.8,
>             "type": "PERCENT",
>             "description": "The percent of disk space consumed before a critical alert
is triggered.",
>             "units": "%"
>             }
>           ]
>         }
>       }
> {code}
> 
> {code:title=Definition Returned From API}
>       "AlertDefinition" : {
>         "cluster_name" : "c1",
>         "id" : 58,
>         "label" : "Ambari Agent Disk Usage",
>         "name" : "ambari_agent_disk_usage",
>         "source" : {
>           "parameters" : [
>             {
>               "display_name" : "Minimum Free Space",
>               "description" : "The overall amount of free disk space left before an alert
is triggered.",
>               "name" : "minimum.free.space",
>               "value" : "5.0E9",
>               "type" : "NUMERIC",
>               "units" : "bytes"
>             },
>             {
>               "display_name" : "Warning",
>               "description" : "The percent of disk space consumed before a warning is
triggered.",
>               "name" : "percent.used.space.warning.threshold",
>               "value" : "0.5",
>               "type" : "PERCENT",
>               "units" : "%"
>             },
>             {
>               "display_name" : "Critical",
>               "description" : "The percent of disk space consumed before a critical alert
is triggered.",
>               "name" : "percent.free.space.critical.threshold",
>               "value" : "0.8",
>               "type" : "PERCENT",
>               "units" : "%"
>             }
>           ],
>           "path" : "alert_disk_space.py",
>           "type" : "SCRIPT"
>         }
>       }
> {code}
> 
> 
> Diffs
> -----
> 
>   ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py d79e0a7 
>   ambari-agent/src/test/python/ambari_agent/TestAlerts.py a574422 
>   ambari-agent/src/test/python/ambari_agent/dummy_files/test_script.py 3598d86 
>   ambari-server/src/main/java/org/apache/ambari/server/state/alert/ScriptSource.java
4c84bcf 
>   ambari-server/src/main/resources/alerts.json 0d19f42 
>   ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/alerts/alert_ambari_metrics_monitor.py
04a2e01 
>   ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/alerts.json e23e77b

>   ambari-server/src/main/resources/common-services/FLUME/1.4.0.2.0/package/alerts/alert_flume_agent_status.py
b183bbc 
>   ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/alerts.json b67c306

>   ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py
2455d3b 
>   ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py
2066d46 
>   ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/alerts.json 9170b8f

>   ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py
9f871be 
>   ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py
3e32db9 
>   ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
dd20be4 
>   ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py
cbb6299 
>   ambari-server/src/main/resources/common-services/STORM/0.9.1.2.1/package/alerts/check_supervisor_process_win.py
dcae64a 
>   ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/alerts.json a446808

>   ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py
26bf2a0 
>   ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py
7c00625 
>   ambari-server/src/main/resources/host_scripts/alert_disk_space.py 68e22df 
>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/FLUME/alerts.json 3b117d0

>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/FLUME/package/files/alert_flume_agent_status.py
b183bbc 
>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/alerts.json 8e08ef2

>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/files/alert_checkpoint_time.py
2455d3b 
>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HDFS/package/files/alert_ha_namenode_health.py
2066d46 
>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/HIVE/package/files/alert_hive_thrift_port.py
2837226 
>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/OOZIE/package/files/alert_check_oozie_server.py
eaad265 
>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/WEBHCAT/package/files/alert_webhcat_server.py
dd20be4 
>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/alerts.json 94f0926

>   ambari-server/src/main/resources/stacks/BIGTOP/0.8/services/YARN/package/files/alert_nodemanager_health.py
516d858 
> 
> Diff: https://reviews.apache.org/r/33660/diff/
> 
> 
> Testing
> -------
> 
> Installed a full stack to verify script alerts still worked correctly.
> 
> [INFO] ------------------------------------------------------------------------
> [INFO] BUILD SUCCESS
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 24.293 s
> [INFO] Finished at: 2015-04-28T23:10:10-04:00
> [INFO] Final Memory: 9M/310M
> [INFO] ------------------------------------------------------------------------
> 
> 
> Thanks,
> 
> Jonathan Hurley
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message