# Hemdal v1.4.0 - Table of Contents

> Hemdal Alarms/Alerts System

## GUIDES

- Introduction
  - [Getting started](getting_started.md)

- Operational
  - [Creating Alerts](creating_alerts.md)
  - [Notifying to Slack and Mattermost](notifying_to_slack.md)

## Modules

- Alert/Alarms Logic
  - [Hemdal](Hemdal.md): Hemdal is a system for Alert/Alarm very customizable. It's based on
[Nagios](https://www.nagios.com) where you have different scripts to check
the status of different elements of your system providing back information
about these checks.
  - [Hemdal.Check](Hemdal.Check.md): Every check performed by Hemdal is based on a state machine which is in
charge of running a command, check the return and based on the return and
if it was successfully executed or not, determine the state of the machine.

- Configuration
  - [Hemdal.Config](Hemdal.Config.md): Hemdal needs to load a configuration to get the checks to be processed,
how to trigger the alerts and how to connect to the systems to perform
the checks.
  - [Hemdal.Config.Alert](Hemdal.Config.Alert.md): Alert entity used for the alert configuration. It is including the following
configuration params
  - [Hemdal.Config.Command](Hemdal.Config.Command.md): The command structure is defining the command to be executed inside of
each alert. The data used is
  - [Hemdal.Config.Host](Hemdal.Config.Host.md): The host information.

  - [Hemdal.Config.MaxWorkers](Hemdal.Config.MaxWorkers.md): Define the max_workers implementation for `Construct`. Supports positive integers and `:infinity`.

  - [Hemdal.Config.Module](Hemdal.Config.Module.md): Defines the type for module in use for the `Hemdal.Config.Notifier` and
`Hemdal.Host` implementations to define which modules will be in use for
each case.

  - [Hemdal.Config.Notifier](Hemdal.Config.Notifier.md): Notifier is in charge of define the amount of notifiers it should be
in use for a notification, and the data to perform the notification.
  - [Hemdal.Config.Options](Hemdal.Config.Options.md): Define the options (`Keyword`) implementation for `Construct`. This way we
can use the `Hemdal.Config.Options` everywhere the `options` entry is
needed.

- Configuration Backend
  - [Hemdal.Config.Backend.Env](Hemdal.Config.Backend.Env.md): Configuration backend reader using the environment or Elixir configuration.
See `Hemdal.Config.Backend` for further information.
  - [Hemdal.Config.Backend.Json](Hemdal.Config.Backend.Json.md): Configuration backend reader using JSON. See `Hemdal.Config.Backend` for
further information.

- Hosts
  - [Hemdal.Host](Hemdal.Host.md): Host is spawning processes to run tasks for the corresponding host. It's
a way of limiting the amount of commands triggered against a host and
ensure the rest of the commands stay in the queue.
  - [Hemdal.Host.Local](Hemdal.Host.Local.md): Implement the host access for the local running commands.
It is intended to run commands locally where the system is.

- Event Producer/Consumers
  - [Hemdal.Event](Hemdal.Event.md): Generate events to be consumed. It's the producer for the events.

  - [Hemdal.Event.Log](Hemdal.Event.Log.md): Consume each event from `Hemdal.Event` and process it to generate a log
via `Logger`.

  - [Hemdal.Event.Mock](Hemdal.Event.Mock.md): Consume the events generated by the system and send all of these events
to the process which run `start_link/0`. The even is `Hemdal.Event.t()`.

  - [Hemdal.Event.Notification](Hemdal.Event.Notification.md): Consume events from `Hemdal.Event` to generate the notifications
via `Hemdal.Notifier`. It's based on the configuration from the
`Hemdal.Config.Notifier` module and based on the configuration
for the `log_level` and the level of the event, it could be
reported or not.

- Notifiers
  - [Hemdal.Notifier](Hemdal.Notifier.md): Notifier implements the base for a notification system which will send
the event or information message to an external service like Slack,
Mattermost, Mailgun, Sendblue, or whatever else provider.
  - [Hemdal.Notifier.Mattermost](Hemdal.Notifier.Mattermost.md): Performs the notification from `Hemdal.Notifier` using Mattermost. It's
using the webhook capability of Slack to send the message to a specific
channel. You can see further information in this link
  - [Hemdal.Notifier.Mock](Hemdal.Notifier.Mock.md): Let us perform tests using a notifier which we can control. It's working
injecting inside of the metadata the PID of the process where the
notification should be triggered.
  - [Hemdal.Notifier.Slack](Hemdal.Notifier.Slack.md): Performs the notification from `Hemdal.Notifier` using Slack. It's using the
webhook capability of Slack to send the message to a specific channel. You
can see further information in this link

