Skip to main content

Sshcheck Receiver

Status Available in: contrib Maintainers: @ishaish103 Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

Prerequisites

If ignore_host_key is not set then host key validation requires the agent either have a known_hosts file at a path specified by setting known_hosts or at default paths indicated by ssh man pages: $HOME/.ssh/known_hosts or /etc/ssh/known_hosts.

Configuration

Note: This receiver was renamed from sshcheck to ssh_check to match the snake_case naming convention. The deprecated component type sshcheck is still accepted as an alias and will log a deprecation warning.
The following settings are required:
  • endpoint
  • username
  • password or key_file
Either password or key_file must be set. But if both are set then password is treated as the passphrase and the key is assumed to be encrypted. The following settings are optional:
  • collection_interval (default = 60s): This receiver collects metrics on an interval. Valid time units are ns, us (or µs), ms, s, m, h.
  • known_hosts (default = ssh defaults): The path to the known_hosts file. If this isn’t set then default locations are checked at $HOME/.ssh/known_hosts and /etc/ssh/known_hosts.
  • ignore_host_key (default = false): Can override conventional ssh security for use cases like tests where authentication via the known_hosts file isn’t required.

Example Configuration

Basic SSH check with password authentication:
SSH check with key file authentication:
SSH check with SFTP monitoring enabled:
Production-ready configuration with processors and exporters:
The full list of settings exposed for this receiver are documented in config.go with detailed sample configurations in testdata/config.yaml.

Advanced Configuration

Timeout Configuration

The timeout option controls how long the receiver waits for an SSH connection to establish. The default is 10s. This timeout applies to both SSH and SFTP connection attempts.

SFTP Check Configuration

SFTP checks can be enabled in two ways:
  1. Using the check_sftp option (enables SFTP status and duration metrics):
  1. By enabling SFTP metrics individually:
When check_sftp is enabled or SFTP metrics are individually enabled, the receiver will attempt to establish an SFTP connection after a successful SSH connection. Note that SFTP checks require a successful SSH connection first (see Limitations section).

Metric Enable/Disable Configuration

Individual metrics can be enabled or disabled using the metrics configuration section. By default, all SSH metrics are enabled and all SFTP metrics are disabled.
See metadata.yaml for the complete list of available metrics and their default states.

Known Hosts Configuration

The known_hosts option specifies the path to the SSH known_hosts file for host key validation. If not specified, the receiver checks default locations:
  • $HOME/.ssh/known_hosts
  • /etc/ssh/known_hosts

Security Considerations

The ignore_host_key option disables host key validation. This should only be used in test environments as it makes the connection vulnerable to man-in-the-middle attacks.
For production use, always configure proper host key validation using known_hosts or ensure the host key is in the default known_hosts locations.

Warnings

Security

  • Authentication: Passwords in configuration files should be stored securely. Consider using environment variables or secret management systems. Key file authentication is recommended for production use.

Performance

  • Connection Overhead: Each check creates a new SSH connection. The collection_interval should be configured based on your monitoring needs and the impact on the SSH server. More frequent checks (e.g., every 10 seconds) will create more connections.
  • Timeout Behavior: If a connection times out, it will be retried on the next collection interval. Ensure your timeout value is appropriate for your network conditions.

Feature Gates

This receiver does not currently use any feature gates. All functionality is available through configuration options.

Metrics

This receiver produces the following metrics:

Resource Attributes

The receiver adds the following resource attribute:
  • ssh.endpoint: The full SSH endpoint being monitored (disabled by default, can be enabled in metadata.yaml)

Detailed Metric Documentation

Complete details about the metrics produced by this receiver, including attributes, types, and units, can be found in documentation.md and metadata.yaml.

Metrics

Attributes

Resource Attributes

Configuration

Example Configuration


Last generated: 2026-08-24