Hawkular Alerts is the alerts module for Hawkular. It is responsible to define conditions rules over data events and fire alerts that can be sent by several action plugins.
Hawkular is a modular systems monitoring suite, that consists of several sub-projects for storing of metrics, alerting on incoming events and more. Those projects are developed in their own GitHub repositories and integrated in this project.
The project is divided into several modules
hawkular-alerts-api |
This is the public Java API for alerts component. |
hawkular-alerts-engine |
This is the implementation of the alerts engine. |
hawkular-alerts-rest |
This is a public REST API for alerts component. |
hawkular-alerts-bus |
This component is responsible for the communication between the alerts engine and the bus. |
hawkular-actions-api |
Common API for action plugins. |
hawkular-actions-email |
Project examples with the skeleton of a action plugin. |
Hawkular Alerts can be easily deployed using Hawkular Bus as main container.
-
Prepare hawkular-bus in your local environment
git clone https://github.com/hawkular/hawkular-bus.git
cd hawkular-bus
mvn clean install -Pdev
Profile -Pdev creates a pre-configured wildfly-8.2.0.Final server with all dependencies needed in
$YOUR_FOLDER/hawkular-bus/hawkular-nest/hawkular-nest-distro/target/wildfly-8.2.0.Final
We will call this wildfly server as $NEST_HOME
-
Prepare hawkular-alerts in your local environment
git clone https://github.com/hawkular/hawkular-alerts.git
cd hawkular-alerts
mvn clean install -Pdev
Profile -Pdev copies hawkular-alerts artifacts into $NEST_HOME.
If hawkular-bus and hawkular-alerts are not in the same folder, you can define the location of wildfly server like:
NEST_HOME=$PATH_TO/hawkular-bus/hawkular-nest/hawkular-nest-distro/target/wildfly-8.2.0.Final
mvn clean install -Pdev -Dorg.hawkular.wildfly.home=$NEST_HOME
-
Start the nest:
cd $NEST_HOME
bin/standalone.sh
Once the nest is up and running we can run the integration tests using -Prest profile:
mvn clean install -Prest
REST API documentation can be generated using -Pdocgen profile.
The doc is generated under hawkular-alerts-rest/target folder.
mvn clean install -Pdocgen
-
Set a DEBUG logger in the nest:
<logger category="org.hawkular.alerts">
<level name="DEBUG"/>
</logger>
-
Use curl to send messages directly to the bus for debugging:
curl -X POST -H "Content-Type: application/json" \
--data "{\"data\" : [ { \"id\": \"NumericData-01\", \"type\" : \"numeric\", \"value\" : 0.1} ]}" \
http://localhost:8080/hawkular-bus/message/HawkularAlertData
curl -X POST -H "Content-Type: application/json" \
--data "{\"data\" : [ { \"id\": \"StringData-01\", \"type\" : \"string\", \"value\" : \"Fred\"} ]}" \
http://localhost:8080/hawkular-bus/message/HawkularAlertData
curl -X POST -H "Content-Type: application/json" \
--data "{\"data\" : [ { \"id\": \"Availability-01\", \"type\" : \"availability\", \"value\" : \"UP\"} ]}" \
http://localhost:8080/hawkular-bus/message/HawkularAlertData
Hawkular-Alerts is released under Apache License, Version 2.0 as described in the LICENSE document
Copyright 2015 Red Hat, Inc.
Licensed 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.