Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into mazz/agent-0.0.8
Browse files Browse the repository at this point in the history
Conflicts:
	pom.xml
  • Loading branch information
jmazzitelli committed Jun 2, 2015
2 parents b92864d + 90491b1 commit 464bbcc
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 54 deletions.
5 changes: 0 additions & 5 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,6 @@
<artifactId>hawkular-alerts-ear</artifactId>
<type>ear</type>
</dependency>
<dependency>
<groupId>org.hawkular.alerts</groupId>
<artifactId>example-alerts-ui</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>org.hawkular.alerts</groupId>
<artifactId>hawkular-actions-email</artifactId>
Expand Down
14 changes: 12 additions & 2 deletions dist/src/main/resources/wildfly/patches/standalone.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
xmlns:ds="urn:jboss:domain:datasources:2.0"
xmlns:ra="urn:jboss:domain:resource-adapters:2.0"
xmlns:ejb3="urn:jboss:domain:ejb3:2.0"
xmlns:logging="urn:jboss:domain:logging:2.0"
version="2.0"
exclude-result-prefixes="xalan ds ra ejb3">

Expand Down Expand Up @@ -117,7 +116,8 @@
</xsl:template>

<!-- set the console log level -->
<xsl:template match="logging:console-handler[@name='CONSOLE']/logging:level">
<xsl:template match="logging:console-handler[@name='CONSOLE']/logging:level"
xmlns:logging="urn:jboss:domain:logging:2.0">
<xsl:choose>
<xsl:when test="$kettle.build.type='dev'"><level name="DEBUG"/></xsl:when>
<xsl:otherwise><level name="INFO"/></xsl:otherwise>
Expand Down Expand Up @@ -834,6 +834,16 @@
<xsl:value-of select="$uuid.hawkular.accounts.backend"/>
</credential>
</secure-deployment>
<secure-deployment name="hawkular-alerts-rest.war">
<realm>hawkular</realm>
<resource>hawkular-accounts-backend</resource>
<use-resource-role-mappings>true</use-resource-role-mappings>
<enable-cors>true</enable-cors>
<enable-basic-auth>true</enable-basic-auth>
<credential name="secret">
<xsl:value-of select="$uuid.hawkular.accounts.backend"/>
</credential>
</secure-deployment>
</subsystem>
</xsl:copy>
</xsl:template>
Expand Down
11 changes: 3 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@
<version.org.hawkular.accounts>1.0.4</version.org.hawkular.accounts>
<version.org.hawkular.agent>0.0.8</version.org.hawkular.agent>
<version.org.hawkular.alerts>1.0.0-SNAPSHOT</version.org.hawkular.alerts>
<version.org.hawkular.agent>0.0.8</version.org.hawkular.agent>
<version.org.hawkular.alerts>0.0.4</version.org.hawkular.alerts>
<version.org.hawkular.availCreator>${project.version}</version.org.hawkular.availCreator>
<version.org.hawkular.bus>0.0.6</version.org.hawkular.bus>
<version.org.hawkular.console>${project.version}</version.org.hawkular.console>
<version.org.hawkular.inventory>0.0.7</version.org.hawkular.inventory>
<version.org.hawkular.inventory>0.0.9</version.org.hawkular.inventory>
<version.org.hawkular.metrics>0.3.2-SNAPSHOT</version.org.hawkular.metrics>
<version.org.hawkular.nest>0.0.6</version.org.hawkular.nest>
<version.org.hawkular.pinger>${project.version}</version.org.hawkular.pinger>
Expand Down Expand Up @@ -141,13 +143,6 @@
<type>ear</type>
</dependency>

<dependency>
<groupId>org.hawkular.alerts</groupId>
<artifactId>example-alerts-ui</artifactId>
<version>${version.org.hawkular.alerts}</version>
<type>war</type>
</dependency>

<dependency>
<groupId>org.hawkular</groupId>
<artifactId>hawkular-avail-creator</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions ui/console/src/main/scripts/bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawkular-console",
"version": "0.1.5",
"version": "0.1.6",
"private": true,
"keywords": [
"hawtio hawkular console"
Expand All @@ -22,8 +22,8 @@
"bootstrap-select": "1.6",
"d3": "3.4.8",
"event-drops": "0.1.1",
"hawkular-charts": "0.3.0",
"hawkular-ui-services": "0.2.5",
"hawkular-charts": "0.3.2",
"hawkular-ui-services": "0.3.0",
"hawtio-core-navigation": "2.0.39",
"hawtio-core": "2.0.16",
"hawtio-template-cache": "2.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h4 class="modal-title">Alert Settings</h4>
<div class="form-group">
<label class="col-md-3 control-label" for="email">Email</label>
<div class="col-md-6">
<input type="text" id="email" class="form-control" ng-model="mas.trigger_thres.actions[0]"
<input type="text" id="email" class="form-control" ng-model="mas.trigger_thres.actions.email[0]"
ng-change="mas.alertSettingTouch()">
<span class="help-block">Send alerts to this email address.</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,19 @@ <h3 class="pull-left" data-toggle="tooltip" data-placement="top" title="" data-o
<div class="hk-info-top clearfix">
<h3 class="pull-left">Metrics</h3>
<div class="hk-update pull-right">
<button class="btn btn-link hk-chart-update" tooltip-trigger tooltip-placement="top" tooltip="Update chart"><i class="fa fa-refresh"></i></button>
<button ng-click="vm.refreshAvailPageNow(vm.getRawMetricId())" class="btn btn-link hk-chart-update" tooltip-trigger tooltip-placement="top" tooltip="Update chart"><i class="fa fa-refresh"></i></button>
</div>
</div>

<div class="panel panel-default hk-graph">
<h2>Availability</h2>
<img src="img/graph-availability.png" alt="graph" width="944" height="197">
<availability-chart
data="{{vm.availabilityDataPoints}}"
chart-type="availability">
</availability-chart>

</div>
<!--<div class="panel panel-default graph">-->
<!--<div class="update pull-right" ng-show="vm.availabilityDataPoints.length > 0" >-->
<!--<i class="fa fa-clock-o"></i><a ng-click="vm.refreshAvailPageNow(vm.getRawMetricId())"><strong>Last update</strong> 20 seconds ago</a>-->
<!--</div>-->

<!--<h2>Avail points: {{vm.availabilityDataPoints.length}}</h2>-->
<!--<availability-chart-->
<!--data="{{vm.availabilityDataPoints}}"-->
<!--chart-type="availability"-->
<!--chart-height="250">-->
<!--</availability-chart>-->
<!--</div>-->

</section>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -140,23 +140,21 @@ module HawkularMetrics {
}, metricsIds).$promise;

/// For right now we will just Register a couple of metrics automatically
return createMetric(metrics[0])
.then(createMetric(metrics[1]), errMetric)
return this.$q.all([createMetric(metrics[0]), createMetric(metrics[1])])
.then(associateResourceWithMetrics, errMetric)
.catch('Error associating metrics with resource.');
// .catch(err('Error adding availability.'));
.catch((e) => err(e, 'Error associating metrics with resource.'));
})

// Find if a default email exists
.then(() => this.HawkularAlertsManager.addEmailAction(defaultEmail),
(e) => err(e, 'Error during saving metrics.'))

// Create threshold trigger for newly created metrics
.then(() => this.HawkularAlertsManager.createTrigger(currentTenantId + '/' + metricId + '_trigger_thres', true, 'THRESHOLD', defaultEmail),
.then(() => this.HawkularAlertsManager.createTrigger(metricId + '_trigger_thres', true, 'THRESHOLD', defaultEmail),
(e) => err(e, 'Error saving email action.'))

// Create availability trigger for newly created metrics
.then((alert) => this.HawkularAlertsManager.createTrigger(currentTenantId + '/' + metricId + '_trigger_avail', false, 'AVAILABILITY', defaultEmail),
.then((alert) => this.HawkularAlertsManager.createTrigger(metricId + '_trigger_avail', false, 'AVAILABILITY', defaultEmail),
(e) => err(e, 'Error saving threshold trigger.'))

//this.$location.url('/hawkular/' + metricId);
Expand Down Expand Up @@ -248,18 +246,36 @@ module HawkularMetrics {

class DeleteResourceModalController {

static $inject = ['$scope', '$rootScope', '$modalInstance', 'HawkularInventory', 'resource'];
static $inject = ['$scope', '$rootScope', '$modalInstance', '$q', 'HawkularInventory', 'resource'];

constructor(private $scope, private $rootScope, private $modalInstance: any, private HawkularInventory, public resource) {
constructor(private $scope: any,
private $rootScope: any,
private $modalInstance: any,
private $q: ng.IQService,
private HawkularInventory,
public resource) {
$scope.vm = this;
}

deleteResource() {
this.HawkularInventory.Resource.delete({
tenantId: this.$rootScope.currentPersona.id,
environmentId: globalEnvironmentId,
resourceId: this.resource.id
}).$promise.then((res) => {
var metricsIds: string[] = [this.resource.id + '.status.duration', this.resource.id + '.status.code'];
var deleteMetric = (metricId: string) =>
this.HawkularInventory.Metric.delete({
tenantId: this.$rootScope.currentPersona.id,
environmentId: globalEnvironmentId,
metricId: metricId
}).$promise;

var removeResource = () =>
this.HawkularInventory.Resource.delete({
tenantId: this.$rootScope.currentPersona.id,
environmentId: globalEnvironmentId,
resourceId: this.resource.id
}).$promise;

this.$q.all([deleteMetric(metricsIds[0]), deleteMetric(metricsIds[1])])
.then(removeResource)
.then((res) => {
toastr.success('The site ' + this.resource.properties.url + ' is no longer being monitored.');
this.$modalInstance.close(res);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ module HawkularMetrics {
id: triggerName,
description: 'Created on ' + Date(),
firingMatch: 'ALL',
safetyMatch: 'ALL',
autoResolveMatch: 'ALL',
enabled: enabled,
safetyEnabled: false,
actions: [email]
autoResolve: false,
actions: {email: [email]}
}).$promise.then((trigger)=> {

triggerId = trigger.id;
Expand Down Expand Up @@ -98,6 +98,7 @@ module HawkularMetrics {

getAction(email: string): ng.IPromise<void> {
return this.HawkularAlert.Action.get({
pluginId: 'email',
actionId: email
}).$promise;
}
Expand All @@ -112,15 +113,14 @@ module HawkularMetrics {
}

addEmailAction(email: string): ng.IPromise<void> {
return this.getAction(email).then((data: any)=> {
return this.getAction(email).then((promiseValue: any) => {
return promiseValue;
}, (reason: any) => {
// Create a default email action
this.$log.debug('Action', data, ' for email ', email);
if (!data.actionId) {
if (reason.status === 404) {
this.$log.debug('Action does not exist, creating one');
return this.createAction(email);
}

this.$log.debug('Action does already exist');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ module HawkularMetrics {
this.saveProgress = true;
var isError = false;
// Check if email action exists
this.HawkularAlertsManager.addEmailAction(this.trigger_thres.actions[0]).then(()=> {
this.HawkularAlertsManager.addEmailAction(this.trigger_thres.actions.email[0]).then(()=> {
if(!angular.equals(this.alertSetupBackup.trigger_thres, this.trigger_thres)) {
return this.HawkularAlertsManager.updateTrigger(this.trigger_thres.id, this.trigger_thres);
}
Expand Down

0 comments on commit 464bbcc

Please sign in to comment.