You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ambari.apache.org by Dmytro Sen <ds...@hortonworks.com> on 2015/11/16 17:03:23 UTC
Review Request 40352: Add error logs to script alerts when there are
failures
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/
-----------------------------------------------------------
Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
Bugs: AMBARI-13905
https://issues.apache.org/jira/browse/AMBARI-13905
Repository: ambari
Description
-------
In general, the script alerts need logging to cover error scenarios.
For example:
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
json_response = json.loads(stdout)
except Exception, exception:
return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
Diffs
-----
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
Diff: https://reviews.apache.org/r/40352/diff/
Testing
-------
Unit tests passed
Thanks,
Dmytro Sen
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/#review106675
-----------------------------------------------------------
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py (line 203)
<https://reviews.apache.org/r/40352/#comment165417>
That would be nice to add tracebacks to the error messages as well, so we can quickly diagnose those via UI as well as via logs.
- Andrew Onischuk
On Nov. 16, 2015, 4:03 p.m., Dmytro Sen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40352/
> -----------------------------------------------------------
>
> (Updated Nov. 16, 2015, 4:03 p.m.)
>
>
> Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
>
>
> Bugs: AMBARI-13905
> https://issues.apache.org/jira/browse/AMBARI-13905
>
>
> Repository: ambari
>
>
> Description
> -------
>
> In general, the script alerts need logging to cover error scenarios.
> For example:
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
> json_response = json.loads(stdout)
> except Exception, exception:
> return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
> If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
> Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
>
>
> Diffs
> -----
>
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
>
> Diff: https://reviews.apache.org/r/40352/diff/
>
>
> Testing
> -------
>
> Unit tests passed
>
>
> Thanks,
>
> Dmytro Sen
>
>
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/#review106876
-----------------------------------------------------------
Ship it!
Ship It!
- Andrew Onischuk
On Nov. 17, 2015, 4 p.m., Dmytro Sen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40352/
> -----------------------------------------------------------
>
> (Updated Nov. 17, 2015, 4 p.m.)
>
>
> Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
>
>
> Bugs: AMBARI-13905
> https://issues.apache.org/jira/browse/AMBARI-13905
>
>
> Repository: ambari
>
>
> Description
> -------
>
> In general, the script alerts need logging to cover error scenarios.
> For example:
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
> json_response = json.loads(stdout)
> except Exception, exception:
> return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
> If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
> Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
>
>
> Diffs
> -----
>
> ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
>
> Diff: https://reviews.apache.org/r/40352/diff/
>
>
> Testing
> -------
>
> Unit tests passed
>
>
> Thanks,
>
> Dmytro Sen
>
>
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/#review107031
-----------------------------------------------------------
Ship it!
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py (line 187)
<https://reviews.apache.org/r/40352/#comment165929>
I don't think you need to encapsulate the `format_exc` in a `str()` as it's already a string:
traceback.format_exc([limit])
This is like print_exc(limit) but returns a string instead of printing to a file.
- Jonathan Hurley
On Nov. 18, 2015, 9:12 a.m., Dmytro Sen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40352/
> -----------------------------------------------------------
>
> (Updated Nov. 18, 2015, 9:12 a.m.)
>
>
> Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
>
>
> Bugs: AMBARI-13905
> https://issues.apache.org/jira/browse/AMBARI-13905
>
>
> Repository: ambari
>
>
> Description
> -------
>
> In general, the script alerts need logging to cover error scenarios.
> For example:
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
> json_response = json.loads(stdout)
> except Exception, exception:
> return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
> If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
> Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
>
>
> Diffs
> -----
>
> ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
>
> Diff: https://reviews.apache.org/r/40352/diff/
>
>
> Testing
> -------
>
> Unit tests passed
>
>
> Thanks,
>
> Dmytro Sen
>
>
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Andrew Onischuk <ao...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/#review107038
-----------------------------------------------------------
Ship it!
Ship It!
- Andrew Onischuk
On Nov. 18, 2015, 3:17 p.m., Dmytro Sen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40352/
> -----------------------------------------------------------
>
> (Updated Nov. 18, 2015, 3:17 p.m.)
>
>
> Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
>
>
> Bugs: AMBARI-13905
> https://issues.apache.org/jira/browse/AMBARI-13905
>
>
> Repository: ambari
>
>
> Description
> -------
>
> In general, the script alerts need logging to cover error scenarios.
> For example:
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
> json_response = json.loads(stdout)
> except Exception, exception:
> return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
> If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
> Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
>
>
> Diffs
> -----
>
> ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
>
> Diff: https://reviews.apache.org/r/40352/diff/
>
>
> Testing
> -------
>
> Unit tests passed
>
>
> Thanks,
>
> Dmytro Sen
>
>
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/#review107035
-----------------------------------------------------------
Ship it!
Ship It!
- Jonathan Hurley
On Nov. 18, 2015, 10:17 a.m., Dmytro Sen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40352/
> -----------------------------------------------------------
>
> (Updated Nov. 18, 2015, 10:17 a.m.)
>
>
> Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
>
>
> Bugs: AMBARI-13905
> https://issues.apache.org/jira/browse/AMBARI-13905
>
>
> Repository: ambari
>
>
> Description
> -------
>
> In general, the script alerts need logging to cover error scenarios.
> For example:
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
> json_response = json.loads(stdout)
> except Exception, exception:
> return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
> If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
> Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
>
>
> Diffs
> -----
>
> ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
>
> Diff: https://reviews.apache.org/r/40352/diff/
>
>
> Testing
> -------
>
> Unit tests passed
>
>
> Thanks,
>
> Dmytro Sen
>
>
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Dmytro Sen <ds...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/
-----------------------------------------------------------
(Updated Ноя. 18, 2015, 3:17 п.п.)
Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
Bugs: AMBARI-13905
https://issues.apache.org/jira/browse/AMBARI-13905
Repository: ambari
Description
-------
In general, the script alerts need logging to cover error scenarios.
For example:
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
json_response = json.loads(stdout)
except Exception, exception:
return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
Diffs (updated)
-----
ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
Diff: https://reviews.apache.org/r/40352/diff/
Testing
-------
Unit tests passed
Thanks,
Dmytro Sen
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Dmytro Sen <ds...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/
-----------------------------------------------------------
(Updated Ноя. 18, 2015, 2:12 п.п.)
Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
Bugs: AMBARI-13905
https://issues.apache.org/jira/browse/AMBARI-13905
Repository: ambari
Description
-------
In general, the script alerts need logging to cover error scenarios.
For example:
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
json_response = json.loads(stdout)
except Exception, exception:
return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
Diffs (updated)
-----
ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
Diff: https://reviews.apache.org/r/40352/diff/
Testing
-------
Unit tests passed
Thanks,
Dmytro Sen
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Jonathan Hurley <jh...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/#review106923
-----------------------------------------------------------
Ship it!
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py (line 141)
<https://reviews.apache.org/r/40352/#comment165725>
We can get rid of `e` right?
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py (line 246)
<https://reviews.apache.org/r/40352/#comment165727>
So, previously you set the label to str(traceback.format_ecs()), but here you just log the exception and keep str(e) as the label. Was this intentional?
- Jonathan Hurley
On Nov. 17, 2015, 11 a.m., Dmytro Sen wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40352/
> -----------------------------------------------------------
>
> (Updated Nov. 17, 2015, 11 a.m.)
>
>
> Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
>
>
> Bugs: AMBARI-13905
> https://issues.apache.org/jira/browse/AMBARI-13905
>
>
> Repository: ambari
>
>
> Description
> -------
>
> In general, the script alerts need logging to cover error scenarios.
> For example:
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
> json_response = json.loads(stdout)
> except Exception, exception:
> return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
> If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
> Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
>
>
> Diffs
> -----
>
> ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
> ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
> ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
> ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
>
> Diff: https://reviews.apache.org/r/40352/diff/
>
>
> Testing
> -------
>
> Unit tests passed
>
>
> Thanks,
>
> Dmytro Sen
>
>
Re: Review Request 40352: Add error logs to script alerts when there
are failures
Posted by Dmytro Sen <ds...@hortonworks.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40352/
-----------------------------------------------------------
(Updated Ноя. 17, 2015, 4 п.п.)
Review request for Ambari, Andrew Onischuk and Sumit Mohanty.
Bugs: AMBARI-13905
https://issues.apache.org/jira/browse/AMBARI-13905
Repository: ambari
Description
-------
In general, the script alerts need logging to cover error scenarios.
For example:
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py
json_response = json.loads(stdout)
except Exception, exception:
return (RESULT_CODE_CRITICAL, [str(exception) + str(stdout)])
If the response is not a valid JSON Ambari should log the content rather than just reporting that json could not be parsed through the alert text.
Similar enhancements may be needed in several script based alerts. At least, lets cover all the three alert scripts that are in HIVE.
Diffs (updated)
-----
ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py 97c3b64
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_checkpoint_time.py 548a838
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_ha_namenode_health.py bfc518f
ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/alerts/alert_upgrade_finalized.py be72327
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_metastore.py 7f23d31
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_hive_thrift_port.py 8d8bd58
ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/alerts/alert_webhcat_server.py 2c44b36
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py 912969a
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanagers_summary.py 11f29fd
Diff: https://reviews.apache.org/r/40352/diff/
Testing
-------
Unit tests passed
Thanks,
Dmytro Sen