Net Devices icon

Net Devices

Manage network devices via SSH

Overview

The "Net Devices" node enables managing network devices via SSH by executing various operations such as sending commands, sending configuration commands, retrieving the running configuration, saving the configuration, and rebooting the device. It is designed to automate network device management tasks within workflows, making it useful for network administrators who want to integrate device control into automated processes.

Common scenarios include:

  • Retrieving device status or configuration information.
  • Applying configuration changes programmatically.
  • Rebooting devices remotely as part of maintenance workflows.
  • Running arbitrary commands on devices to gather diagnostics or perform actions.

For example, a user can send a command like show version to get device details or push interface configuration changes using configuration commands.

Properties

Name Meaning
Advanced Options Collection of optional settings to control connection behavior, retries, timeouts, and error handling:
- Auto Disconnect (boolean): Automatically disconnect after command execution.
- Command Retry Count (number, 1-5): Number of retry attempts if command execution fails.
- Command Timeout (seconds, 2-300): Timeout duration for command execution.
- Connection Pooling (boolean): Enable connection pooling for better performance.
- Connection Retry Count (number, 1-10): Number of retry attempts if connection fails.
- Connection Timeout (seconds, 3-300): Timeout duration for establishing connection.
- Fail on Error (boolean): Whether to fail the workflow on command errors.
- Fast Mode (boolean): Enable fast mode for simple commands (skips setup steps).
- Retry Delay (seconds, 1-60): Delay between retry attempts.
- Reuse Connection (boolean): Reuse existing connections when possible.

Note: The node also has an "Operation" property (not listed in your provided JSON but present in the code) with options:

  • Get Running Config
  • Reboot Device
  • Save Config
  • Send Command
  • Send Config

Depending on the selected operation, additional properties appear:

  • Command (string): The command to send to the device (for "Send Command").
  • Configuration Commands (string, multiline): Configuration commands to send, one per line (for "Send Config").

Output

The node outputs JSON data containing the result of the executed operation for each input item. The output JSON structure includes:

  • success (boolean): Indicates if the command or operation was successful.
  • command (string): The command or operation name executed.
  • output (string): The textual output returned from the device.
  • deviceType (string): The type/model of the network device.
  • host (string): The hostname or IP address of the device.
  • timestamp (ISO string): Timestamp when the operation was performed.
  • executionTime (number): Time taken to execute the command in milliseconds.
  • connectionRetries (number): Number of connection retry attempts made.
  • commandRetries (number): Number of command retry attempts made.
  • error (string, optional): Error message if the operation failed.

If the node encounters errors and the "Fail on Error" option is disabled, it returns an object with success: false and an error message instead of throwing.

The node does not output binary data.

Dependencies

  • Requires an API key credential to authenticate SSH access to network devices.
  • Depends on an underlying SSH connection handler utility (imported as ConnectHandler) to manage device communication.
  • Supports authentication via password or private key, including optional passphrase.
  • Supports jump host (bastion) configurations for connecting through intermediate hosts.
  • Requires proper network connectivity and permissions to access target devices over SSH.

Troubleshooting

  • Connection failures: May occur due to incorrect credentials, unreachable host, firewall restrictions, or network issues. Check the connection parameters and network accessibility.
  • Command timeouts: If commands take longer than the configured timeout, increase the "Command Timeout" setting.
  • Retries exhausted: The node retries connection and command execution based on configured counts. If all retries fail, the node throws an error unless "Fail on Error" is disabled.
  • Invalid commands or config: Sending invalid commands or malformed configuration lines will cause command failure. Validate commands before sending.
  • Authentication errors: Ensure correct authentication method and credentials are used, including private key and passphrase if applicable.
  • Fast Mode: Enabling fast mode skips some setup steps; use only for simple commands to avoid unexpected failures.
  • Reuse Connection: When enabled, the node attempts to reuse existing SSH connections which may improve performance but could cause issues if connections become stale.

Links and References

Discussion