Hi All,
I had this same issue. Multiple devices in the same IP subnet as my local probe all working fine (non-PowerShell sensors and PowerShell sensors). But two devices in a different IP subnet with all 'normal' sensors were working just fine, but the PowerShell sensor for Windows Updates failing. It was reporting 'No such host is known'.
After some digging around I could validated the following:
- TCP 5985 wasn't blocked (used telnet from the monitoring probe host)
- Remote PowerShell was working (from the probe server:
Invoke-Command -ComputerName <hostname> -ScriptBlock {hostname}
I then tried the above Invoke-Command again, but with just the IP address as I noticed in the logs above and in my logs the IP address was used by the sensor. This failed with the below error message:
[aaa.bbb.yyy.zzz] Connecting to remote server aaa.bbb.yyy.zzz failed with the following error message : The WinRM client
cannot process the request. Default authentication may be used with an IP address under the following conditions: the
transport is HTTPS or the destination is in the TrustedHosts list, and explicit credentials are provided. Use
winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. For more
information on how to set TrustedHosts run the following command: winrm help config. For more information, see the
about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (aaa.bbb.yyy.zzz:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : CannotUseIPAddress,PSSessionStateBroken
This led me down to figuring out why the Invoke-Command failed with an IP address, but not with a host name. In my case I did not try to fix the issue with altering the trusted host list or behavior, because the sensors on same subnet worked just fine by IP address. So I kept digging. I was able to dig out the actual PowerShell command in the 'Windows Update Status' sensor and tried that with both IP address and hostname:
> & 'C:\Program Files (x86)\PRTG Network Monitor\Sensor System\LastWindowsUpdateSensor.exe' -host="<IP_Address>" -user="<username>" -pass="<password>"
> & 'C:\Program Files (x86)\PRTG Network Monitor\Sensor System\LastWindowsUpdateSensor.exe' -host="<Hostname>" -user="<username>" -pass="<password>"
The IP address command failed with 'No such host is known', but the same command with the hostname succeeded! I then looked into the device itself and realized I had created all devices based on IP address. I changed the two device with the failing sensor to FQDNs and now it works perfectly. I don't know why exactly an IP address invoked across a subnet causes this behavior but changing it to hostname fixed my issue.
Hope this helps!
Tyson
Add comment