I am trying to use PLink to run a command (show vpn-sessiondb anyconnect) on Cisco Firepower 1010 router. There is a slight problem though:
If I SSH to the device, it automatically invokes a shell to the FTD CLI. From here I can input the command (show vpn-sessiondb anyconnect) I want and get the output.
If I use PLink to remotely execute a command, however, the command (show vpn-sessiondb anyconnect) executes before the shell to the FTD CLI is called, and instead invokes the command on the FXOS shell from which the FTD CLI shell is called.
The FXOS shell has a command (connect ftd) that is used to invoke the FTD CLI from which I want to invoke my remote command (show vpn-sessiondb anyconnect). Unfortunately, if I try to execute both commands together (plink.exe -batch -ssh user@host -pw XXXXX "connect ftd;show vpn-sessiondb anyconnect") the command hangs and does not fully execute.
I presume this is because when (connect ftd) is remotely executed, the shell it invokes is interactive (much like trying remotely execute sudo su) and can't take any further input.
Is there a way to use PLink so that it can interact with shells invoked by remote commands?