浏览代码

AMBARI-10608. Alerts: nodemanager health is critical, response is not clear (dlysnichenko)

Lisnichenko Dmitro 10 年之前
父节点
当前提交
4e06a89f86

+ 4 - 0
ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/alerts/alert_nodemanager_health.py

@@ -122,6 +122,7 @@ def execute(parameters=None, host_name=None):
   try:
     json_response = json.loads(url_response.read())
     node_healthy = json_response['nodeInfo']['nodeHealthy']
+    node_healthy_report = json_response['nodeInfo']['healthReport']
 
     # convert boolean to string
     node_healthy = str(node_healthy)
@@ -138,6 +139,9 @@ def execute(parameters=None, host_name=None):
   if node_healthy.lower() == 'true':
     result_code = RESULT_CODE_OK
     label = OK_MESSAGE
+  elif node_healthy.lower() == 'false':
+    result_code = RESULT_CODE_CRITICAL
+    label = node_healthy_report
   else:
     result_code = RESULT_CODE_CRITICAL
     label = CRITICAL_NODEMANAGER_STATUS_MESSAGE.format(node_healthy)