Hemdal Trooper

Elixir CIHex.pm VersionHex DocsHex.pm Total DownloadsLicense: MITPaypal: DonationPatreon: Donation

Hemdal Trooper is an SSH/SFTP host adapter plugin for the Hemdal monitoring and alert system. It allows Hemdal to execute remote checks, run commands in interactive shells with PTY, and upload/manage script files over SSH using Trooper.


Features


Installation

Add hemdal_trooper to your list of dependencies in mix.exs:

def deps do
[
{:hemdal_trooper, "~> 1.3"}
]
end

Configuration Example

Configure remote SSH hosts in your Hemdal configuration:

config :hemdal, Hemdal.Config, [
[
id: "6b6d247c-48c3-4a8c-9b4f-773f178ddc0f",
name: "Remote Web Server Status",
host: [
id: "2a8572d4-ceb3-4200-8b29-dd1f21b50e54",
name: "web-01.production",
module: Hemdal.Host.Trooper,
max_workers: 2,
options: [
hostname: "192.168.1.100",
port: 22,
username: "deploy",
type: "rsa",
cert_key: File.read!("priv/keys/id_rsa"),
ptty_allow: true
]
],
command: [
name: "Check Nginx and Load Average",
type: "line",
command: ~s|"[\\"OK\\", \\"Nginx running\\"]".|
],
check_in_sec: 60,
recheck_in_sec: 5,
broken_recheck_in_sec: 10,
retries: 2
]
]

Host Options

OptionTypeDescription
:hostnameString.t() | tuple()Remote IP or hostname (e.g. "127.0.0.1" or {192, 168, 1, 1}).
:portinteger()SSH port number (default 22).
:usernameString.t()SSH user account.
:typeString.t()Authentication type: "rsa", "ecdsa", or "password".
:cert_keyString.t()PEM formatted private key (RSA or ECDSA).
:passwordString.t()User password or private key passphrase.
:ptty_allowboolean()Allocate pseudo-terminal for interactive commands (default false).
:ptty_optslist()PTY options list passed to SSH.

Documentation

Full documentation is available on HexDocs.


License

This project is licensed under the terms of the MIT License.


Support & Donations

If you find this project useful, you can support its development:

Donate with PayPal