Skip to content

Commit

Permalink
Revamp docs structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ufoscout committed Oct 23, 2019
1 parent 783fb7d commit f161f5b
Show file tree
Hide file tree
Showing 27 changed files with 60 additions and 68 deletions.
8 changes: 0 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,5 @@ TBD
Please verify that all your committed code is formatted with cargo fmt.
The common used format is already defined in `rustfmt.toml` and should not be overridden.

### Pre-Commit Hook
You can automate this check by using the provided `pre-commit` hook which will fail if the
project is not in a correctly formatted state.
You can easily enable it (given that you don't have other pre-commit hooks enabled) by
running the following command from the git root.
```
ln -s ../../src/scripts/devel/pre-commit.sh .git/hooks/pre-commit
```
### Building & Testing
TBD
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,24 @@ and launch:
$ cargo build
```

This will build the entire project and produces executable files in the *src/target/debug* folder.
This will build the entire project and produces executable files in the *target/debug* folder.
It may require from 5 to 10 minutes depending on your hardware.

Alternatively, you can perform a release build with:
```
$ cargo build --release
```

This will produce smaller, highly optimized executables in the *src/target/release* folder.
This will produce smaller, highly optimized executables in the *target/release* folder.
If you intend to run benchmarks, or assess or deploy Tornado in a production environment, this is
the way you should built it.

The elements of the Tornado build process can be grouped into three categories:
- Tornado libraries: Everything not in the the "spike" or "tornado" folder.
These are common Rust libraries used by Tornado, and can be imported by other projects as well.
- Tornado executables: The crates on the "src/tornado" folder generate the Tornado executables. These
- Tornado executables: The crates on the "tornado" folder generate the Tornado executables. These
are what you need to run and deploy Tornado. All these executables are suffixed with *tornado_*.
- Spikes: The crates on the "src/spike" folder generate executables suffixed with *spike_*. These are
- Spikes: The crates on the "spike" folder generate executables suffixed with *spike_*. These are
experimental crates that are not part of the basic Tornado architecture.


Expand All @@ -213,9 +213,9 @@ The elements of the Tornado build process can be grouped into three categories:

To run Tornado, follow the configuration instructions of the Tornado executables provided by
their respective documentation pages:
* [tornado_engine documentation](src/tornado/engine/doc/README.md)
* [tornado_rsyslog_collector documentation](src/tornado/rsyslog_collector/doc/README.md)
* [tornado_web_collector documentation](src/tornado/webhook_collector/doc/README.md)
* [tornado_engine documentation](tornado/engine/README.md)
* [tornado_rsyslog_collector documentation](tornado/rsyslog_collector/README.md)
* [tornado_web_collector documentation](tornado/webhook_collector/README.md)



Expand Down Expand Up @@ -274,92 +274,92 @@ The shortcuts below, organized thematically, will take you to the documentation
### Common Traits and Code

The Common API page describes the API and defines the Event and Action structures.
- [tornado_common_api](src/common/api/doc/README.md)
- [tornado_common_api](common/api/README.md)

The Logger page describes how Tornado logs its own actions.
- [tornado_common_logger](src/common/logger/doc/README.md)
- [tornado_common_logger](common/logger/README.md)



### Collectors

This crate describes the commonalities of all Collector types.
<!-- This page of doc. is very short. -->
- [tornado_collector_common](src/collector/common/doc/README.md)
- [tornado_collector_common](collector/common/README.md)

Describes a collector that receives a MIME email message and generates an Event.
- [tornado_collector_email](src/collector/email/doc/README.md)
- [tornado_collector_email](collector/email/README.md)

This page illustrates the Collector for JSON events using the JMESPath JSON query language.
- [tornado_collector_jmespath](src/collector/jmespath/doc/README.md)
- [tornado_collector_jmespath](collector/jmespath/README.md)

Presents the standard JSON collector that deserializes an unstructured JSON string into an Event.
- [tornado_collector_json](src/collector/json/doc/README.md)
- [tornado_collector_json](collector/json/README.md)


### Engine

The Matcher page describes the structure of the rules used in matching.
<!-- It doesn't describe anything else about the matcher besides the rule structure. -->
- [tornado_engine_matcher](src/engine/matcher/doc/README.md)
- [tornado_engine_matcher](engine/matcher/README.md)



### Executors

This crate describes the commonalities of all Executor types.
<!-- This page of doc. is very short. -->
- [tornado_executor_common](src/executor/common/doc/README.md)
- [tornado_executor_common](executor/common/README.md)

This page describes how the Archive executor writes to log files on locally mounted file systems,
with a focus on configuration.
- [tornado_executor_archive](src/executor/archive/doc/README.md)
- [tornado_executor_archive](executor/archive/README.md)

The Icinga2 executor forwards Tornado Actions to the
[Icinga2 API](https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api).
- [tornado_executor_icinga2](src/executor/icinga2/doc/README.md)
[Icinga2 API](https://icinga.com/docs/icinga2/latest/12-icinga2-api).
- [tornado_executor_icinga2](executor/icinga2/README.md)

The Logger executor simply outputs the whole Action body
to the standard [log](https://crates.io/crates/log) at the _info_ level.
<!-- This page of doc. is very short. -->
- [tornado_executor_logger](src/executor/logger/doc/README.md)
- [tornado_executor_logger](executor/logger/README.md)

The Executor Script page defines how to configure Actions that launch shell scripts.
- [tornado_executor_script](src/executor/script/doc/README.md)
- [tornado_executor_script](executor/script/README.md)



### Network

This page contains high level traits not bound to any specific network technology.
<!-- This page of doc. is very short. -->
- [tornado_network_common](src/network/common/doc/README.md)
- [tornado_network_common](network/common/README.md)

Describes tests that dispatch Events and Actions on a single process without actually making network calls.
<!-- This page of doc. is very short. -->
- [tornado_network_simple](src/network/simple/doc/README.md)
- [tornado_network_simple](network/simple/README.md)



### Executables

Describes the structure of the Tornado binary executable, and the structure and configuration of many of its components.
- [tornado_engine](src/tornado/engine/doc/README.md)
- [tornado_engine](tornado/engine/README.md)

An executable that processes incoming emails and generates Tornado Events.
- [tornado_email_collector](src/tornado/email_collector/doc/README.md)
- [tornado_email_collector](tornado/email_collector/README.md)

An executable that subscribes to Icinga2 Event Streams API and generates Tornado Events.
- [tornado_icinga2_collector](src/tornado/icinga2_collector/doc/README.md)
- [tornado_icinga2_collector](tornado/icinga2_collector/README.md)

The description of a binary executable that generates Tornado Events from _rsyslog_ inputs.
- [tornado_rsyslog_collector](src/tornado/rsyslog_collector/doc/README.md)
- [tornado_rsyslog_collector](tornado/rsyslog_collector/README.md)

A Perl trap handler for Net-SNMP's to subscribe to snmptrapd events.
- [tornado_snmptrapd_collector](src/tornado/snmptrapd_collector/doc/README.md)
- [tornado_snmptrapd_collector](tornado/snmptrapd_collector/README.md)

A standalone HTTP server binary executable that listens for REST calls from a generic Webhook.
- [tornado_webhook_collector](src/tornado/webhook_collector/doc/README.md)
- [tornado_webhook_collector](tornado/webhook_collector/README.md)


### License
Expand Down
16 changes: 8 additions & 8 deletions RUN_WITH_CARGO_MAKE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ For more information about cargo-make functionalities and installation options,
[refer to its documentation](https://github.com/sagiegurari/cargo-make).

## Configuration
The run configuration is in the _src/Makefile.toml_ which is the default configuration
The run configuration is in the _Makefile.toml_ which is the default configuration
file used by cargo-make.

Into this file, each Tornado executable has its own run task.
Expand All @@ -28,7 +28,7 @@ to launch the executable.


## Start Tornado Engine
To start the [tornado_engine](src/tornado/engine/doc/README.md), enter the _src_ folder and run:
To start the [tornado_engine](tornado/engine/README.md), enter the _src_ folder and run:

```bash
cargo make run-engine
Expand All @@ -39,7 +39,7 @@ on the UDS path _/tmp/tornado_.


## Start Tornado Icinga2 Collector
To start the [tornado_icinga2_collector](src/tornado/icinga2_collector/doc/README.md),
To start the [tornado_icinga2_collector](tornado/icinga2_collector/README.md),
enter the _src_ folder and run:

```bash
Expand All @@ -52,7 +52,7 @@ For each incoming Icinga2 Event, it will send a Tornado Event on the UDS path _/


## Start Tornado Webhook Collector
To start the [tornado_webhook_collector](src/tornado/webhook_collector/doc/README.md),
To start the [tornado_webhook_collector](tornado/webhook_collector/README.md),
enter the _src_ folder and run:

```bash
Expand All @@ -64,12 +64,12 @@ For each incoming webhook message, it will send a Tornado Event on the UDS path


## Start Tornado Rsyslog Collector
The [tornado_rsyslog_collector](src/tornado/rsyslog_collector/doc/README.md)
The [tornado_rsyslog_collector](tornado/rsyslog_collector/README.md)
is be managed by the
[Rsyslog omprog module](https://www.rsyslog.com/doc/v8-stable/configuration/modules/omprog.html).
[Rsyslog omprog module](https://www.rsyslog.com/v8-stable/configuration/modules/omprog.html).

To simplify local testing, a spike that produces fake rsyslog events was developed
(see ./src/spike/rsyslog_collector_writer). This fake rsyslog starts the
(see ./spike/rsyslog_collector_writer). This fake rsyslog starts the
rsyslog_collector and forwards fake events to it. Consequently, the
collector will generate Tornado Events and forward them to the Engine.

Expand All @@ -85,7 +85,7 @@ The collector will send Tornado Events on the UDS path _/tmp/tornado_.

## Start fake snmptrapd
A spike that produces fake snmptrapd events is available for local testing
(see ./src/spike/snmptrapd_collector_writer). This fake snmptrapd
(see ./spike/snmptrapd_collector_writer). This fake snmptrapd
generates fake events and forwards them directly to the Engine
on the UDS path _/tmp/tornado_snmptrapd_.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Email Collector Executable is built on
On startup, it creates a [UDS](https://en.wikipedia.org/wiki/Unix_domain_socket)
socket where it listens for incoming email messages.
Each email published on the socket is processed by the embedded
[email collector](../../../collector/email/doc/README.md)
[email collector](../../collector/email/README.md)
to produce Tornado Events which are, finally, forwarded to the
Tornado Engine's TCP address.

Expand Down Expand Up @@ -47,7 +47,7 @@ configured to notify procmail whenever it receives new email.
For additional information about how incoming email is processed and
the structure of the generated Event, check the documentation specific to the
embedded
[email collector](../../../collector/email/doc/README.md).
[email collector](../../collector/email/README.md).

Note that the Email Collector will support any email client that works with the
MIME format and UDS sockets.
Expand Down Expand Up @@ -82,7 +82,7 @@ file _'config-dir'/email_collector.toml_:
- **uds_path**: The Unix Socket path on which the collector will listen for incoming emails.

More information about the logger configuration
[is available here](../../../common/logger/doc/README.md).
[is available here](../../common/logger/README.md).

The default __config-dir__ value can be customized at build time by specifying
the environment variable *TORNADO_EMAIL_COLLECTOR_CONFIG_DIR_DEFAULT*.
Expand Down
22 changes: 11 additions & 11 deletions tornado/engine/doc/README.md → tornado/engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ file _'config-dir'/tornado.toml_:
- **web_server_port**: The port where the Tornado Web Server will listen for HTTP requests.


More information about the logger configuration is available [here](../../../common/logger/doc/README.md).
More information about the logger configuration is available [here](../../common/logger/README.md).

The default __config-dir__ value can be customized at build time by specifying
the environment variable *TORNADO_CONFIG_DIR_DEFAULT*.
Expand Down Expand Up @@ -113,7 +113,7 @@ directory in order to build the processing tree.

### Structure and Configuration: The JSON Collector

The [JSON collector](../../../collector/json/doc/README.md)
The [JSON collector](../../collector/json/README.md)
receives Events in JSON format and passes them to the matcher engine.

The events to be delivered to the JSON collector are published on the TCP port
Expand All @@ -130,7 +130,7 @@ If not specified, Tornado will use the default value `127.0.0.1:4747`.

### Structure and Configuration: The Matching Engine

The [matching engine](../../../engine/matcher/doc/README.md) is the core of the Tornado Engine.
The [matching engine](../../engine/matcher/README.md) is the core of the Tornado Engine.
It receives Events from the collectors, processes them with the configured Rules, and, in case
of a match, generates the Actions to be performed.

Expand Down Expand Up @@ -207,13 +207,13 @@ happens, the matcher process will pass the __Event__ to the filter's children, o
will ignore them.

More information and examples about the processing tree configuration and runtime behavior can
be found in the [matching engine documentation](../../../engine/matcher/doc/README.md)
be found in the [matching engine documentation](../../engine/matcher/README.md)



### Structure and Configuration: The Archive Executor

The [archive executor](../../../executor/archive/doc/README.md) processes and executes Actions
The [archive executor](../../executor/archive/README.md) processes and executes Actions
of type "archive". This executor configuration is specified in the `archive_executor.toml`
file in the Tornado config folder.

Expand All @@ -235,13 +235,13 @@ file_cache_ttl_secs = 1
```

More details about the meaning of each entry and how the archive executor functions can be found
in the [executor documentation](../../../executor/archive/doc/README.md).
in the [executor documentation](../../executor/archive/README.md).



### Structure and Configuration: The Icinga2 Executor

The [Icinga2 executor](../../../executor/icinga2/doc/README.md) processes and executes Actions
The [Icinga2 executor](../../executor/icinga2/README.md) processes and executes Actions
of type "icinga2". The configuration for this executor is specified in the `icinga2_client_executor.toml`
file into the Tornado config folder.

Expand All @@ -258,25 +258,25 @@ The icinga2_client_executor.toml has the following configuration options:
- __disable_ssl_verification__: If true, the client will not verify the SSL certificate of the Icinga2 server.

More details about the executor can be found in the
[Icinga2 executor documentation](../../../executor/icinga2/doc/README.md).
[Icinga2 executor documentation](../../executor/icinga2/README.md).



### Structure and Configuration: The Script Executor

The [script executor](../../../executor/script/doc/README.md) processes and executes Actions
The [script executor](../../executor/script/README.md) processes and executes Actions
of type "script".

This executor has no specific configuration, since everything required for script execution is
contained in the Action itself as described in the
[executor documentation](../../../executor/script/doc/README.md)
[executor documentation](../../executor/script/README.md)


## Tornado API
The Tornado API endpoints allow to interact with a Tornado instance.

More details about the API can be found in the
[Tornado backend documentation](../../../ui/backend/doc/README.md).
[Tornado backend documentation](../engine_api/README.md).


## Self-Monitoring API
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The Icinga2 collector executable is built on

On startup, it connects to an existing [Icinga2 Server API](https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api/) and subscribes to user defined [Event Streams](https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api/#event-streams).
Each Icinga2 Event published on the stream, is processed by the embedded
[jmespath collector](../../../collector/jmespath/doc/README.md)
[jmespath collector](../../collector/jmespath/README.md)
that uses them to produce Tornado Events which are, finally, forwarded to the
Tornado Engine's TCP address.

Expand All @@ -27,7 +27,7 @@ For each stream, you must provide two values in order to successfully create a s
Additional information about the filter can be found in the [official documentation](https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api/#event-stream-filter).
- *collector_config*: The transformation logic that converts an Icinga2 Event into a Tornado
Event. It consists of a JMESPath collector configuration as described in its
[specific documentation](../../../collector/jmespath/doc/README.md).
[specific documentation](../../collector/jmespath/README.md).

__Note__: Based on the [Icinga2 Event Streams documentation](https://icinga.com/docs/icinga2/latest/doc/12-icinga2-api/#event-streams), multiple HTTP clients can use the same queue name as long as they use the same event types and filter.

Expand Down Expand Up @@ -81,7 +81,7 @@ file _'config-dir'/icinga2_collector.toml_:
milliseconds to wait before a new connection attempt.

More information about the logger configuration
[is available here](../../../common/logger/doc/README.md).
[is available here](../../common/logger/README.md).

The default __config-dir__ value can be customized at build time by specifying
the environment variable *TORNADO_ICINGA2_COLLECTOR_CONFIG_DIR_DEFAULT*.
Expand Down Expand Up @@ -143,4 +143,4 @@ Icinga2 Event in the payload with key 'icinga2_event'.

The Event creation logic is handled internally by the JMESPath collector, a
detailed description of which is available in its
[specific documentation](../../../collector/jmespath/doc/README.md).
[specific documentation](../../collector/jmespath/README.md).
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ file _'config-dir'/rsyslog_collector.toml_:
When the buffer is full, the collector will start discarding older messages first.

More information about the logger configuration is available
[here](../../../common/logger/doc/README.md).
[here](../../common/logger/README.md).

The default __config-dir__ value can be customized at build time by specifying
the environment variable *TORNADO_RSYSLOG_COLLECTOR_CONFIG_DIR_DEFAULT*.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ To test the collector, verify that snmptrapd is installed on the machine and
follow the collector configuration instructions above.

As a prerequisite, the Tornado Engine should be up and running on the same machine
([See the dedicated Tornado engine documentation](../../engine/doc/README.md)).
([See the dedicated Tornado engine documentation](../engine/README.md)).

In addition the _snmptrap_ tool is required to send fake snmptrapd messages.

Expand Down
Loading

0 comments on commit f161f5b

Please sign in to comment.