소스 검색

AMBARI-9392. Oozie HA: no critical alert if at least one oozie-server is started.(vbrodetskyi)

Vitaly Brodetskyi 10 년 전
부모
커밋
fd06b4f929
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py

+ 4 - 0
ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/alerts/alert_check_oozie_server.py

@@ -22,6 +22,8 @@ from resource_management import *
 from resource_management.libraries.functions import format
 from resource_management.libraries.functions import get_kinit_path
 from resource_management.core.environment import Environment
+from ambari_commons.os_check import OSConst, OSCheck
+from urlparse import urlparse
 
 RESULT_CODE_OK = 'OK'
 RESULT_CODE_CRITICAL = 'CRITICAL'
@@ -54,6 +56,8 @@ def execute(parameters=None, host_name=None):
   security_enabled = False
   if set([OOZIE_URL_KEY, SMOKEUSER_KEY, SECURITY_ENABLED]).issubset(parameters):
     oozie_url = parameters[OOZIE_URL_KEY]
+    localhost_address = 'localhost' if OSCheck.get_os_family() == OSConst.WINSRV_FAMILY else '0.0.0.0'
+    oozie_url = oozie_url.replace(urlparse(oozie_url).hostname,localhost_address)
     smokeuser = parameters[SMOKEUSER_KEY]
     security_enabled = str(parameters[SECURITY_ENABLED]).upper() == 'TRUE'
   else: