ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gau...@apache.org
Subject [2/2] ambari git commit: AMBARI-17771. Update alert definition for Ranger Admin after kerberos changes(gautam)
Date Tue, 26 Jul 2016 17:21:36 GMT
AMBARI-17771. Update alert definition for Ranger Admin after kerberos changes(gautam)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/5ebb04a2
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5ebb04a2
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5ebb04a2

Branch: refs/heads/trunk
Commit: 5ebb04a2e9da16c694622354dcb8a5a749f0b0f6
Parents: c52d3d6
Author: Gautam Borad <gautam@apache.org>
Authored: Tue Jul 26 19:58:30 2016 +0530
Committer: Gautam Borad <gautam@apache.org>
Committed: Tue Jul 26 22:51:24 2016 +0530

----------------------------------------------------------------------
 .../upgrades/RangerWebAlertConfigAction.java    | 130 ++++++++++++++++
 .../common-services/RANGER/0.6.0/alerts.json    |   4 +-
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml |   4 +
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml     |   1 +
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml |   4 +
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml     |   1 +
 .../RangerWebAlertConfigActionTest.java         | 153 +++++++++++++++++++
 .../HDP/2.5.0/services/RANGER/alerts.json       |  74 +++++++++
 8 files changed, 369 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5ebb04a2/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerWebAlertConfigAction.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerWebAlertConfigAction.java
b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerWebAlertConfigAction.java
new file mode 100644
index 0000000..31c11bd
--- /dev/null
+++ b/ambari-server/src/main/java/org/apache/ambari/server/serveraction/upgrades/RangerWebAlertConfigAction.java
@@ -0,0 +1,130 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.serveraction.upgrades;
+
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
+import com.google.inject.Inject;
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.actionmanager.HostRoleStatus;
+import org.apache.ambari.server.agent.CommandReport;
+import org.apache.ambari.server.events.AlertHashInvalidationEvent;
+import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
+import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
+import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
+import org.apache.ambari.server.serveraction.AbstractServerAction;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.alert.AlertDefinitionHash;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.ConcurrentMap;
+
+/**
+ * This class is used to update Ranger service alert-check configs in Ambari
+ */
+public class RangerWebAlertConfigAction extends AbstractServerAction {
+
+
+  @Inject
+  Clusters m_clusters;
+
+  @Inject
+  AlertDefinitionDAO alertDefinitionDAO;
+
+  @Inject
+  AlertDefinitionHash alertDefinitionHash;
+
+  @Inject
+  AmbariEventPublisher eventPublisher;
+
+
+  private Logger logger = LoggerFactory.getLogger(RangerWebAlertConfigAction.class);
+
+
+  /**
+   * @param requestSharedDataContext a Map to be used a shared data among all ServerActions
related
+   *                                 to a given request
+   * @return
+   * @throws AmbariException
+   * @throws InterruptedException
+   */
+  @Override
+  public CommandReport execute(ConcurrentMap<String, Object> requestSharedDataContext)
+      throws AmbariException, InterruptedException {
+    String clusterName = getExecutionCommand().getClusterName();
+    Cluster cluster = m_clusters.getCluster(clusterName);
+
+    String ranger_admin_process = "ranger_admin_process";
+
+    try {
+
+      AlertDefinitionEntity rangerAlertDefinitionEntity = alertDefinitionDAO.findByName(cluster.getClusterId(),
ranger_admin_process);
+      if (rangerAlertDefinitionEntity != null) {
+
+        logger.info("Updating the alert definition for ranger_admin_process.");
+
+        String rangerAlertCurrentDefinitionSource = rangerAlertDefinitionEntity.getSource();
+        JsonObject rangerAlertsCurrentDefinitionJSON = new JsonParser().parse(rangerAlertCurrentDefinitionSource).getAsJsonObject();
+
+        //updating the alert definition
+        rangerAlertsCurrentDefinitionJSON.remove("uri");
+
+        JsonObject rangerUpdatedURLConfig = new JsonObject();
+        rangerUpdatedURLConfig.addProperty("http", "{{admin-properties/policymgr_external_url}}/login.jsp");
+        rangerUpdatedURLConfig.addProperty("https", "{{admin-properties/policymgr_external_url}}/login.jsp");
+        rangerUpdatedURLConfig.addProperty("kerberos_keytab", "{{cluster-env/smokeuser_keytab}}");
+        rangerUpdatedURLConfig.addProperty("kerberos_principal", "{{cluster-env/smokeuser_principal_name}}");
+        rangerUpdatedURLConfig.addProperty("https_property", "{{ranger-admin-site/ranger.service.https.attrib.ssl.enabled}}");
+        rangerUpdatedURLConfig.addProperty("https_property_value", "true");
+        rangerUpdatedURLConfig.addProperty("connection_timeout", 5.0);
+
+        rangerAlertsCurrentDefinitionJSON.add("uri", rangerUpdatedURLConfig);
+
+        rangerAlertDefinitionEntity.setHash(UUID.randomUUID().toString());
+        rangerAlertDefinitionEntity.setSource(rangerAlertsCurrentDefinitionJSON.toString());
+
+        alertDefinitionDAO.merge(rangerAlertDefinitionEntity);
+
+        // invalidating alert and publishing the updated definition
+        Set<String> invalidatedHosts = alertDefinitionHash.invalidateHosts(rangerAlertDefinitionEntity);
+        AlertHashInvalidationEvent alertInvalidationEvent = new AlertHashInvalidationEvent(
+            rangerAlertDefinitionEntity.getClusterId(), invalidatedHosts);
+
+        eventPublisher.publish(alertInvalidationEvent);
+
+        return createCommandReport(0, HostRoleStatus.COMPLETED, "{}",
+            "Ranger service alert check configuration has been updated successfully.", "");
+
+      } else {
+        return createCommandReport(0, HostRoleStatus.COMPLETED, "{}",
+            String.format(
+                "The %s configuration type was not found; unable to update Ranger Alert properties.",
+                ranger_admin_process), "");
+      }
+    } catch (Exception e) {
+      logger.error("RangerWebAlertConfigAction.execute : There was an error in updating Ranger
alerts.", e);
+    }
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ebb04a2/ambari-server/src/main/resources/common-services/RANGER/0.6.0/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.6.0/alerts.json b/ambari-server/src/main/resources/common-services/RANGER/0.6.0/alerts.json
index 0bced55..ab473a8 100644
--- a/ambari-server/src/main/resources/common-services/RANGER/0.6.0/alerts.json
+++ b/ambari-server/src/main/resources/common-services/RANGER/0.6.0/alerts.json
@@ -13,8 +13,8 @@
           "uri": {
               "http": "{{admin-properties/policymgr_external_url}}/login.jsp",
               "https": "{{admin-properties/policymgr_external_url}}/login.jsp",
-              "kerberos_keytab": "{{ranger-admin-site/ranger.spnego.kerberos.keytab}}",
-              "kerberos_principal": "{{ranger-admin-site/ranger.spnego.kerberos.principal}}",
+              "kerberos_keytab": "{{cluster-env/smokeuser_keytab}}",
+              "kerberos_principal": "{{cluster-env/smokeuser_principal_name}}",
               "https_property": "{{ranger-admin-site/ranger.service.https.attrib.ssl.enabled}}",
               "https_property_value": "true",
               "connection_timeout": 5.0

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ebb04a2/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
index a1b93e3..8529d03 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
@@ -377,6 +377,10 @@
         <task xsi:type="server_action" summary="Calculating Ranger Properties" class="org.apache.ambari.server.serveraction.upgrades.RangerKerberosConfigCalculation"/>
       </execute-stage>
 
+      <execute-stage service="RANGER" component="RANGER_ADMIN" title="Configuring Ranger
Alerts">
+        <task xsi:type="server_action" summary="Configuring Ranger Alerts" class="org.apache.ambari.server.serveraction.upgrades.RangerWebAlertConfigAction"/>
+      </execute-stage>
+
       <!-- RANGER KMS -->
       <execute-stage service="RANGER_KMS" component="RANGER_KMS_SERVER" title="Apply config
changes for Ranger KMS Server">
         <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_kms_audit_db"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ebb04a2/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
index 96b1400..dd39237 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
@@ -549,6 +549,7 @@
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_sso_property" />
 
           <task xsi:type="server_action" summary="Calculating Ranger Properties" class="org.apache.ambari.server.serveraction.upgrades.RangerKerberosConfigCalculation"/>
+          <task xsi:type="server_action" summary="Configuring Ranger Alerts" class="org.apache.ambari.server.serveraction.upgrades.RangerWebAlertConfigAction"/>
 
           <task xsi:type="execute" hosts="all">
             <script>scripts/ranger_admin.py</script>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ebb04a2/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
index 86e0964..d9711f4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
@@ -317,6 +317,10 @@
         <task xsi:type="server_action" summary="Calculating Ranger Properties" class="org.apache.ambari.server.serveraction.upgrades.RangerKerberosConfigCalculation"/>
       </execute-stage>
 
+      <execute-stage service="RANGER" component="RANGER_ADMIN" title="Configuring Ranger
Alerts">
+        <task xsi:type="server_action" summary="Configuring Ranger Alerts" class="org.apache.ambari.server.serveraction.upgrades.RangerWebAlertConfigAction"/>
+      </execute-stage>
+
       <!-- HDFS -->
       <execute-stage service="HDFS" component="NAMENODE" title="Apply config changes for
Hdfs Namenode HA">
         <task xsi:type="configure" id="hdp_2_5_0_0_namenode_ha_adjustments"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ebb04a2/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
index 2099958..ea82e93 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
@@ -544,6 +544,7 @@
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_sso_property" />
 
           <task xsi:type="server_action" summary="Calculating Ranger Properties" class="org.apache.ambari.server.serveraction.upgrades.RangerKerberosConfigCalculation"/>
+          <task xsi:type="server_action" summary="Configuring Ranger Alerts" class="org.apache.ambari.server.serveraction.upgrades.RangerWebAlertConfigAction"/>
 
           <task xsi:type="execute" hosts="all">
             <script>scripts/ranger_admin.py</script>

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ebb04a2/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerWebAlertConfigActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerWebAlertConfigActionTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerWebAlertConfigActionTest.java
new file mode 100644
index 0000000..b66e97c
--- /dev/null
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/RangerWebAlertConfigActionTest.java
@@ -0,0 +1,153 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.server.serveraction.upgrades;
+
+
+import com.google.inject.Inject;
+import junit.framework.Assert;
+import org.apache.ambari.server.actionmanager.ExecutionCommandWrapper;
+import org.apache.ambari.server.actionmanager.HostRoleCommand;
+import org.apache.ambari.server.actionmanager.HostRoleStatus;
+import org.apache.ambari.server.agent.CommandReport;
+import org.apache.ambari.server.agent.ExecutionCommand;
+import org.apache.ambari.server.events.publishers.AmbariEventPublisher;
+import org.apache.ambari.server.orm.dao.AlertDefinitionDAO;
+import org.apache.ambari.server.orm.entities.AlertDefinitionEntity;
+import org.apache.ambari.server.state.Cluster;
+import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.alert.AlertDefinitionHash;
+import org.easymock.EasyMock;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mockito;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.io.File;
+import java.lang.reflect.Field;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Scanner;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+
+
+/**
+ * Test for @link RangerWebAlertConfigAction to ensure
+ * ranger service alert configs are updated.
+ */
+@RunWith(MockitoJUnitRunner.class)
+public class RangerWebAlertConfigActionTest {
+
+
+  private RangerWebAlertConfigAction rangerWebAlertConfigAction;
+  private Clusters m_clusters;
+  private AlertDefinitionDAO alertDefinitionDAO;
+  private AlertDefinitionEntity alertDefinitionEntity;
+  private AlertDefinitionHash alertDefinitionHash;
+  private AmbariEventPublisher eventPublisher;
+
+
+
+  @Before
+  public void setup() throws Exception {
+    alertDefinitionDAO = Mockito.mock(AlertDefinitionDAO.class);
+    alertDefinitionEntity = Mockito.mock(AlertDefinitionEntity.class);
+    alertDefinitionHash = Mockito.mock(AlertDefinitionHash.class);
+    eventPublisher = Mockito.mock(AmbariEventPublisher.class);
+    m_clusters = Mockito.mock(Clusters.class);
+    rangerWebAlertConfigAction = new RangerWebAlertConfigAction();
+  }
+
+  @Test
+  public void testExecute() throws Exception {
+
+    String CLUSTER_NAME = "cl1";
+    String RANGER_ADMIN_PROCESS = "ranger_admin_process";
+    String pathname = "src/test/resources/stacks/HDP/2.5.0/services/RANGER/alerts.json";
+
+    Cluster cluster = Mockito.mock(Cluster.class);
+
+    Mockito.when(m_clusters.getCluster(Mockito.anyString())).thenReturn(cluster);
+    Mockito.when(cluster.getClusterId()).thenReturn(1L);
+
+    Map<String, String> commandParams = new HashMap<String, String>();
+    commandParams.put("clusterName", CLUSTER_NAME);
+
+
+    ExecutionCommand m_executionCommand = new ExecutionCommand();
+    m_executionCommand.setCommandParams(commandParams);
+    m_executionCommand.setClusterName(CLUSTER_NAME);
+
+    HostRoleCommand hrc = EasyMock.createMock(HostRoleCommand.class);
+    expect(hrc.getRequestId()).andReturn(1L).anyTimes();
+    expect(hrc.getStageId()).andReturn(2L).anyTimes();
+    expect(hrc.getExecutionCommandWrapper()).andReturn(new ExecutionCommandWrapper(m_executionCommand)).anyTimes();
+    replay(hrc);
+
+    Mockito.when(alertDefinitionDAO.findByName(1L, RANGER_ADMIN_PROCESS)).thenReturn(alertDefinitionEntity);
+
+
+    try {
+
+      File alertsFile = new File(pathname);
+      Assert.assertTrue(alertsFile.exists());
+
+      StringBuilder rangerAlertsConfigFile = new StringBuilder((int) alertsFile.length());
+      Scanner scanner = new Scanner(alertsFile);
+      String lineSeparator = System.getProperty("line.separator");
+
+      try {
+        while (scanner.hasNextLine()) {
+          rangerAlertsConfigFile.append(scanner.nextLine() + lineSeparator);
+        }
+        Mockito.when(alertDefinitionEntity.getSource()).thenReturn(rangerAlertsConfigFile.toString());
+      } finally {
+        scanner.close();
+      }
+    } catch (Exception e) {
+
+      e.printStackTrace();
+    }
+
+    rangerWebAlertConfigAction.alertDefinitionDAO = alertDefinitionDAO;
+    rangerWebAlertConfigAction.m_clusters = m_clusters;
+    rangerWebAlertConfigAction.alertDefinitionHash = alertDefinitionHash;
+    rangerWebAlertConfigAction.eventPublisher = eventPublisher;
+
+    rangerWebAlertConfigAction.setExecutionCommand(m_executionCommand);
+    rangerWebAlertConfigAction.setHostRoleCommand(hrc);
+
+    ConcurrentMap<String, Object> requestSharedDataContext = new ConcurrentHashMap<String,
Object>();
+    CommandReport commandReport = null;
+    try {
+      commandReport = rangerWebAlertConfigAction.execute(requestSharedDataContext);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+
+    Assert.assertNotNull(commandReport);
+    Assert.assertEquals(0, commandReport.getExitCode());
+    Assert.assertEquals(HostRoleStatus.COMPLETED.toString(), commandReport.getStatus());
+    Assert.assertEquals("Ranger service alert check configuration has been updated successfully.",
commandReport.getStdOut());
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ebb04a2/ambari-server/src/test/resources/stacks/HDP/2.5.0/services/RANGER/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/resources/stacks/HDP/2.5.0/services/RANGER/alerts.json
b/ambari-server/src/test/resources/stacks/HDP/2.5.0/services/RANGER/alerts.json
new file mode 100644
index 0000000..182a06c
--- /dev/null
+++ b/ambari-server/src/test/resources/stacks/HDP/2.5.0/services/RANGER/alerts.json
@@ -0,0 +1,74 @@
+{
+  "RANGER": {
+    "service": [],
+    "RANGER_ADMIN": [
+      {
+        "name": "ranger_admin_process",
+        "label": "Ranger Admin Process",
+        "description": "This host-level alert is triggered if the Ranger Admin Web UI is
unreachable.",
+        "interval": 1,
+        "scope": "ANY",
+        "source": {
+          "type": "WEB",
+          "uri": {
+              "http": "{{admin-properties/policymgr_external_url}}",
+              "https": "{{admin-properties/policymgr_external_url}}",
+              "https_property": "{{ranger-admin-site/ranger.service.https.attrib.ssl.enabled}}",
+              "https_property_value": "true",
+              "connection_timeout": 5.0
+            },
+          "reporting": {
+            "ok": {
+              "text": "HTTP {0} response in {2:.3f}s"
+            },
+            "warning": {
+              "text": "HTTP {0} response from {1} in {2:.3f}s ({3})"
+            },
+            "critical": {
+              "text": "Connection failed to {1} ({3})"
+            }
+          }
+        }
+      },
+      {
+        "name": "ranger_admin_password_check",
+        "label": "Ranger Admin password check",
+        "description": "This alert is used to ensure that the Ranger Admin password in Ambari
is correct.",
+        "interval": 30,
+        "scope": "ANY",
+        "source": {
+          "type": "SCRIPT",
+          "path": "RANGER/0.4.0/package/alerts/alert_ranger_admin_passwd_check.py",
+          "parameters": []
+        }
+      }
+    ],
+    "RANGER_USERSYNC": [
+      {
+        "name": "ranger_usersync_process",
+        "label": "Ranger Usersync Process",
+        "description": "This host-level alert is triggered if the Ranger Usersync cannot
be determined to be up.",
+        "interval": 1,
+        "scope": "HOST",
+        "source": {
+          "type": "PORT",
+          "uri": "{{ranger-ugsync-site/ranger.usersync.port}}",
+          "default_port": 5151,
+          "reporting": {
+            "ok": {
+              "text": "TCP OK - {0:.3f}s response on port {1}"
+            },
+            "warning": {
+              "text": "TCP OK - {0:.3f}s response on port {1}",
+              "value": 1.5
+            },
+            "critical": {
+              "text": "Connection failed: {0} to {1}:{2}",
+              "value": 5.0
+            }
+          }
+        }
+      }
+    ]
+  }
+}
\ No newline at end of file


Mime
View raw message