SSH Nexus

Advanced SSH automation hub with intelligent connection management and network device support. Built with ❤️ by Sarryaz

Overview

The node performs an SSH connection health check to analyze the quality and performance of an SSH connection. It executes a series of predefined commands on the remote system to evaluate responsiveness, uptime, user identity, and overall connection stability. This operation is useful for network administrators and DevOps engineers who want to monitor SSH connectivity reliability and diagnose potential issues proactively.

Typical use cases include:

  • Verifying that SSH access to a server or network device is operational.
  • Measuring response times and success rates of basic SSH commands.
  • Generating a health score to assess connection quality.
  • Integrating SSH health monitoring into automated workflows for alerting or remediation.

Example: A workflow could periodically run this health check against critical servers to ensure they are reachable via SSH and respond within acceptable latency thresholds.

Properties

Name Meaning
Configuration Mode Choose how to configure the SSH connection:
- Use Credentials: Use stored SSH credentials (recommended for security).
- Dynamic Parameters: Use dynamic parameters from previous nodes or environment variables.
Dynamic Host Hostname or IP address for SSH connection (required if using Dynamic Parameters mode). Supports expressions and environment variables.
Dynamic Port SSH port number (default 22) used in Dynamic Parameters mode. Supports expressions and environment variables.
Dynamic Username Username for SSH login (required if using Dynamic Parameters mode). Supports expressions and environment variables.
Dynamic Password Password for SSH login (optional in Dynamic Parameters mode). Supports expressions and environment variables.
Dynamic Private Key Private key content for SSH authentication (optional in Dynamic Parameters mode). Supports expressions and environment variables.
Advanced Options Collection of advanced settings:
- Command Timeout (ms): Max wait time for command completion.
- Output Parsing: How to process command output (smart, JSON, table, raw, none).
- Continue on Error: Whether to continue processing items if some commands fail.
- Cipher Override: Override cipher selection for SSH connection.
- Try Fallback Ciphers: Automatically try alternative ciphers if primary ones fail.
- Retry Delay (ms): Delay between connection retry attempts.
- Verbose Logging: Enable detailed debug logging.
- Line Ending Style: CR+LF (Windows) or LF (Unix) line endings.
- Device Type: Select network device type for optimized handling (generic, Cisco IOS, Aruba OS, Juniper, etc.).

Output

The node outputs a JSON object containing the results of the health check:

  • healthScore: Percentage score representing the success rate of executed test commands.
  • status: Health status string based on the score ("healthy", "degraded", or "unhealthy").
  • totalResponseTime: Total elapsed time in milliseconds for all tests.
  • averageResponseTime: Average response time per command in milliseconds.
  • testResults: Array of individual command test results, each including:
    • command: The command string executed.
    • success: Boolean indicating if the command succeeded.
    • responseTime: Time taken to execute the command.
    • output: Standard output from the command.
    • error (optional): Error message if the command failed.
  • timestamp: ISO timestamp when the health check was performed.
  • connectionInfo: Object with connection details such as host, port, and username.

This structured output allows easy integration with monitoring dashboards or further automated analysis.

Dependencies

  • Requires an active SSH connection to the target host.
  • Supports two configuration modes:
    • Using stored SSH credentials configured in n8n.
    • Using dynamic parameters provided at runtime.
  • Depends on the node-ssh library for SSH communication.
  • Uses internal utilities for parsing SSH output and managing connection options.
  • No external API keys beyond SSH credentials are required.
  • Optional verbose logging can be enabled for troubleshooting.

Troubleshooting

  • Common Issues:

    • Invalid host format or unreachable host: Ensure the hostname/IP is correct and accessible.
    • Authentication failures: Verify SSH credentials or private key correctness.
    • Port out of range: SSH port must be between 1 and 65535.
    • Connection timeout: Increase command timeout or retry delay in advanced options.
    • Cipher mismatch errors: Use cipher override or enable fallback ciphers to handle legacy or uncommon SSH servers.
  • Error Messages:

    • "SSH credentials are required when using credentials mode": Provide valid stored SSH credentials.
    • "Invalid host format": Hostname contains invalid characters; only letters, numbers, dots, and hyphens allowed.
    • "Operation failed for item X": Indicates failure during execution for a specific input item; check error details in output.
    • "Potentially dangerous command detected": Node blocks execution of risky shell commands for safety.
  • Resolution Tips:

    • Enable verbose logging to get detailed connection and command execution logs.
    • Validate all dynamic parameters before running the node.
    • Use the "Continue on Error" option to allow partial success in batch operations.
    • Adjust cipher settings if connection handshake fails due to incompatible algorithms.

Links and References

Discussion