Hemdal Alerts/Alarms Panel
Hemdal is an extensible alerts and alarms monitoring library for Elixir applications. It proactively monitors local and remote hosts, evaluates health check rules, tracks state transitions, and sends notifications when issues or recoveries occur.
Features
- Extensible Host Execution (
Hemdal.Host):- Execute checks locally (
Hemdal.Host.Local) or remotely via SSH/PTY/SFTP with Trooper. - Proactive connections without requiring agent installations on target servers.
- Worker pooling with dynamic concurrency limits (
max_workers) and queue draining.
- Execute checks locally (
- Robust State Machine (
Hemdal.Check):- Manages check lifecycles with configurable check intervals, recheck intervals, and retry thresholds.
- States:
:normal(OK),:failing(WARN),:broken(FAIL), and:disabled(OFF).
- Event Pipeline (
Hemdal.Event):- Built with GenStage for reliable event production and consumption.
- Logging consumer (
Hemdal.Event.Log) and notification dispatcher (Hemdal.Event.Notification).
- Integrated Notifiers (
Hemdal.Notifier):- Ready-to-use integrations for Slack and Mattermost.
- Easy-to-implement behaviour for custom notification channels (Email, Webhooks, Telegram, PagerDuty, etc.).
- Flexible Configuration Backends (
Hemdal.Config):- Read configuration from Elixir Application Environment (
Env) or JSON files (Json). - Supports dynamic configuration reloads at runtime via
Hemdal.reload_all/0.
- Read configuration from Elixir Application Environment (
Installation
Add hemdal to your list of dependencies in mix.exs:
def deps do
[
{:hemdal, "~> 1.2"}
]
end
Quick Example
Configure your hosts and alert checks in config/config.exs:
import Config
config :hemdal, :config_module, Hemdal.Config.Backend.Env
config :hemdal, Hemdal.Config, [
[
id: "disk-space-check",
name: "Disk Space Check",
host: [
id: "localhost-node",
name: "localhost",
module: Hemdal.Host.Local,
max_workers: 2
],
command: [
name: "check_disk",
type: "line",
command: "df -h / | awk 'NR==2 {print $5}'"
],
check_in_sec: 60,
recheck_in_sec: 10,
retries: 3,
notifiers: [
[
module: Hemdal.Notifier.Slack,
token: "https://hooks.slack.com/services/YOUR/WEBHOOK/URL",
channel: "#monitoring",
username: "HemdalBot"
]
]
]
]
Documentation
Full documentation and guides are available on HexDocs:
License
This project is licensed under the terms of the MIT License.
Contributing & Support
- Open an issue or pull request on GitHub.
- Please adhere to our Code of Conduct and review our Contributing Guidelines.
- If you find Hemdal helpful, consider supporting the project:
Enjoy!