Skip to content

Repository files navigation

Hemdal Alerts/Alarms Panel

Elixir CI Hex.pm Version Hex Docs Hex.pm Total Downloads License: MIT Last Updated Paypal: Donation Patreon: Donation

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.
  • 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):
  • 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.

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

Donate with PayPal

Enjoy!

About

Hemdal Alarms/Alerts System

Topics

Resources

Code of conduct

Contributing

Stars

5 stars

Watchers

4 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages