1
0
mirror of https://github.com/TwiN/gatus.git synced 2026-02-04 15:14:43 +00:00

feat(client): Add ssh private-key support (#1390)

* feat(endpoint): Add ssh key support

Fixes #1257

* test(config): Add tests for private key config

---------

Co-authored-by: TwiN <twin@linux.com>
This commit is contained in:
Mufeed Ali
2025-11-20 03:06:36 +05:30
committed by GitHub
parent 5d626f2934
commit 6f9db4107c
7 changed files with 94 additions and 35 deletions

View File

@@ -3048,7 +3048,8 @@ There are two placeholders that can be used in the conditions for endpoints of t
You can monitor endpoints using SSH by prefixing `endpoints[].url` with `ssh://`:
```yaml
endpoints:
- name: ssh-example
# Password-based SSH example
- name: ssh-example-password
url: "ssh://example.com:22" # port is optional. Default is 22.
ssh:
username: "username"
@@ -3062,10 +3063,24 @@ endpoints:
- "[CONNECTED] == true"
- "[STATUS] == 0"
- "[BODY].memory.used > 500"
# Key-based SSH example
- name: ssh-example-key
url: "ssh://example.com:22" # port is optional. Default is 22.
ssh:
username: "username"
private-key: |
-----BEGIN RSA PRIVATE KEY-----
TESTRSAKEY...
-----END RSA PRIVATE KEY-----
interval: 1m
conditions:
- "[CONNECTED] == true"
- "[STATUS] == 0"
```
you can also use no authentication to monitor the endpoint by not specifying the username
and password fields.
you can also use no authentication to monitor the endpoint by not specifying the username,
password and private key fields.
```yaml
endpoints:
@@ -3074,6 +3089,7 @@ endpoints:
ssh:
username: ""
password: ""
private-key: ""
interval: 1m
conditions: