SSH Nexus

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

Overview

The node "SSH Nexus" provides advanced SSH automation capabilities, focusing on executing commands and retrieving system information from remote systems via SSH. The System Information > Process Info operation specifically retrieves the list of running processes on a remote machine by executing the ps aux command over an SSH connection.

This node is beneficial in scenarios where you need to remotely monitor or audit system processes on Linux/Unix servers or network devices that support SSH. For example, it can be used to:

  • Automate process monitoring for server health checks.
  • Integrate process data into workflows for alerting or reporting.
  • Collect process snapshots before and after deployments or changes.

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 of the SSH target (required if using Dynamic Parameters mode). Supports expressions and environment variables.
Dynamic Port SSH port number (default 22) when using Dynamic Parameters mode.
Dynamic Username Username for SSH login (required if using Dynamic Parameters mode). Supports expressions and environment variables.
Dynamic Password Password for SSH login (optional if using private key). Supports expressions and environment variables.
Dynamic Private Key Private key content for SSH authentication (optional if using password). Supports expressions and environment variables.
Advanced Options Collection of optional settings:
- Command Timeout (ms): Max wait time for command execution.
- Output Parsing: How to parse command output (smart, json, table, raw, none).
- Continue on Error: Whether to continue processing other items if one fails.
- Cipher Override: Select cipher algorithms for SSH.
- Try Fallback Ciphers: Automatically try alternative ciphers if primary fail.
- Retry Delay (ms): Delay between connection retries.
- Verbose Logging: Enable detailed debug logs.
- Line Ending Style: CRLF (Windows) or LF (Unix) line endings.
- Device Type: Select device type for optimized handling (generic, Cisco IOS, Aruba OS, etc.).

Output

The output JSON object for the Process Info operation contains the following structure:

  • raw: Raw text output of the ps aux command.
  • lines: Array of non-empty lines from the output.
  • wordCount: Number of words in the output.
  • hasError: Boolean indicating if there was an error parsing output (usually false).
  • stderr: Standard error output from the command (empty string if none).
  • exitCode: Exit code of the command (0 indicates success).
  • parseOutput: The selected output parsing mode.
  • Additional metadata:
    • deviceType: The type of device connected (e.g., generic).

This output provides both raw and parsed forms of the process list, allowing flexible downstream processing. No binary data is produced by this operation.

Dependencies

  • Requires an active SSH server accessible with provided credentials or dynamic parameters.
  • Uses an API key credential or equivalent SSH authentication method configured securely in n8n.
  • Depends on the node-ssh library for SSH connections.
  • Utilizes internal utilities for parsing SSH command output and managing connection options.
  • Optional verbose logging requires console access for debug messages.

Troubleshooting

  • Connection failures: Ensure SSH credentials or dynamic parameters are correct and the target host is reachable on the specified port.
  • Invalid host format: Hostnames must only contain letters, numbers, dots, and hyphens.
  • Port out of range: Ports must be between 1 and 65535.
  • Command timeout: If the command takes longer than the configured timeout, increase the "Command Timeout" setting.
  • Parsing errors: If output parsing fails, try switching the "Output Parsing" option to raw or none.
  • Permission issues: The user must have permission to run ps aux on the remote system.
  • Legacy cipher errors: If connection fails due to cipher mismatch, enable fallback ciphers or select appropriate cipher override options.
  • Continue on Error: Enable this option to allow the node to process remaining items even if some fail.

Common error messages include:

  • "SSH connection failed": Indicates authentication or network issues.
  • "Potentially dangerous command detected": Prevents execution of harmful commands.
  • "Invalid host format" or "Invalid port number": Input validation errors.
  • "Command cannot be empty": Missing required command input.

Resolving these typically involves verifying inputs, adjusting SSH server settings, or modifying advanced options.

Links and References


This summary covers the static analysis of the System Information resource's Process Info operation within the SSH Nexus node implementation.

Discussion