hello
As per doc
https://communities.vmware.com/thread/256231?start=15&tstart=0
i am running script but getting disconnected with following message, i have manually did plink for all the server .\plink servername, but it didn't ask for any RSA , can you help please ?
ssh-rsa 1040 7b:aa:92:81:e0:41:30:f3:4a:eb:89:be:23:e6:a8:ee
Connection abandoned.
Disconnected: User aborted at host key verification
Looking up host "xxxxxxxxxxxxxxxxxxxxxx
Connecting to xxxxxxx port 22
Server version: SSH-2.0-dropbear_0.52
Using SSH protocol version 2
We claim version: SSH-2.0-PuTTY_Release_0.63
Using Diffie-Hellman with standard group "group1"
Doing Diffie-Hellman key exchange with hash SHA-1
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
I suspect you are prompted to accept the host key.
Try Alan's trick from SSH PowerShell tricks with plink.exe
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I suspect you are prompted to accept the host key.
Try Alan's trick from SSH PowerShell tricks with plink.exe
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Hi Lucd
I tried to place echo Y
$plink = "echo Y |C:\putty\plink.exe"
but not working, here is script
$qlR1 = [regex]"QLogic.+for\s(\w+):"
$qlR2 = [regex]"Firmware version ([\d|\.]+).+Driver version ([\d|\.]+)"
$User = "root"
$Pswd = "xxxxxxxx"
$plink = "echo Y |C:\putty\plink.exe"
$plinkoptions = " -v -batch -pw $Pswd"
$cmd1 = 'cat /proc/scsi/qla*/*'
$remoteCommand = '"' + $cmd1 + '"'
$report = @()
Get-vmhost | % {
$Computer = $_.Name
$command = $plink + " " + $plinkoptions + " " + $User + "@" + $computer + " " + $remoteCommand
$msg = Invoke-Expression -command $command
# Extract the required info from the $msg variable
$msg | % {
if($_ -match $qlR1){
$row = "" | Select ESXname, HBAtype, HBAfirmware, HBAdriver
$row.ESXname = $Computer
$row.HBAtype = $qlR1.Match($_).Groups[1].Value
}
if($_ -match $qlR2){
$matches = $qlR2.Match($_)
$row.HBAfirmware = $matches.Groups[1].Value
$row.HBAdriver = $matches.Groups[2].Value
$report += $row
}
}
}
$report
sorry, i was missing FQDN, I used to login with interactively, so RSA key was taking for NETBIOS but not FQDN
AH good, so it's working now ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
its working now.... thank u 🙂