ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amag...@apache.org
Subject [ambari] 04/15: AMBARI-22115. Alerts for OneFS mpack (amagyar)
Date Wed, 10 Jan 2018 11:00:05 GMT
This is an automated email from the ASF dual-hosted git repository.

amagyar pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git

commit b57715386cfba47be094e1cc13b31747ed51d3fa
Author: Attila Magyar <amagyar@hortonworks.com>
AuthorDate: Thu Oct 26 11:49:18 2017 +0200

    AMBARI-22115. Alerts for OneFS mpack (amagyar)
---
 .../server/controller/jmx/JMXMetricHolder.java     |  55 ++++-
 .../ambari/server/state/alert/Reporting.java       |   9 +-
 .../server/controller/jmx/JMXMetricHolderTest.java |  14 ++
 .../addon-services/ONEFS/1.0.0/alerts.json         | 112 +++++++--
 .../ONEFS/1.0.0/configuration/hadoop-env.xml       |  18 ++
 .../addon-services/ONEFS/1.0.0/metainfo.xml        |   1 +
 .../addon-services/ONEFS/1.0.0/metrics.json        | 256 +++++++++++++++++----
 .../ONEFS/1.0.0/package/scripts/params_linux.py    |   2 +-
 .../addon-services/ONEFS/1.0.0/widgets.json        | 191 ++++++++++++++-
 9 files changed, 565 insertions(+), 93 deletions(-)

diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
index f6ae54f..53227e5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/jmx/JMXMetricHolder.java
@@ -22,8 +22,11 @@ import static java.util.stream.Collectors.toList;
 
 import java.util.List;
 import java.util.Map;
-import java.util.Objects;
 import java.util.Optional;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.annotation.Nullable;
 
 /**
  *
@@ -61,17 +64,51 @@ public final class JMXMetricHolder {
       .collect(toList());
   }
 
-  public Optional<Object> find(String property) {
-    String propertyName = property.split("/")[0];
-    String propertyValue = property.split("/")[1];
+  public Optional<Object> find(String pattern) {
+    JmxPattern jmxPattern = JmxPattern.parse(pattern);
     return beans.stream()
-      .filter(each -> propertyName.equals(name(each)))
-      .map(each -> each.get(propertyValue))
-      .filter(Objects::nonNull)
+      .map(jmxPattern::extract)
+      .filter(Optional::isPresent)
+      .map(Optional::get)
       .findFirst();
   }
 
-  private String name(Map<String, Object> bean) {
-    return bean.containsKey(NAME_KEY) ? (String) bean.get(NAME_KEY) : null;
+  private static class JmxPattern {
+    private static final Pattern PATTERN = Pattern.compile("(.*?)\\[(\\S+?)\\]");
+    private final String beanName;
+    private final String propertyName;
+    private final @Nullable String key;
+
+    public static JmxPattern parse(String property) {
+      String beanName = property.split("/")[0];
+      String propertyName = property.split("/")[1];
+      String key = null;
+      Matcher matcher = PATTERN.matcher(propertyName);
+      if (matcher.matches()) {
+        propertyName = matcher.group(1);
+        key = matcher.group(2);
+      }
+      return new JmxPattern(beanName, propertyName, key);
+    }
+
+    private JmxPattern(String beanName, String propertyName, String key) {
+      this.beanName = beanName;
+      this.propertyName = propertyName;
+      this.key = key;
+    }
+
+    public Optional<Object> extract(Map<String, Object> bean) {
+      return beanName.equals(name(bean))
+        ? Optional.ofNullable(lookupByKey(bean.get(propertyName)))
+        : Optional.empty();
+    }
+
+    public Object lookupByKey(Object bean) {
+      return key != null && bean instanceof Map ? ((Map) bean).get(key) : bean;
+    }
+
+    private String name(Map<String, Object> bean) {
+      return bean.containsKey(NAME_KEY) ? (String) bean.get(NAME_KEY) : null;
+    }
   }
 }
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
index a7e11e1..66d09a5 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/alert/Reporting.java
@@ -17,9 +17,8 @@
  */
 package org.apache.ambari.server.state.alert;
 
-import static org.apache.ambari.server.state.alert.Reporting.ReportingType.PERCENT;
-
 import java.text.MessageFormat;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.ambari.server.alerts.Threshold;
@@ -208,7 +207,7 @@ public class Reporting {
   }
 
   public AlertState state(double value) {
-    return getThreshold().state(PERCENT == getType() ? value * 100 : value);
+    return getThreshold().state(value);
   }
 
   private Threshold getThreshold() {
@@ -216,7 +215,9 @@ public class Reporting {
   }
 
   public String formatMessage(double value, List<Object> args) {
-    return MessageFormat.format(message(value), args.toArray());
+    List<Object> copy = new ArrayList<>(args);
+    copy.add(value);
+    return MessageFormat.format(message(value), copy.toArray());
   }
 
   private String message(double value) {
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
index 61d5bae..99eb961 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/jmx/JMXMetricHolderTest.java
@@ -42,6 +42,13 @@ public class JMXMetricHolderTest {
       new HashMap<String, Object>() {{
         put("name", "bean2");
         put("value", "val2");
+      }},
+      new HashMap<String, Object>() {{
+        put("name", "nested");
+        put("value", new HashMap<String, Object>() {{
+          put("key1", "nested-val1");
+          put("key2", "nested-val2");
+        }});
       }}
     ));
   }
@@ -58,4 +65,11 @@ public class JMXMetricHolderTest {
     List<Object> result = metrics.findAll(asList("bean1/value", "bean2/value", "bean3/notfound"));
     assertThat(result, hasItems("val1", "val2"));
   }
+
+
+  @Test
+  public void testFindNestedBean() throws Exception {
+    List<Object> result = metrics.findAll(asList("nested/value[key1]", "nested/value[key2]"));
+    assertThat(result, hasItems("nested-val1", "nested-val2"));
+  }
 }
\ No newline at end of file
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
index 5718721..c84a5be 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/alerts.json
@@ -2,10 +2,10 @@
   "ONEFS":{
     "service": [
       {
-        "name": "onefs_namenode_cpu",
-        "label": "OneFS NameNode Host CPU Utilization",
-        "description": "This host-level alert is triggered if CPU utilization of the NameNode
exceeds certain warning and critical thresholds. It checks the NameNode JMX Servlet for the
SystemCPULoad property. The threshold values are in percent.",
-        "interval": 1,
+        "name": "namenode_onefs_capacity_utilization",
+        "label": "OneFS Capacity Utilization",
+        "description": "This service-level alert is triggered if the OneFS capacity utilization
exceeds the configured warning and critical thresholds. It checks the OneFS NameNode for the
CapacityUsed and CapacityRemaining properties. The threshold values are in percent.",
+        "interval": 2,
         "scope": "HOST",
         "enabled": true,
         "source": {
@@ -20,26 +20,102 @@
           },
           "reporting": {
             "ok": {
-              "text": "{1} CPU, load {0,number,percent}"
+              "text": "Capacity Used:[{2,number,#.##}%, {0}], Capacity Remaining:[{1}]"
             },
             "warning": {
-              "text": "{1} CPU, load {0,number,percent}",
-              "value": 5
+              "text": "Capacity Used:[{2,number,#.##}%, {0}], Capacity Remaining:[{1}]",
+              "value": 75
             },
             "critical": {
-              "text": "{1} CPU, load {0,number,percent}",
-              "value": 20
+              "text": "Capacity Used:[{2,number,#.##}%, {0}], Capacity Remaining:[{1}]",
+              "value": 80
+            }
+          },
+          "jmx": {
+            "property_list": [
+              "Hadoop:service=NameNode,name=FSNamesystem/CapacityUsed",
+              "Hadoop:service=NameNode,name=FSNamesystem/CapacityRemaining"
+            ],
+            "value": "new Double({0})/({0} + {1}) * 100.0"
+          }
+        }
+      },
+      {
+        "name": "namenode_onefs_blocks_health",
+        "label": "OneFS NameNode Blocks Health",
+        "description": "This service-level alert is triggered if the number of corrupt or
missing blocks exceeds the configured critical threshold. The threshold values are in blocks.",
+        "interval": 2,
+        "scope": "HOST",
+        "enabled": true,
+        "source": {
+          "type": "SERVER",
+          "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
+          "uri": {
+            "http": "${hdfs-site/dfs.namenode.http-address}",
+            "https": "${hdfs-site/dfs.namenode.https-address}",
+            "https_property": "${hdfs-site/dfs.http.policy}",
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
+          },
+          "reporting": {
+            "ok": {
+              "text": "Missing Blocks:[{0}]"
+            },
+            "warning": {
+              "text": "Missing Blocks:[{0}]",
+              "value": 1
+            },
+            "critical": {
+              "text": "Missing Blocks:[{0}]",
+              "value": 1
+            }
+          },
+          "jmx": {
+            "property_list": [
+              "Hadoop:service=NameNode,name=FSNamesystem/MissingBlocks"
+            ],
+            "value": "{0}"
+          }
+        }
+      },
+      {
+        "name": "onefs_heap_usage",
+        "label": "OneFS Heap Usage",
+        "description": "This host-level alert is triggered if heap usage goes past thresholds
on the DataNode. The threshold values are in percent.",
+        "interval": 2,
+        "scope": "HOST",
+        "enabled": true,
+        "source": {
+          "type": "SERVER",
+          "class": "org.apache.ambari.server.alerts.JmxServerSideAlert",
+          "uri": {
+            "http": "${hdfs-site/dfs.namenode.http-address}",
+            "https": "${hdfs-site/dfs.namenode.https-address}",
+            "https_property": "${hdfs-site/dfs.http.policy}",
+            "https_property_value": "HTTPS_ONLY",
+            "connection_timeout": 5.0
+          },
+          "reporting": {
+            "ok": {
+              "text": "Used Heap:[{2,number,#.##}%, {0} B], Max Heap: {1} B"
+            },
+            "warning": {
+              "text": "Used Heap:[{2,number,#.##}%, {0} B], Max Heap: {1} B",
+              "value": 80
             },
-            "units" : "%",
-            "type": "PERCENT"
-           },
-           "jmx": {
-             "property_list": [
-              "java.lang:type=OperatingSystem/SystemCpuLoad",
-              "java.lang:type=OperatingSystem/AvailableProcessors"
-             ]
-           }
+            "critical": {
+              "text": "Used Heap:[{2,number,#.##}%, {0} B], Max Heap: {1} B",
+              "value": 90
+            }
+          },
+          "jmx": {
+            "property_list": [
+              "java.lang:type=Memory/HeapMemoryUsage[used]",
+              "java.lang:type=Memory/HeapMemoryUsage[max]"
+            ],
+            "value": "100.0 - (new Double({1} - {0})/{1} * 100.0)"
           }
+        }
       }
     ]
   }
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
index bb671cc..5558f59 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/configuration/hadoop-env.xml
@@ -193,6 +193,24 @@
     <value-attributes>
       <type>user</type>
       <overridable>false</overridable>
+      <user-groups>
+        <property>
+          <type>hadoop-env</type>
+          <name>hdfs_group</name>
+        </property>
+      </user-groups>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hdfs_group</name>
+    <display-name>HDFS User Group</display-name>
+    <value>hdfs_group</value>
+    <property-type>GROUP</property-type>
+    <description>HDFS user group.</description>
+    <value-attributes>
+      <type>user</type>
+      <overridable>false</overridable>
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
index f20bcf8..82e2022 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/metainfo.xml
@@ -27,6 +27,7 @@
       <components>
        <component>
           <name>ONEFS_CLIENT</name>
+          <timelineAppid>NAMENODE</timelineAppid>
           <displayName>OneFS Client</displayName>
           <category>CLIENT</category>
           <componentType>HCFS_CLIENT</componentType>
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 cd705eb..335bfba 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
@@ -1,55 +1,211 @@
 {
-  "ONEFS_CLIENT": {
-    "Component": [
+  "ONEFS_CLIENT" : {
+    "Component" : [
       {
-        "type": "ganglia",
-        "metrics": {
-          "default": {
-            "metrics/onefs/demo/counter": {
-              "metric": "onefs.demo.counter",
-              "pointInTime": true,
-              "temporal": true
-            }
-          }
-        }
-      },
-      {
-        "type": "jmx",
-        "properties": {
-          "url_config_type": "hdfs-site",
-          "url_property_name": "dfs.namenode.http-address"
-        },
-        "metrics": {
-          "default": {
-            "metrics/dfs/namenode/Used": {
-              "metric": "Hadoop:service=NameNode,name=NameNodeInfo.Used",
-              "pointInTime": true,
-              "temporal": false
-            },
-            "metrics/jvm/memHeapUsedM": {
-              "metric": "jvm.JvmMetrics.MemHeapUsedM",
-              "pointInTime": true,
-              "temporal": true
-            },
-            "metrics/jvm/HeapMemoryMax": {
-              "metric": "java.lang:type=Memory.HeapMemoryUsage[max]",
-              "pointInTime": true,
-              "temporal": false
-            },
-            "metrics/jvm/HeapMemoryUsed": {
-              "metric": "java.lang:type=Memory.HeapMemoryUsage[used]",
-              "pointInTime": true,
-              "temporal": false
-            },
-            "metrics/jvm/NonHeapMemoryMax": {
-              "metric": "java.lang:type=Memory.NonHeapMemoryUsage[max]",
-              "pointInTime": true,
-              "temporal": false
-            },
-            "metrics/jvm/NonHeapMemoryUsed": {
-              "metric": "java.lang:type=Memory.NonHeapMemoryUsage[used]",
-              "pointInTime": true,
-              "temporal": false
+        "type" : "ganglia",
+        "metrics" : {
+          "default" : {
+            "metrics/load/load_five" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "load_five",
+              "amsHostMetric" : true
+            },
+            "metrics/jvm/JvmMetrics/GcCountConcurrentMarkSweep" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "jvm.JvmMetrics.GcCountConcurrentMarkSweep"
+            },
+            "metrics/cpu/cpu_nice" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_nice",
+              "amsHostMetric" : true
+            },
+            "metrics/rpc/NumOpenConnections" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "rpc.rpc.NumOpenConnections"
+            },
+            "metrics/network/bytes_in" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "bytes_in",
+              "amsHostMetric" : true
+            },
+            "metrics/cpu/cpu_wio" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_wio",
+              "amsHostMetric" : true
+            },
+            "metrics/process/proc_run" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "proc_run",
+              "amsHostMetric" : true
+            },
+            "metrics/memory/mem_cached" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "mem_cached",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/write_bytes" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "write_bytes",
+              "amsHostMetric" : true
+            },
+            "metrics/network/bytes_out" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "bytes_out",
+              "amsHostMetric" : true
+            },
+            "metrics/cpu/cpu_idle" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_idle",
+              "amsHostMetric" : true
+            },
+            "metrics/memory/mem_total" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "mem_total",
+              "amsHostMetric" : true
+            },
+            "metrics/jvm/memHeapUsedM" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "jvm.JvmMetrics.MemHeapUsedM",
+              "unit" : "MB"
+            },
+            "metrics/memory/mem_shared" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "mem_shared",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/write_count" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "write_count",
+              "amsHostMetric" : true
+            },
+            "metrics/network/pkts_in" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "pkts_in",
+              "amsHostMetric" : true
+            },
+            "metrics/network/pkts_out" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "pkts_out",
+              "amsHostMetric" : true
+            },
+            "metrics/load/load_one" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "load_one",
+              "amsHostMetric" : true
+            },
+            "metrics/rpc/RpcProcessingTime_avg_time" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "rpc.rpc.RpcProcessingTimeAvgTime"
+            },
+            "metrics/jvm/JvmMetrics/GcTimeMillisConcurrentMarkSweep" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep"
+            },
+            "metrics/memory/swap_total" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "swap_total",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/read_bytes" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "read_bytes",
+              "amsHostMetric" : true
+            },
+            "metrics/jvm/gcTimeMillis" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "jvm.JvmMetrics.GcTimeMillis"
+            },
+            "metrics/jvm/gcCount" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "jvm.JvmMetrics.GcCount"
+            },
+            "metrics/memory/swap_free" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "swap_free",
+              "amsHostMetric" : true
+            },
+            "metrics/process/proc_total" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "proc_total",
+              "amsHostMetric" : true
+            },
+            "metrics/load/load_fifteen" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "load_fifteen",
+              "amsHostMetric" : true
+            },
+            "metrics/cpu/cpu_user" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_user",
+              "amsHostMetric" : true
+            },
+            "metrics/jvm/memHeapCommittedM" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "jvm.JvmMetrics.MemHeapCommittedM"
+            },
+            "metrics/disk/disk_total" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "disk_total",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/disk_free" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "disk_free",
+              "amsHostMetric" : true
+            },
+            "metrics/disk/read_count" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "read_count",
+              "amsHostMetric" : true
+            },
+            "metrics/memory/mem_free" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "mem_free",
+              "amsHostMetric" : true
+            },
+            "metrics/rpc/RpcQueueTime_avg_time" : {
+              "temporal" : true,
+              "pointInTime" : false,
+              "metric" : "rpc.rpc.RpcQueueTimeAvgTime"
+            },
+            "metrics/cpu/cpu_system" : {
+              "temporal" : true,
+              "pointInTime" : true,
+              "metric" : "cpu_system",
+              "amsHostMetric" : true
             }
           }
         }
diff --git a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
index 72e0ae9..b823fc5 100644
--- a/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
+++ b/contrib/management-packs/isilon-onefs-mpack/src/main/resources/addon-services/ONEFS/1.0.0/package/scripts/params_linux.py
@@ -30,7 +30,7 @@ from resource_management.libraries.functions import stack_select
 config = Script.get_config()
 
 hostname = config["hostname"]
-hadoop_conf_dir = conf_select.get_hadoop_conf_dir(force_latest_on_upgrade=True)
+hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
 hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
 user_group = config['configurations']['cluster-env']['user_group']
 hdfs_tmp_dir = config['configurations']['hadoop-env']['hdfs_tmp_dir']
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 23da1d6..dbde93b 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
@@ -1,29 +1,173 @@
 {
   "layouts": [
     {
-      "layout_name": "default_onefs_layout",
+      "layout_name": "default_onefs_dashboard",
       "display_name": "Standard ONEFS Dashboard",
       "section_name": "ONEFS_SUMMARY",
       "widgetLayoutInfo": [
         {
-          "widget_name": "OneFS metrics demo",
-          "description": "Test widget",
-          "default_section_name": "ONEFS_SUMMARY",
+          "widget_name": "NameNode GC count",
+          "description": "Count of total garbage collections and count of major type garbage
collections of the JVM.",
           "widget_type": "GRAPH",
           "is_visible": true,
-          "scope" : "SERVICE",
           "metrics": [
             {
-              "name": "counter",
-              "metric_path": "metrics/onefs/demo/counter",
+              "name": "jvm.JvmMetrics.GcCount._rate",
+              "metric_path": "metrics/jvm/gcCount._rate",
               "service_name": "ONEFS",
-              "component_name": "ONEFS_CLUSTER"
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
+            },
+            {
+              "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"
+            }
+          ],
+          "values": [
+            {
+              "name": "GC total count",
+              "value": "${jvm.JvmMetrics.GcCount._rate}"
+            },
+            {
+              "name": "GC count of type major collection",
+              "value": "${jvm.JvmMetrics.GcCountConcurrentMarkSweep._rate}"
+            }
+          ],
+          "properties": {
+            "graph_type": "LINE",
+            "time_range": "1"
+          }
+        },
+        {
+          "widget_name": "NameNode GC time",
+          "description": "Total time taken by major type garbage collections in milliseconds.",
+          "widget_type": "GRAPH",
+          "is_visible": true,
+          "metrics": [
+            {
+              "name": "jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep._rate",
+              "metric_path": "metrics/jvm/GcTimeMillisConcurrentMarkSweep._rate",
+              "service_name": "ONEFS",
+              "component_name": "ONEFS_CLIENT",
+              "host_component_criteria": "host_components/metrics/dfs/FSNamesystem/HAState=active"
             }
           ],
           "values": [
             {
-              "name": "demo value",
-              "values" : "${counter}"
+              "name": "GC time in major collection",
+              "value": "${jvm.JvmMetrics.GcTimeMillisConcurrentMarkSweep._rate}"
+            }
+          ],
+          "properties": {
+            "display_unit": "ms",
+            "graph_type": "LINE",
+            "time_range": "1"
+          }
+        },
+        {
+          "widget_name": "NameNode Heap",
+          "description": "Heap memory committed and Heap memory used with respect to time.",
+          "widget_type": "GRAPH",
+          "is_visible": true,
+          "metrics": [
+            {
+              "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"
+            },
+            {
+              "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"
+            }
+          ],
+          "values": [
+            {
+              "name": "JVM heap committed",
+              "value": "${jvm.JvmMetrics.MemHeapCommittedM}"
+            },
+            {
+              "name": "JVM heap used",
+              "value": "${jvm.JvmMetrics.MemHeapUsedM}"
+            }
+          ],
+          "properties": {
+            "display_unit": "MB",
+            "graph_type": "LINE",
+            "time_range": "1"
+          }
+        },
+        {
+          "widget_name": "NameNode Host Load",
+          "description": "Percentage of CPU and Memory resources being consumed on NameNode
host.",
+          "widget_type": "GRAPH",
+          "is_visible": true,
+          "metrics": [
+            {
+              "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"
+            },
+            {
+              "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"
+            },
+            {
+              "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"
+            },
+            {
+              "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"
+            },
+            {
+              "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"
+            },
+            {
+              "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"
+            },
+            {
+              "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"
+            }
+          ],
+          "values": [
+            {
+              "name": "CPU utilization",
+              "value": "${((cpu_system + cpu_user + cpu_nice)/(cpu_system + cpu_user + cpu_nice
+ cpu_idle + cpu_wio)) * 100}"
+            },
+            {
+              "name": "Memory utilization",
+              "value": "${((mem_total - mem_free)/mem_total) * 100}"
             }
           ],
           "properties": {
@@ -31,8 +175,33 @@
             "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
+}

-- 
To stop receiving notification emails like this one, please contact
"commits@ambari.apache.org" <commits@ambari.apache.org>.

Mime
View raw message