eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h..@apache.org
Subject incubator-eagle git commit: EAGLE-216 Added RM Policy and GC Policies in Resource
Date Wed, 06 Apr 2016 14:13:27 GMT
Repository: incubator-eagle
Updated Branches:
  refs/heads/master ee6c6ad6d -> 6a0a11f2d


EAGLE-216 Added RM Policy and GC Policies in Resource

https://issues.apache.org/jira/browse/EAGLE-216

1) added RM policy and gc policies

2) Update gclog-NNFullGC-import.sh

3) Update gclog-init-sandbox.sh

4) Update gclog-NNFullGC-import.sh

5) Update gclog-NNGCPauseTimeLong-import.sh

6) replace datasource with application

Author:    senthilkumar <senthikumar@ebay.com>

Closes #109


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/6a0a11f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/6a0a11f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/6a0a11f2

Branch: refs/heads/master
Commit: 6a0a11f2da3c0d11091fcc2e2f05258f61a3da99
Parents: ee6c6ad
Author: senthilkumar <senthikumar@ebay.com>
Authored: Thu Mar 3 14:43:54 2016 +0530
Committer: Hao Chen <hao@apache.org>
Committed: Wed Apr 6 22:12:47 2016 +0800

----------------------------------------------------------------------
 eagle-gc/src/main/resources/alert-gc-policy.sh  | 21 ------
 .../main/resources/alert-metadata-create-gc.sh  | 27 --------
 .../src/main/resources/gclog-NNFullGC-import.sh | 33 +++++++++
 .../resources/gclog-NNGCPauseTimeLong-import.sh | 33 +++++++++
 .../src/main/resources/gclog-init-sandbox.sh    | 71 ++++++++++++++++++++
 .../sanbox/capacityused-policy-import.sh        | 51 ++++++++++++++
 .../resources/sanbox/hastate-policy-import.sh   | 51 ++++++++++++++
 .../sanbox/lastcheckpointtime-policy-import.sh  | 51 ++++++++++++++
 .../sanbox/missingblock-policy-import.sh        | 51 ++++++++++++++
 .../sanbox/namenodehanoactive-policy-import.sh  | 52 ++++++++++++++
 ...nodehawithmorethanoneactive-policy-import.sh | 53 +++++++++++++++
 .../sanbox/namenodelag-policy-import.sh         | 49 ++++++++++++++
 .../resources/sanbox/nodecount-policy-import.sh | 51 ++++++++++++++
 .../resourcemanagerhanoactive-policy-import.sh  | 53 +++++++++++++++
 ...agerhawithmorethanoneactive-policy-import.sh | 54 +++++++++++++++
 .../sanbox/safemodecheck-policy-import.sh       | 51 ++++++++++++++
 eagle-topology-assembly/pom.xml                 |  5 ++
 17 files changed, 709 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-gc/src/main/resources/alert-gc-policy.sh
----------------------------------------------------------------------
diff --git a/eagle-gc/src/main/resources/alert-gc-policy.sh b/eagle-gc/src/main/resources/alert-gc-policy.sh
deleted file mode 100644
index 7f32c22..0000000
--- a/eagle-gc/src/main/resources/alert-gc-policy.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#  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.
-
-#!/bin/sh
-#### AlertDefinitionService: alert definition for NNGCLog Pause Time Long
-curl -X POST -H 'Content-Type:application/json' -H "Authorization:Basic YWRtaW46c2VjcmV0" "http://localhost:9099/eagle-service/rest/entities?serviceName=AlertDefinitionService" -d '[{"tags":{"site":"sandbox","dataSource":"NNGCLog","policyId":"NNGCPauseTimeLong","alertExecutorId":"NNGCAlert","policyType":"siddhiCEPEngine"},"desc":"alert when namenode pause time long","policyDef":"{\"type\":\"siddhiCEPEngine\",\"expression\":\"from NNGCLogStream#window.externalTime(timestamp,10 min) select sum(pausedGCTimeSec) as sumPausedSec having sumPausedSec >= 30 insert into outputStream;\"}","dedupeDef":"","notificationDef":"","remediationDef":"","enabled":true}]'
-
-#### AlertDefinitionService: alert definition for NNGCLog Full GC
-curl -X POST -H 'Content-Type:application/json' -H "Authorization:Basic YWRtaW46c2VjcmV0" "http://localhost:9099/eagle-service/rest/entities?serviceName=AlertDefinitionService" -d '[{"tags":{"site":"sandbox","dataSource":"NNGCLog","policyId":"NNGCPauseTimeLong","alertExecutorId":"NNGCAlert","policyType":"siddhiCEPEngine"},"desc":"alert when namenode has full gc","policyDef":"{\"type\":\"siddhiCEPEngine\",\"expression\":\"from NNGCLogStream[(permAreaGCed == true)] select * insert into outputStream;\"}","dedupeDef":"","notificationDef":"","remediationDef":"","enabled":true}]'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-gc/src/main/resources/alert-metadata-create-gc.sh
----------------------------------------------------------------------
diff --git a/eagle-gc/src/main/resources/alert-metadata-create-gc.sh b/eagle-gc/src/main/resources/alert-metadata-create-gc.sh
deleted file mode 100644
index 2e34490..0000000
--- a/eagle-gc/src/main/resources/alert-metadata-create-gc.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#  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.
-
-#!/bin/sh
-#### AlertDataSourceService: alert streams generated from data source
-curl -X POST -H 'Content-Type:application/json' -H 'Authorization: Basic YWRtaW46c2VjcmV0' "http://localhost:9099/eagle-service/rest/entities?serviceName=AlertDataSourceService" -d '[{"prefix": "alertDataSource", "tags": {"site": "sandbox","dataSource": "NNGCLog"}}]'
-
-#### AlertStreamService: alert streams generated from data source
-curl -X POST -H 'Content-Type:application/json' -H 'Authorization: Basic YWRtaW46c2VjcmV0' "http://localhost:9099/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream"},"desc":"alert event stream from namenode gc log"}]'
-
-#### AlertExecutorService: what alert streams are consumed by alert executor
-curl -X POST -H 'Content-Type:application/json' -H 'Authorization: Basic YWRtaW46c2VjcmV0' "http://localhost:9099/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"dataSource":"NNGCLog","alertExecutorId":"NNGCAlert","streamName":"NNGCLogStream"},"desc":"alert executor for namenode gc log"}]'
-
-#### AlertStreamSchemaService: schema for event from alert stream
-curl -X POST -H 'Content-Type:application/json' -H 'Authorization: Basic YWRtaW46c2VjcmV0' "http://localhost:9099/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"timestamp"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"eventType"}},{"prefix":"alertStreamSchema","category":"","attrType":"double","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"pausedGCTimeSec"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"youngAreaGCed"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"dataSource":"NNGCLog","s
 treamName":"NNGCLogStream","attrName":"youngUsedHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"youngTotalHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"tenuredAreaGCed"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"tenuredAreaGCed"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"tenuredTotalHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"permAreaGCed"}},{"prefix":"alertStreamSchema","category":"","attrType":"long"
 ,"attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"permUsedHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"permTotalHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"totalHeapUsageAvailable"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"usedTotalHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"tenuredUsedHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"totalHeapK"}},{"
 prefix":"alertStreamSchema","category":"","attrType":"string","attrValueResolver":"","tags":{"dataSource":"NNGCLog","streamName":"NNGCLogStream","attrName":"logLine"}}]'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-gc/src/main/resources/gclog-NNFullGC-import.sh
----------------------------------------------------------------------
diff --git a/eagle-gc/src/main/resources/gclog-NNFullGC-import.sh b/eagle-gc/src/main/resources/gclog-NNFullGC-import.sh
new file mode 100755
index 0000000..e773794
--- /dev/null
+++ b/eagle-gc/src/main/resources/gclog-NNFullGC-import.sh
@@ -0,0 +1,33 @@
+#
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/gclog-init-sandbox.sh
+##### add policies ##########
+echo " Creating policy NNFullGC for GCLog Monitoring "
+
+#### AlertDefinitionService: alert definition for NNGCLog Pause Time Long
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d'
+ [
+ {"tags":{"site":"sandbox","application":"NNGCLog","policyId":"NNFullGC","alertExecutorId":"NNGCAlert","policyType":"siddhiCEPEngine"},"desc":"alert when namenode has full gc","policyDef":"{\"type\":\"siddhiCEPEngine\",\"expression\":\"from NNGCLogStream[(permAreaGCed == true)] select * insert into outputStream;\"}","dedupeDef":"","notificationDef":"","remediationDef":"","enabled":true}
+ ]
+ '
+
+echo " Created Policy  NNFullGC Successfully  ...."

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-gc/src/main/resources/gclog-NNGCPauseTimeLong-import.sh
----------------------------------------------------------------------
diff --git a/eagle-gc/src/main/resources/gclog-NNGCPauseTimeLong-import.sh b/eagle-gc/src/main/resources/gclog-NNGCPauseTimeLong-import.sh
new file mode 100755
index 0000000..541f68f
--- /dev/null
+++ b/eagle-gc/src/main/resources/gclog-NNGCPauseTimeLong-import.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/gclog-init-sanbox.sh
+##### add policies ##########
+echo " Creating policy NNGCPauseTimeLong for GCLog Monitoring "
+
+#### AlertDefinitionService: alert definition for NNGCLog Pause Time Long
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+ {"tags":{"site":"sandbox","application":"NNGCLog","policyId":"NNGCPauseTimeLong","alertExecutorId":"NNGCAlert","policyType":"siddhiCEPEngine"},"desc":"alert when namenode pause time long","policyDef":"{\"type\":\"siddhiCEPEngine\",\"expression\":\"from NNGCLogStream#window.externalTime(timestamp,10 min) select sum(pausedGCTimeSec) as sumPausedSec having sumPausedSec >= 30 insert into outputStream;\"}","dedupeDef":"","notificationDef":"","remediationDef":"","enabled":true}
+ ]
+ '
+
+ echo " Created Policy  NNGCPauseTimeLong Successfully  ...."
+

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-gc/src/main/resources/gclog-init-sandbox.sh
----------------------------------------------------------------------
diff --git a/eagle-gc/src/main/resources/gclog-init-sandbox.sh b/eagle-gc/src/main/resources/gclog-init-sandbox.sh
new file mode 100755
index 0000000..ded245f
--- /dev/null
+++ b/eagle-gc/src/main/resources/gclog-init-sandbox.sh
@@ -0,0 +1,71 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+
+##### add policies ##########
+echo ""
+echo "Creating Meta Data for GC Monitoring  ..."
+
+
+#### AlertDataSourceService: alert streams generated from data source
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=SiteApplicationService" \
+  -d '
+  [
+     {
+        "tags":{
+           "site":"sandbox",
+           "application":"NNGCLog"
+        },
+        "enabled": true        
+     }
+  ]
+  '
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=ApplicationDescService" \
+  -d '
+  [
+     {
+        "tags":{
+           "application":"NNGCLog"
+        },
+        "desc":"hadoop gc log monitoring",
+        "alias":"NNGCLogMonitor",
+        "group":"DAM",
+        "config":"{}",
+        "features":["common","metadata"]
+     }
+  ]
+  '
+  
+#### AlertStreamService: alert streams generated from data source
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamService" -d '[{"prefix":"alertStream","tags":{"application":"NNGCLog","streamName":"NNGCLogStream"},"desc":"alert event stream from namenode gc log"}]'
+
+#### AlertExecutorService: what alert streams are consumed by alert executor
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertExecutorService" -d '[{"prefix":"alertExecutor","tags":{"application":"NNGCLog","alertExecutorId":"NNGCAlert","streamName":"NNGCLogStream"},"desc":"alert executor for namenode gc log"}]'
+
+#### AlertStreamSchemaService: schema for event from alert stream
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertStreamSchemaService" -d '[{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"timestamp"}},{"prefix":"alertStreamSchema","category":"","attrType":"string","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"eventType"}},{"prefix":"alertStreamSchema","category":"","attrType":"double","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"pausedGCTimeSec"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"youngAreaGCed"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"youngUsedHeapK"}}
 ,{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"youngTotalHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"tenuredAreaGCed"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"tenuredAreaGCed"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"tenuredTotalHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"permAreaGCed"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGC
 Log","streamName":"NNGCLogStream","attrName":"permUsedHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"permTotalHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"totalHeapUsageAvailable"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"usedTotalHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"bool","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"tenuredUsedHeapK"}},{"prefix":"alertStreamSchema","category":"","attrType":"long","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"totalHeapK"}},{"prefix":"alertStreamSchema","category":"","at
 trType":"string","attrValueResolver":"","tags":{"application":"NNGCLog","streamName":"NNGCLogStream","attrName":"logLine"}}]'
+
+
+echo " Initialized GC Log Monitoring ...."
+
+

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/capacityused-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/capacityused-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/capacityused-policy-import.sh
new file mode 100755
index 0000000..ad52275
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/capacityused-policy-import.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+echo ""
+echo "Importing policy: capacityUsedPolicy "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "capacityUsedPolicy",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from hadoopJmxMetricEventStream[metric == \\\"hadoop.namenode.fsnamesystemstate.capacityused\\\" and convert(value, \\\"long\\\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/hastate-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/hastate-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/hastate-policy-import.sh
new file mode 100755
index 0000000..7801c09
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/hastate-policy-import.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+echo ""
+echo "Importing policy: haStatePolicy "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "haStatePolicy",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from every a = hadoopJmxMetricEventStream[metric==\\\"hadoop.namenode.fsnamesystem.hastate\\\"] -> b = hadoopJmxMetricEventStream[metric==a.metric and b.host == a.host and (convert(a.value, \\\"long\\\") != convert(value, \\\"long\\\"))] within 10 min select a.host, a.value as oldHaState, b.value as newHaState, b.timestamp as timestamp, b.metric as metric, b.component as component, b.site as site insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/lastcheckpointtime-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/lastcheckpointtime-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/lastcheckpointtime-policy-import.sh
new file mode 100755
index 0000000..d3811aa
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/lastcheckpointtime-policy-import.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+echo ""
+echo "Importing policy: lastCheckPointTimePolicy "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "lastCheckPointTimePolicy",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from hadoopJmxMetricEventStream[metric == \\\"hadoop.namenode.dfs.lastcheckpointtime\\\" and (convert(value, \\\"long\\\") + 18000000) < timestamp]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"last check point time lag found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/missingblock-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/missingblock-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/missingblock-policy-import.sh
new file mode 100755
index 0000000..be51597
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/missingblock-policy-import.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+echo ""
+echo "Importing policy: missingBlockPolicy "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "missingBlockPolicy",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from hadoopJmxMetricEventStream[metric == \\\"hadoop.namenode.dfs.missingblocks\\\" and convert(value, \\\"long\\\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/namenodehanoactive-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/namenodehanoactive-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/namenodehanoactive-policy-import.sh
new file mode 100755
index 0000000..33a7210
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/namenodehanoactive-policy-import.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+
+echo ""
+echo "Importing policy: NamenodeHAHasNoActive "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "NamenodeHAHasNoActive",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from hadoopJmxMetricEventStream[metric == \\\"hadoop.namenode.hastate.active.count\\\" and value == 0 ]select * insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/namenodehawithmorethanoneactive-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/namenodehawithmorethanoneactive-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/namenodehawithmorethanoneactive-policy-import.sh
new file mode 100755
index 0000000..2afa09e
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/namenodehawithmorethanoneactive-policy-import.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+
+echo ""
+echo "Importing policy: NamenodeHAWithMoreThanOneActive "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "NamenodeHAWithMoreThanOneActive",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from hadoopJmxMetricEventStream[metric == \\\"hadoop.namenode.hastate.active.count\\\" and value > 1]select * insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0
+

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/namenodelag-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/namenodelag-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/namenodelag-policy-import.sh
new file mode 100755
index 0000000..2ccd37e
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/namenodelag-policy-import.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+echo ""
+echo "Importing Policy: NameNodeLagPolicy"
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "NameNodeLagPolicy",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from every a = hadoopJmxMetricEventStream[metric==\\\"hadoop.namenode.journaltransaction.lastappliedorwrittentxid\\\"] -> b = hadoopJmxMetricEventStream[metric==a.metric and b.host != a.host and (max(convert(a.value, \\\"long\\\")) + 100) <= max(convert(value, \\\"long\\\"))] within 5 min select a.host as hostA, a.value as transactIdA, b.host as hostB, b.value as transactIdB insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"name node lag found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/nodecount-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/nodecount-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/nodecount-policy-import.sh
new file mode 100755
index 0000000..90e0114
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/nodecount-policy-import.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+echo ""
+echo "Importing policy: dataNodeCountPolicy "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "dataNodeCountPolicy",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from every (e1 = hadoopJmxMetricEventStream[metric == \\\"hadoop.namenode.fsnamesystemstate.numlivedatanodes\\\" ]) -> e2 = hadoopJmxMetricEventStream[metric == e1.metric and host == e1.host and (convert(e1.value, \\\"long\\\") - 5) >= convert(value, \\\"long\\\") ] within 5 min select e1.metric, e1.host, e1.value as highNum, e1.timestamp as start, e2.value as lowNum, e2.timestamp as end insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"node count joggling found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/resourcemanagerhanoactive-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/resourcemanagerhanoactive-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/resourcemanagerhanoactive-policy-import.sh
new file mode 100755
index 0000000..95b9c35
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/resourcemanagerhanoactive-policy-import.sh
@@ -0,0 +1,53 @@
+#
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+
+echo ""
+echo "Importing policy: ResourceManagerHAHasNoActive "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "ResourceManagerHAHasNoActive",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from hadoopJmxMetricEventStream[metric == \\\"hadoop.resourcemanager.hastate.active.count\\\" and value == 0 ]select * insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/resourcemanagerhawithmorethanoneactive-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/resourcemanagerhawithmorethanoneactive-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/resourcemanagerhawithmorethanoneactive-policy-import.sh
new file mode 100755
index 0000000..269003c
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/resourcemanagerhawithmorethanoneactive-policy-import.sh
@@ -0,0 +1,54 @@
+#
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+
+echo ""
+echo "Importing policy: ResourceManagerHAHasMoreThanOneActive "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "ResourceManagerHAHasMoreThanOneActive",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine",
+         "description":" Resource Manager HA Has More than one Active"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from hadoopJmxMetricEventStream[metric == \\\"hadoop.resourcemanager.hastate.active.count\\\" and value > 1 ]select * insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-hadoop-metric/src/main/resources/sanbox/safemodecheck-policy-import.sh
----------------------------------------------------------------------
diff --git a/eagle-hadoop-metric/src/main/resources/sanbox/safemodecheck-policy-import.sh b/eagle-hadoop-metric/src/main/resources/sanbox/safemodecheck-policy-import.sh
new file mode 100755
index 0000000..8f1d14f
--- /dev/null
+++ b/eagle-hadoop-metric/src/main/resources/sanbox/safemodecheck-policy-import.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# 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.
+
+source $(dirname $0)/eagle-env.sh
+source $(dirname $0)/hadoop-metric-init.sh
+
+
+##### add policies ##########
+echo ""
+echo "Importing policy: safeModePolicy "
+curl -u ${EAGLE_SERVICE_USER}:${EAGLE_SERVICE_PASSWD} -X POST -H 'Content-Type:application/json' \
+ "http://${EAGLE_SERVICE_HOST}:${EAGLE_SERVICE_PORT}/eagle-service/rest/entities?serviceName=AlertDefinitionService" \
+ -d '
+ [
+     {
+       "prefix": "alertdef",
+       "tags": {
+         "site": "sandbox",
+         "application": "hadoopJmxMetricDataSource",
+         "policyId": "safeModePolicy",
+         "alertExecutorId": "hadoopJmxMetricAlertExecutor",
+         "policyType": "siddhiCEPEngine"
+       },
+       "description": "jmx metric ",
+       "policyDef": "{\"expression\":\"from hadoopJmxMetricEventStream[component==\\\"namenode\\\" and metric == \\\"hadoop.namenode.fsnamesystemstate.fsstate\\\" and convert(value, \\\"long\\\") > 0]#window.externalTime(timestamp ,10 min) select metric, host, value, timestamp, component, site insert into tmp; \",\"type\":\"siddhiCEPEngine\"}",
+       "enabled": true,
+       "dedupeDef": "{\"alertDedupIntervalMin\":10,\"emailDedupIntervalMin\":10}",
+       "notificationDef": "[{\"notificationType\":\"eagleStore\"},{\"sender\":\"eagle@apache.org\",\"recipients\":\"eagle@apache.org\",\"subject\":\"missing block found.\",\"flavor\":\"email\",\"id\":\"email_1\",\"tplFileName\":\"\"}]"
+     }
+ ]
+ '
+
+ ## Finished
+echo ""
+echo "Finished initialization for eagle topology"
+
+exit 0

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/6a0a11f2/eagle-topology-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-topology-assembly/pom.xml b/eagle-topology-assembly/pom.xml
index 62cf58e..5ac3583 100644
--- a/eagle-topology-assembly/pom.xml
+++ b/eagle-topology-assembly/pom.xml
@@ -69,6 +69,11 @@
             <artifactId>eagle-hadoop-metric</artifactId>
             <version>${project.version}</version>
         </dependency>
+	<dependency>
+            <groupId>eagle</groupId>
+            <artifactId>eagle-gc</artifactId>
+            <version>${project.version}</version>
+        </dependency>
 <dependency>
             <groupId>org.apache.eagle</groupId>
             <artifactId>eagle-alert-notification-plugin</artifactId>


Mime
View raw message