I need a general purpose WFA Command that will accept a Cluster name and Command as input and run the command on the cluster.
My environment is: WFA Server Windows 2012 R2, WFA 4.2, Clustered ONTAP 9.3P15; PSToolkit 9.7; Putty 0.73
I have written the command using the Invoke-NcSsh cmdlet. I ran into the issues described in Community Article: "Invoke-NcSsh failing with ONTAP 9.3". I followed the solution to upgrade the Netapp DataONTAP PSToolkit to 9.7 and install PuTTY v0.7.3. This got me past the initial problem and the Invoke-NcSsh cmdlet actually runs the command on the cluster. The only problem is that the cmdlet in the WFA JBOSS container throws an exception at the end of the command processing.
Here is the simplified PS code that shows the problem:
param (
[parameter(Mandatory=$True, HelpMessage="First Cluster")]
[string]$Cluster
)
Get-WFALogger -info -message "Running Test Command"
$creds = Get-WfaCredentials -Hostname $Cluster
$result = Invoke-NcSsh -Name $Cluster -Command date -Credential $creds
Get-WFALogger -info -message $("-- " + $result)
Get-WFALogger -info -message "End Test Command"
Output: >>>>>>>>>>>>>>
15:47:29.012 INFO [SWA Test] ### Command XXX Test' in 'POWER_SHELL' ###
15:47:35.559 INFO [SWA Test] Running Test Command
15:47:35.574 INFO [SWA Test] Credentials successfully provided for 'cluster050'
15:47:40.996 INFO [SWA Test] -- Node Date Time zone
--------- ------------------------ -------------------------
Fri Jan 10 15:47:41 2020 US/Central
Fri Jan 10 15:47:41 2020 US/Central
2 entries were displayed.
15:47:41.012 INFO [XXX Test] End Test Command
15:47:41.074 ERROR [XXX Test] Failed executing command. Exception:
The command works fine, its just that WFA flags an error; but the Excepton is null.
The only other clue I have found is that an error is posted to the server.log when the command is run:
server.log error >>>>>>>>
2020-01-10 15:47:41,059 ERROR [stderr] (default task-16) [Fatal Error] :1:1: Content is not allowed in prolog.
Any ideas on trouble shooting this error?