AMBARI-22339. Metrics for OneFS mpack (amagyar)

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

Branch: refs/heads/branch-feature-AMBARI-22008-isilon
Commit: 95c46db09861f0a9aa978b77da0ab9b5e2559bdd
Parents: 80af28e
Author: Attila Magyar <amag...@hortonworks.com>
Authored: Mon Nov 6 10:48:44 2017 +0100
Committer: Attila Magyar <amag...@hortonworks.com>
Committed: Fri Dec 22 09:57:59 2017 +0100

----------------------------------------------------------------------
 .../internal/OverriddenMetricsHostProvider.java | 101 +++++++++++++++++++
 .../internal/StackDefinedPropertyProvider.java  |   9 +-
 .../controller/metrics/MetricHostProvider.java  |   9 ++
 .../timeline/AMSComponentPropertyProvider.java  |   4 +-
 .../ambari/server/state/ConfigHelper.java       |   5 +
 .../server/state/stack/MetricDefinition.java    |   9 +-
 .../OverriddenMetricsHostProviderTest.java      |  95 +++++++++++++++++
 .../addon-services/ONEFS/1.0.0/metrics.json     |  13 ++-
 .../addon-services/ONEFS/1.0.0/widgets.json     |  65 +++---------
 9 files changed, 254 insertions(+), 56 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
new file mode 100644
index 0000000..cb59b2f
--- /dev/null
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProvider.java
@@ -0,0 +1,101 @@
+/*
+ * 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.controller.internal;
+
+import java.net.URI;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.ambari.server.AmbariException;
+import org.apache.ambari.server.controller.metrics.MetricHostProvider;
+import org.apache.ambari.server.controller.metrics.MetricsServiceProvider;
+import org.apache.ambari.server.controller.spi.SystemException;
+import org.apache.ambari.server.state.ConfigHelper;
+import org.apache.ambari.server.state.kerberos.VariableReplacementHelper;
+
+/**
+ * I'm a special {@link MetricHostProvider} that can override default 
component host names.
+ */
+public class OverriddenMetricsHostProvider implements MetricHostProvider {
+  private final Map<String, String> overriddenHosts;
+  private final MetricHostProvider metricHostProvider;
+  private final ConfigHelper configHelper;
+  private final VariableReplacementHelper variableReplacer = new 
VariableReplacementHelper();
+
+  public OverriddenMetricsHostProvider(Map<String, String> overriddenHosts, 
MetricHostProvider metricHostProvider, ConfigHelper configHelper) {
+    this.overriddenHosts = overriddenHosts;
+    this.metricHostProvider = metricHostProvider;
+    this.configHelper = configHelper;
+  }
+
+  @Override
+  public Optional<String> getExternalHostName(String clusterName, String 
componentName) {
+    return getOverriddenHost(componentName).map(host -> 
replaceVariables(clusterName, host));
+  }
+
+  private Optional<String> getOverriddenHost(String componentName) {
+    return Optional.ofNullable(overriddenHosts.get(componentName));
+  }
+
+  private String replaceVariables(String clusterName, String hostName) {
+    try {
+      return hostName(variableReplacer.replaceVariables(hostName, 
config(clusterName)));
+    } catch (AmbariException e) {
+      throw new RuntimeException(e);
+    }
+  }
+
+  private Map<String, Map<String, String>> config(String clusterName) throws 
AmbariException {
+    return configHelper.getEffectiveConfigProperties(clusterName, null);
+  }
+
+  private String hostName(String resolvedHost) throws AmbariException {
+    return hasScheme(resolvedHost)
+      ? URI.create(resolvedHost).getHost()
+      : URI.create("any://" + resolvedHost).getHost();
+  }
+
+  private boolean hasScheme(String host) {
+    return host.contains("://");
+  }
+
+  @Override
+  public String getHostName(String clusterName, String componentName) throws 
SystemException {
+    return metricHostProvider.getHostName(clusterName, componentName);
+  }
+
+  @Override
+  public String getCollectorHostName(String clusterName, 
MetricsServiceProvider.MetricsService service) throws SystemException {
+    return metricHostProvider.getCollectorHostName(clusterName, service);
+  }
+
+  @Override
+  public String getCollectorPort(String clusterName, 
MetricsServiceProvider.MetricsService service) throws SystemException {
+    return metricHostProvider.getCollectorPort(clusterName, service);
+  }
+
+  @Override
+  public boolean isCollectorHostLive(String clusterName, 
MetricsServiceProvider.MetricsService service) throws SystemException {
+    return metricHostProvider.isCollectorHostLive(clusterName, service);
+  }
+
+  @Override
+  public boolean isCollectorComponentLive(String clusterName, 
MetricsServiceProvider.MetricsService service) throws SystemException {
+    return metricHostProvider.isCollectorComponentLive(clusterName, service);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
index 8c2198b..861007b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/StackDefinedPropertyProvider.java
@@ -47,6 +47,7 @@ import 
org.apache.ambari.server.controller.utilities.StreamProvider;
 import org.apache.ambari.server.security.authorization.AuthorizationException;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.stack.Metric;
@@ -155,6 +156,7 @@ public class StackDefinedPropertyProvider implements 
PropertyProvider {
     Map<String, Map<String, PropertyInfo>> jmxMap = new HashMap<>();
 
     List<PropertyProvider> additional = new ArrayList<>();
+    Map<String, String> overriddenHosts = new HashMap<>();
 
     try {
       for (Resource r : resources) {
@@ -183,6 +185,7 @@ public class StackDefinedPropertyProvider implements 
PropertyProvider {
         for (MetricDefinition m : defs) {
           if (m.getType().equals("ganglia")) {
             gangliaMap.put(componentName, getPropertyInfo(m));
+            m.getOverriddenHosts().ifPresent(host -> 
overriddenHosts.put(componentName, host));
           } else if (m.getType().equals("jmx")) {
             jmxMap.put(componentName, getPropertyInfo(m));
           } else {
@@ -207,7 +210,7 @@ public class StackDefinedPropertyProvider implements 
PropertyProvider {
           MetricsPropertyProvider.createInstance(type, gangliaMap,
             streamProvider, sslConfig,
             cacheProvider,
-            metricHostProvider,
+            metricHostProvider(overriddenHosts),
             metricsServiceProvider, clusterNamePropertyId,
             hostNamePropertyId, componentNamePropertyId);
 
@@ -244,6 +247,10 @@ public class StackDefinedPropertyProvider implements 
PropertyProvider {
     return resources;
   }
 
+  private MetricHostProvider metricHostProvider(Map<String, String> 
overriddenHosts) {
+    return new OverriddenMetricsHostProvider(overriddenHosts, 
metricHostProvider, injector.getInstance(ConfigHelper.class));
+  }
+
   @Override
   public Set<String> checkPropertyIds(Set<String> propertyIds) {
     return Collections.emptySet();

http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
index 28e5381..86d7114 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/MetricHostProvider.java
@@ -19,6 +19,8 @@ package org.apache.ambari.server.controller.metrics;
 
 import static 
org.apache.ambari.server.controller.metrics.MetricsServiceProvider.MetricsService;
 
+import java.util.Optional;
+
 import org.apache.ambari.server.controller.spi.SystemException;
 
 public interface MetricHostProvider {
@@ -76,4 +78,11 @@ public interface MetricHostProvider {
    * @throws SystemException if unable to get the status of metrics server 
component
    */
   boolean isCollectorComponentLive(String clusterName, MetricsService service) 
throws SystemException;
+
+  /**
+   * If a component is installed to a host that is managed outside of Ambari 
(for example OneFS) then this method will return the external hostname.
+   */
+  default Optional<String> getExternalHostName(String clusterName, String 
componentName) {
+    return Optional.empty();
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
index 487afde..efc0f4f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSComponentPropertyProvider.java
@@ -42,7 +42,9 @@ public class AMSComponentPropertyProvider extends 
AMSPropertyProvider {
 
   @Override
   protected String getHostName(Resource resource) {
-    return null;
+      return hostProvider
+        .getExternalHostName((String) 
resource.getPropertyValue(clusterNamePropertyId), (String) 
resource.getPropertyValue(componentNamePropertyId))
+        .orElse(null);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
index 3b0ee0f..f08ef2f 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java
@@ -298,6 +298,11 @@ public class ConfigHelper {
     return properties;
   }
 
+  public Map<String, Map<String, String>> getEffectiveConfigProperties(String 
clusterName, String hostName) throws AmbariException {
+    Cluster cluster = clusters.getCluster(clusterName);
+    return getEffectiveConfigProperties(cluster, 
getEffectiveDesiredTags(cluster, hostName));
+  }
+
   /**
    * Get all config attributes for a cluster given a set of configType to
    * versionTags map. This helper method merges all the override tags with a

http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
index 635ae35..033b18b 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/state/stack/MetricDefinition.java
@@ -22,6 +22,7 @@ import static java.util.Map.Entry;
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Optional;
 
 import org.codehaus.jackson.annotate.JsonIgnore;
 import org.codehaus.jackson.annotate.JsonProperty;
@@ -30,6 +31,7 @@ import org.codehaus.jackson.annotate.JsonProperty;
  * Used to represent metrics for a stack component.
  */
 public class MetricDefinition {
+  private static final String OVERRIDDEN_HOST_PROP = "overridden_host";
   private String type = null;
   private Map<String, String> properties = null;
   private Map<String, Map<String, Metric>> metrics = null;
@@ -74,5 +76,10 @@ public class MetricDefinition {
     
     return sb.toString();
   }
-  
+
+  public Optional<String> getOverriddenHosts() {
+    return properties == null
+      ? Optional.empty()
+      : Optional.ofNullable(properties.get(OVERRIDDEN_HOST_PROP));
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
----------------------------------------------------------------------
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
new file mode 100644
index 0000000..cf4b131
--- /dev/null
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/OverriddenMetricsHostProviderTest.java
@@ -0,0 +1,95 @@
+/*
+ * 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.controller.internal;
+
+import static edu.emory.mathcs.backport.java.util.Collections.emptyMap;
+import static org.easymock.EasyMock.expect;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+
+import org.apache.ambari.server.controller.metrics.MetricHostProvider;
+import org.apache.ambari.server.state.ConfigHelper;
+import org.easymock.EasyMockRule;
+import org.easymock.EasyMockSupport;
+import org.easymock.Mock;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+public class OverriddenMetricsHostProviderTest extends EasyMockSupport {
+  private static final String COMPONENT_WITH_OVERRIDDEN_HOST = "component1";
+  private static final String CLUSTER_1 = "cluster1";
+  private static final String COMPONENT_WITHOUT_OVERRIDDEN_HOST = 
"componentWithoutOverriddenHost";
+  private static final String OVERRIDEN_HOST = "overridenHost1";
+  private static final String COMPONENT_WITH_OVERRIDDEN_HOST_PLACEHOLDER = 
"${hdfs-site/dfs.namenode.http-address}";
+  private static final String RESOLVED_HOST = "resolved.fqdn";
+  @Rule
+  public EasyMockRule mocks = new EasyMockRule(this);
+  @Mock
+  private MetricHostProvider defaultHostProvider;
+  @Mock
+  private ConfigHelper configHelper;
+  private MetricHostProvider hostProvider;
+
+  @Before
+  public void setUp() throws Exception {
+    hostProvider = new OverriddenMetricsHostProvider(overrideHosts(), 
defaultHostProvider, configHelper);
+  }
+
+  @Test
+  public void testReturnsDefaultWhenNotOverridden() throws Exception {
+    replayAll();
+    assertThat(hostProvider.getExternalHostName(CLUSTER_1, 
COMPONENT_WITHOUT_OVERRIDDEN_HOST), is(Optional.empty()));
+    verifyAll();
+  }
+
+  @Test
+  public void testReturnOverriddenHostIfPresent() throws Exception {
+    expect(configHelper.getEffectiveConfigProperties(CLUSTER_1, 
null)).andReturn(emptyMap()).anyTimes();
+    replayAll();
+    assertThat(hostProvider.getExternalHostName(CLUSTER_1, 
COMPONENT_WITH_OVERRIDDEN_HOST), is(Optional.of(OVERRIDEN_HOST)));
+    verifyAll();
+  }
+
+  @Test
+  public void testReplacesPlaceholderInOverriddenHost() throws Exception {
+    expect(configHelper.getEffectiveConfigProperties(CLUSTER_1, 
null)).andReturn(config()).anyTimes();
+    replayAll();
+    assertThat(hostProvider.getExternalHostName(CLUSTER_1, 
COMPONENT_WITH_OVERRIDDEN_HOST_PLACEHOLDER), is(Optional.of(RESOLVED_HOST)));
+    verifyAll();
+  }
+
+  private Map<String, String> overrideHosts() {
+    return new HashMap<String, String>() {{
+      put(COMPONENT_WITH_OVERRIDDEN_HOST, OVERRIDEN_HOST);
+      put(COMPONENT_WITH_OVERRIDDEN_HOST_PLACEHOLDER, 
"${hdfs-site/dfs.namenode.http-address}");
+    }};
+  }
+
+  private Map<String, Map<String, String>> config() {
+    return new HashMap<String, Map<String, String>>() {{
+      put("hdfs-site", new HashMap<String, String>() {{
+        put("dfs.namenode.http-address", "http://"; + RESOLVED_HOST + ":8080");
+      }});
+    }};
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
----------------------------------------------------------------------
diff --git 
a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
 
b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
index 335bfba..30a9f5c 100644
--- 
a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
+++ 
b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metrics.json
@@ -3,6 +3,9 @@
     "Component" : [
       {
         "type" : "ganglia",
+        "properties" : {
+          "overridden_host" : "${core-site/fs.defaultFS}"
+        },
         "metrics" : {
           "default" : {
             "metrics/load/load_five" : {
@@ -11,6 +14,12 @@
               "metric" : "load_five",
               "amsHostMetric" : true
             },
+            "metrics/cpu/cpu_num": {
+              "metric": "cpu_num",
+              "pointInTime": true,
+              "temporal": true,
+              "amsHostMetric" : true
+            },
             "metrics/jvm/JvmMetrics/GcCountConcurrentMarkSweep" : {
               "temporal" : true,
               "pointInTime" : true,
@@ -77,7 +86,7 @@
             },
             "metrics/jvm/memHeapUsedM" : {
               "temporal" : true,
-              "pointInTime" : false,
+              "pointInTime" : true,
               "metric" : "jvm.JvmMetrics.MemHeapUsedM",
               "unit" : "MB"
             },
@@ -169,7 +178,7 @@
             },
             "metrics/jvm/memHeapCommittedM" : {
               "temporal" : true,
-              "pointInTime" : false,
+              "pointInTime" : true,
               "metric" : "jvm.JvmMetrics.MemHeapCommittedM"
             },
             "metrics/disk/disk_total" : {

http://git-wip-us.apache.org/repos/asf/ambari/blob/95c46db0/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
----------------------------------------------------------------------
diff --git 
a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
 
b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
index dbde93b..fe2c52e 100644
--- 
a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
+++ 
b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/widgets.json
@@ -15,15 +15,13 @@
               "name": "jvm.JvmMetrics.GcCount._rate",
               "metric_path": "metrics/jvm/gcCount._rate",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "jvm.JvmMetrics.GcCountConcurrentMarkSweep._rate",
               "metric_path": "metrics/jvm/GcCountConcurrentMarkSweep._rate",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             }
           ],
           "values": [
@@ -49,10 +47,9 @@
           "metrics": [
             {
               "name": "jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep._rate",
-              "metric_path": 
"metrics/jvm/GcTimeMillisConcurrentMarkSweep._rate",
+              "metric_path": 
"metrics/jvm/JvmMetrics/GcTimeMillisConcurrentMarkSweep._rate",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             }
           ],
           "values": [
@@ -77,15 +74,13 @@
               "name": "jvm.JvmMetrics.MemHeapCommittedM",
               "metric_path": "metrics/jvm/memHeapCommittedM",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "jvm.JvmMetrics.MemHeapUsedM",
               "metric_path": "metrics/jvm/memHeapUsedM",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             }
           ],
           "values": [
@@ -114,50 +109,43 @@
               "name": "cpu_system",
               "metric_path": "metrics/cpu/cpu_system",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "cpu_user",
               "metric_path": "metrics/cpu/cpu_user",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "cpu_nice",
               "metric_path": "metrics/cpu/cpu_nice",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "cpu_idle",
               "metric_path": "metrics/cpu/cpu_idle",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "cpu_wio",
               "metric_path": "metrics/cpu/cpu_wio",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "mem_total",
               "metric_path": "metrics/memory/mem_total",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             },
             {
               "name": "mem_free",
               "metric_path": "metrics/memory/mem_free",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
+              "component_name": "ONEFS_CLIENT"
             }
           ],
           "values": [
@@ -175,33 +163,8 @@
             "time_range": "1",
             "display_unit": "%"
           }
-        },
-        {
-          "widget_name": "Under Replicated Blocks",
-          "description": "Number represents file blocks that does not meet the 
replication factor criteria. Its indicative of ONEFS bad health.",
-          "widget_type": "NUMBER",
-          "is_visible": true,
-          "metrics": [
-            {
-              "name": 
"Hadoop:service=NameNode,name=FSNamesystem.UnderReplicatedBlocks",
-              "metric_path": "metrics/dfs/FSNamesystem/UnderReplicatedBlocks",
-              "service_name": "ONEFS",
-              "component_name": "ONEFS_CLIENT",
-              "host_component_criteria": 
"host_components/metrics/dfs/FSNamesystem/HAState=active"
-            }
-          ],
-          "values": [
-            {
-              "name": "Under Replicated Blocks",
-              "value": 
"${Hadoop:service=NameNode,name=FSNamesystem.UnderReplicatedBlocks}"
-            }
-          ],
-          "properties": {
-            "warning_threshold": "0",
-            "error_threshold": "50"
-          }
         }
       ]
     }
   ]
-}
+}
\ No newline at end of file

Reply via email to