SSH
Monitor SSH/SFTP services and report data to Guance.
Configuration¶
Collector Configuration¶
Go to the conf.d/samples directory under the DataKit installation directory, copy ssh.conf.sample and name it ssh.conf. Examples are as follows:
### You need to configure an [[inputs.ssh]] for each ssh/sftp to be monitored.
### host: ssh/sftp service ip:port, if "127.0.0.1", default port is 22.
### interval: monitor interval, the default value is "60s".
### username: the user name of ssh/sftp.
### password: the password of ssh/sftp. optional
### sftpCheck: whether to monitor sftp.
### privateKeyFile: rsa file path.
### metricsName: the name of metric, default is "ssh"
[[inputs.ssh]]
interval = "60s"
host = "127.0.0.1:22"
username = "<your_username>"
password = "<your_password>"
sftpCheck = false
privateKeyFile = ""
[inputs.ssh.tags]
# some_tag = "some_value"
# more_tag = "some_other_value"
# ...
After configuration, restart DataKit.
The collector can now be turned on by configMap injection collector configuration.
Metric¶
For all of the following data collections, a global tag named host is appended by default (the tag value is the host name of the DataKit), or other tags can be specified in the configuration by [inputs.ssh.tags]:
ssh¶
| Tags & Fields | Description |
|---|---|
| sftp_check | SFTP service status Type: bool | (gauge) Unit: - |
| sftp_response_time | Response time of sftp service Type: float | (gauge) Unit: time,ms |
| ssh_check | SSH service status Type: bool | (gauge) Unit: N/A |