This article applies to PRTG Network Monitor 13 or later
Resolving a (502) Bad Gateway Error for Citrix XenServer Host Sensor
If you receive the error message "The remote server returned an error: (502) Bad Gateway" with your XenServer Host sensors, first check if you have defined the correct proxy for your network in Control Panel | Network and Internet | Internet Options | Connections | LAN Settings
Make sure that these settings are correct. Then open a command prompt on the system PRTG is running on (or the remote probe), change the working directory to the /PRTG Network Monitor/Sensor System subfolder of your PRTG installation directory.
Run the following command to get a list of all hosts with their IDs on your system:
XenServerRRDSensor.exe -host=<host> -user=<user> -pass=<password> -act=listHosts -https=true
Then run the following command and use a host ID retrieved with the previous command:
XenServerRRDSensor.exe -host=<host> -user=<user> -pass=<password> -act=getHostDetails -id=<hostId> -freq=60 -https=true
If the XenServerRRDSensor.exe command works from your user account and you can retrieve data from your host, then most likely your local system user’s proxy settings refuses PRTG to connect to your host with this sensor type.
Changing Proxy Settings for the Local System
In order to resolve this issue, please do not use a proxy for your local system. You can change proxy settings with the Windows tool BITSAdmin. This is a command line tool you can use to create download or upload jobs and monitor their progress. For more details and how to get the tool, please refer to Microsoft’s Dev Center:
With the following command on your system you can specify proxy settings for your service account:
bitsadmin /Util /SetIEProxy LOCALSYSTEM NO_PROXY
The parameter LOCALSYSTEM specifies the type of service account for the proxy usage you define. NO_PROXY specifies the form of proxy detection to use, this is, not to use a proxy server for your local system.
If a proxy is needed for your network, you will have to modify the command accordingly to use your proxy.