Can WFA workflows execute unix scripts on a unix server . If it can execute script do you have a working example
You can definitely execute a unix script/command remotely and capture the output.
I do not have an example script or the exact way of doing it but here is what you can try:
I am assuming you have the script on the WFA machine.
Create a new command that makes use of the tool 'plink' to connect to a remote machine. Something like this:
$cmd = `C:\plink.exe -ssh -m C:\checkspace.sh name@ip -pw password ` > C:\output.txt
I haven't checked the correctness of the command yet. For the powershell syntax, you can check other commands.
In case you need help with creating the command, let me know.
I suggest you first try the command from the PS CLI.
I will try to explore for a better answer for you.
WFA can do anything that a powershell and .NET can do and a powershell can do (almost) anything. You don't need any external tools or APIs. You can use Invoke-NaSsh cmdlet to get this done.
Attaching the .dar file which is a WFA command to do it. This .dar can be imported on WFA2.0.1 or above.
[parameter(Mandatory=$true, HelpMessage="Unix Command or Script Path")]
[parameter(Mandatory=$true, HelpMessage="Unix Host Name")]
$creds = Get-NaCredentials -Host $UnixHost
$creds = Get-WfaCredentials -Host $UnixHost
$returnData= Invoke-NaSsh -Name $UnixHost -Credential $creds -Command $Script
Get-WFALogger -Info -Message $returnData
Do i need to create a passwordless ssh between the WFA server host ( windows server ) and the target unix server to exeute this workflow . How can the workflow get the target unix host credentials .
No Aneesh. This doesn't require passwordless login. You can set the credentials of your Unix Host at tab "Execution" => "Credentials" . If you read the description of this command, it tell you where to save the credentials.
1. Add Credentials
2. Match: Exact
3. Type: Other
4. Give username and password.
5. Save it.
See the image below.
Yes, only you need to have SSH server ( e.g. Openssh or FreeSSHD etc.) running on your windows host.
I've already attached the .dar file for the command and also the command code along with the instructions how to use it. You need anything else?