<commit_before>= Alerts Documentation
<NAME>
2015-08-26
:description: This guide will help you to install and configure a standalone Alerts component
:icons: font
:jbake-type: page
:jbake-status: published
:toc: macro
:toc-title:

toc::[]

== Prerequisites

=== Git

Hawkular Alerts is hosted on link:https://github.com/hawkular/hawkular-alerts.git[GitHub] so a git client is
recommended.

=== Java 8

You need a Java Virtual Machine compatible with Java 8.
Hawkular Alerts runs on the OpenJDK or Oracle runtime environment.

Other Java 8 compatible runtime environments _should_ work as well.

=== Maven

Hawkular source code is managed with link:https://maven.apache.org/[Apache Maven]. A minimal version 3.2.x is needed
to build Hawkular Alerts project.

== Installation

=== Build the standalone distribution

Checkout the Hawkular Alerts repo and build the standalone distribution

[source,shell,subs="+attributes"]
----
git clone https://github.com/hawkular/hawkular-alerts.git
cd hawkular-alerts
mvn clean install -Pstandalone
----

TIP: The `-Pstandalone` profile prepares a Wildfly server ready for testing under
`hawkular-alerts-rest-tests/target/wildfly-{wildfly-version}`.

=== Test the installation

Eventually start the server with `$WILDFLY_HOME/bin/standalone.sh`.

[source,shell,subs="+attributes"]
----
cd hawkular-alerts-rest/test/target/wildfly-{wildfly-version}
bin/standalone.sh
----

Test your installation with a query of all demo trigger definitions

[source,shell,subs="+attributes"]
----
curl -X GET -H "Content-Type: application/json" -H "Hawkular-Tenant: 28026b36-8fe4-4332-84c8-524e173a68bf" \
http://localhost:8080/hawkular/alerts/triggers
----

=== Populate initial alerts definitions (Optional)

Hawkular Alerts can be initializaded with triggers definitions at start up.
Init files should be places under `$WILDFLY_HOME/standalone/data/hawkular-alerts` folder.

[[Configuration]]
== Configuration

=== Cassandra backend

Hawkular Alerts relies on https://cassandra.apache.org/[Apache Cassandra] for data storage.

For demo purposes only the standalone distribution uses a pre-packaged and deployable distribution called
embedded-cassandra from https://github.com/hawkular/hawkular-commons[Embedded Cassandra].

A external Cassandra installation can be used overriding `-Dhawkular.backend=external`.

=== Configuration sources

Hawkular Alerts can read configuration from different sources, listed below in order of precedence:

. System property (i.e. `-Dhawkular-alerts.cassandra-nodes=127.0.0.1`)
. Environment variable (i.e `CASSANDRA_NODES=127.0.0.1`)
. External file, in the form of a Java Properties file (i.e `hawkular-alerts.cassandra-nodes=127.0.0.1`)

=== External configuration file

Hawkular Alerts can read configuration file from `<user.home>/.hawkular-alerts.properties`.

=== Parameters and flags

The table below lists the parameters and flags supported.

* The `Name` column is the string form when the option is set in the configuration file or as a system property.
* When the option can be set with an environment variable, the variable name is listed in the `Env` column.

[cols="5,4,4,6", options="header"]
|===
|Name
|Env
|Default
|Description

|hawkular-alerts.cassandra-nodes
|CASSANDRA_NODES
|127.0.0.1
|The list of cluster nodes provided to the Cassandra driver, comma-separated

|hawkular-alerts.cassandra-cql-port
|CASSANDRA_CQL_PORT
|9042
|The CQL port provided to the Cassandra driver

|hawkular-alerts.cassandra-keyspace
|-
|hawkular_alerts
|The keyspace where the data will be stored

|hawkular-alerts.cassandra-retry-attempts
|-
|15
|The number of attempts to connect to Cassandra cluster before it throws an I/O error

|hawkular-alerts.cassandra-retry-timeout
|-
|3000
|The timeout in milliseconds between connection attempt to Cassandra cluster

|hawkular-alerts.engine-delay
|-
|1000
|The delay in milliseconds before the Alerts engine timer starts

|hawkular-alerts.engine-period
|-
|2000
|The period in milliseconds between a new execution of the Alerts engine timer
|===
<commit_msg>Adding back Cassandra versions info<commit_after>= Alerts Documentation
<NAME>
2015-08-26
:description: This guide will help you to install and configure a standalone Alerts component
:icons: font
:jbake-type: page
:jbake-status: published
:toc: macro
:toc-title:

toc::[]

== Prerequisites

=== Git

Hawkular Alerts is hosted on link:https://github.com/hawkular/hawkular-alerts.git[GitHub] so a git client is
recommended.

=== Java 8

You need a Java Virtual Machine compatible with Java 8.
Hawkular Alerts runs on the OpenJDK or Oracle runtime environment.

Other Java 8 compatible runtime environments _should_ work as well.

=== Maven

Hawkular source code is managed with link:https://maven.apache.org/[Apache Maven]. A minimal version 3.2.x is needed
to build Hawkular Alerts project.

== Installation

=== Build the standalone distribution

Checkout the Hawkular Alerts repo and build the standalone distribution

[source,shell,subs="+attributes"]
----
git clone https://github.com/hawkular/hawkular-alerts.git
cd hawkular-alerts
mvn clean install -Pstandalone
----

TIP: The `-Pstandalone` profile prepares a Wildfly server ready for testing under
`hawkular-alerts-rest-tests/target/wildfly-{wildfly-version}`.

=== Test the installation

Eventually start the server with `$WILDFLY_HOME/bin/standalone.sh`.

[source,shell,subs="+attributes"]
----
cd hawkular-alerts-rest/test/target/wildfly-{wildfly-version}
bin/standalone.sh
----

Test your installation with a query of all demo trigger definitions

[source,shell,subs="+attributes"]
----
curl -X GET -H "Content-Type: application/json" -H "Hawkular-Tenant: 28026b36-8fe4-4332-84c8-524e173a68bf" \
http://localhost:8080/hawkular/alerts/triggers
----

=== Populate initial alerts definitions (Optional)

Hawkular Alerts can be initializaded with triggers definitions at start up.
Init files should be places under `$WILDFLY_HOME/standalone/data/hawkular-alerts` folder.

[[Configuration]]
== Configuration

=== Cassandra backend

Hawkular Alerts relies on https://cassandra.apache.org/[Apache Cassandra] for data storage.

For demo purposes only the standalone distribution uses a pre-packaged and deployable distribution called
embedded-cassandra from https://github.com/hawkular/hawkular-commons[Embedded Cassandra].

A external Cassandra installation can be used overriding `-Dhawkular.backend=external`.

IMPORTANT: Cassandra 2.2.0 or later is required. It is recommended to use the latest 2.2.x release if possible.

You may download a distribution zip file from the http://cassandra.apache.org/download/[Apache Cassandra download] page.

You could also use the Datastax community packages for:

* http://docs.datastax.com/en/cassandra/2.2/cassandra/install/installRHEL.html[RHEL-based systems]
* http://docs.datastax.com/en/cassandra/2.2/cassandra/install/installDeb.html[Debian-based systems]
* http://docs.datastax.com/en/cassandra_win/2.2/cassandra/install/installTOC.html[Windows].
* For OS/X you can install Cassandra via http://brew.sh[Homebrew]

=== Configuration sources

Hawkular Alerts can read configuration from different sources, listed below in order of precedence:

. System property (i.e. `-Dhawkular-alerts.cassandra-nodes=127.0.0.1`)
. Environment variable (i.e `CASSANDRA_NODES=127.0.0.1`)
. External file, in the form of a Java Properties file (i.e `hawkular-alerts.cassandra-nodes=127.0.0.1`)

=== External configuration file

Hawkular Alerts can read configuration file from `<user.home>/.hawkular-alerts.properties`.

=== Parameters and flags

The table below lists the parameters and flags supported.

* The `Name` column is the string form when the option is set in the configuration file or as a system property.
* When the option can be set with an environment variable, the variable name is listed in the `Env` column.

[cols="5,4,4,6", options="header"]
|===
|Name
|Env
|Default
|Description

|hawkular-alerts.cassandra-nodes
|CASSANDRA_NODES
|127.0.0.1
|The list of cluster nodes provided to the Cassandra driver, comma-separated

|hawkular-alerts.cassandra-cql-port
|CASSANDRA_CQL_PORT
|9042
|The CQL port provided to the Cassandra driver

|hawkular-alerts.cassandra-keyspace
|-
|hawkular_alerts
|The keyspace where the data will be stored

|hawkular-alerts.cassandra-retry-attempts
|-
|15
|The number of attempts to connect to Cassandra cluster before it throws an I/O error

|hawkular-alerts.cassandra-retry-timeout
|-
|3000
|The timeout in milliseconds between connection attempt to Cassandra cluster

|hawkular-alerts.engine-delay
|-
|1000
|The delay in milliseconds before the Alerts engine timer starts

|hawkular-alerts.engine-period
|-
|2000
|The period in milliseconds between a new execution of the Alerts engine timer
|===

{'fraction_non_alphanumeric': 0.09911242603550297, 'fraction_numerical': 0.021051433773327265, 'mean_word_length': 4.867156208277704, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3518938', 'n_tokens_mistral': 2899, 'n_tokens_neox': 2717, 'n_words': 913}