You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: config/endpoint/ssh/ssh.go
+10-7Lines changed: 10 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -8,25 +8,28 @@ var (
8
8
// ErrEndpointWithoutSSHUsername is the error with which Gatus will panic if an endpoint with SSH monitoring is configured without a user.
9
9
ErrEndpointWithoutSSHUsername=errors.New("you must specify a username for each SSH endpoint")
10
10
11
-
// ErrEndpointWithoutSSHPassword is the error with which Gatus will panic if an endpoint with SSH monitoring is configured without a password.
12
-
ErrEndpointWithoutSSHPassword=errors.New("you must specify a password for each SSH endpoint")
11
+
// ErrEndpointWithoutSSHPassword is the error with which Gatus will panic if an endpoint with SSH monitoring is configured without a password or private key.
12
+
ErrEndpointWithoutSSHPassword=errors.New("you must specify a password or private-key for each SSH endpoint")
13
13
)
14
14
15
15
typeConfigstruct {
16
-
Usernamestring`yaml:"username,omitempty"`
17
-
Passwordstring`yaml:"password,omitempty"`
16
+
Usernamestring`yaml:"username,omitempty"`
17
+
Passwordstring`yaml:"password,omitempty"`
18
+
PrivateKeystring`yaml:"private-key,omitempty"`
18
19
}
19
20
20
21
// Validate the SSH configuration
21
22
func (cfg*Config) Validate() error {
22
-
// If there's no username and password, this endpoint can still check the SSH banner, so the endpoint is still valid
23
-
iflen(cfg.Username) ==0&&len(cfg.Password) ==0 {
23
+
// If there's no username, password, or private key, this endpoint can still check the SSH banner, so the endpoint is still valid
0 commit comments