API Reference Hemdal v1.0.0

modules

Modules

Hemdal is a system for Alert/Alarm very customizable. It's based on Nagios where you have different scripts to check the status of different elements of your system providing back information about these checks.

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.

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.

Alert entity used for the alert configuration. It is including the following configuration params

The command structure is defining the command to be executed inside of each alert. The data used is

Configuration backend reader using the environment or Elixir configuration. See Hemdal.Config.Backend for further information.

Configuration backend reader using JSON. See Hemdal.Config.Backend for further information.

The host information.

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.

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.

Define the options (Keyword) implementation for Construct. This way we can use the Hemdal.Config.Options everywhere the options entry is needed.

Generate events to be consumed. It's the producer for the events.

Consume each event from Hemdal.Event and process it to generate a log via Logger.

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().

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.

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.

Implement the host access for the local running commands. It is intended to run commands locally where the system is.

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.

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

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.

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