This article will help you get the Ssh plugin for sd-agent configured and returning metrics
Installing the ssh plugin package
Install the ssh plugin on Debian/Ubuntu:
sudo apt-get install sd-agent-ssh-check
Install the ssh plugin on RHEL/CentOS:
sudo yum install sd-agent-ssh-check
Read more about agent plugins.
Configuring the agent to monitor ssh
1. Configure the check in /etc/sd-agent/conf.d/ssh_check.yaml
init_config: instances: - host: $REMOTE_HOST # required username: $USERNAME # required password: $PASSWORD # or use private_key_file # private_key_file: $PATH_TO_PRIVATE_KEY # private_key_type: # rsa or ecdsa; default is rsa # port: 22 # default is port 22 # sftp_check: False # set False to disable SFTP check; default is True # add_missing_keys: True # default is False
2. Restart the agent
sudo /etc/init.d/sd-agent restart
or
sudo systemctl restart sd-agent
Verifying the configuration
Execute info to verify the configuration with the following:
sudo /etc/init.d/sd-agent info
or
/usr/share/python/sd-agent/agent.py info
If the agent has been configured correctly you'll see an output such as:
ssh ----- - instance #0 [OK] - Collected * metrics
You can also view the metrics returned with the following command:
sudo -u sd-agent /usr/share/python/sd-agent/agent.py check ssh_check
Configuring graphs
Click the name of your server from the Devices list in your Server Density account then go to the Metrics tab. Click the + Graph button on the right then choose the ssh metrics to display the graphs. The metrics will also be available to select when building dashboard graphs.
Monitored metrics
Metric | Values |
---|---|
sftp.response_time The response time of SFTP |
second / None Type: float |
Comments