checkConnectivity
Verify SSH connection availability to a remote host by testing connectivity with the specified host alias.
Instructions
Checks if an SSH connection to the host is possible
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hostAlias | Yes | Alias or hostname of the SSH host |
Implementation Reference
- src/ssh-client.ts:60-82 (handler)Implements the checkConnectivity tool by attempting an SSH connection to the specified hostAlias, executing an 'echo connected' command to verify, and returning ConnectionStatus with connected status and message.async checkConnectivity(hostAlias: string): Promise<ConnectionStatus> { try { // Establish connection await this.connectToHost(hostAlias); // Execute ping command const result = await this.ssh.execCommand('echo connected'); const connected = result.stdout.trim() === 'connected'; this.ssh.dispose(); return { connected, message: connected ? 'Connection successful' : 'Echo test failed' }; } catch (error) { console.error(`Connectivity error with ${hostAlias}:`, error); return { connected: false, message: error instanceof Error ? error.message : String(error) }; }
- src/types.ts:19-22 (schema)Type definition for the return type of checkConnectivity tool.export interface ConnectionStatus { connected: boolean; message: string; }