N2WS-12858 - CPM agent status 'never heard from' due to windows environment variable

N2WS-12858 - CPM agent status 'never heard from' due to windows environment variable

Issue summary:
If you are able to connect to the CPM UI over browser from within the windows backup target, but the Agent is still showing status 'never heard from' in the CPM UI,
this can be due to an environment variable in your target Windows instance.

Issue description
Even if you don’t use proxy for CPM Server, the CPM agent on Windows would pick up the https_proxy/http_proxy environment variable and will try to connect via proxy, which will cause it to fail.
Excluding it with the NO_PROXY environment variable would not work.

This will result in communication error in the agent logs on the target instance:
ERROR:  get_agent_tasks(agentapi_requests.pyo:471)  failed calling url https://10.23.82.1/agentapi/agent_tasks/ Exception: <urlopen error timed out>
ERROR:  tasks_main_loop(agent_tasks_loop.pyo:131)  Error from get_agent_tasks  

Fix version
See the attached patch for CPM v2.4 and above.

Patch:
If you are not using proxy for CPM, but the target instance has https_proxy environment parameter which interrupt the Agent communication,
Then download the patch from this Article and do the following: 
  1. Extract the CPMagentService.txt file
  2. Rename it to CPMagentService.exe
  3. Connect to the machine where the thin agent runs.
  4. Copy CPMagentService.exe to the machine where the thin agent runs.
  5. Stop the CPMAgent service
  6. Go to "C:\Program Files (x86)\CPM Agent"
  7. Replace the existing CPMagentService.exe with the one from this Article
  8. Also in "C:\Program Files (x86)\CPM Agent" there is the "cpmagent.cfg" file. Copy from it the value of 'server_address' key that is located in the [general] section.
  9. Now add cpm address copied from ''server_address' in the cpmagent.cfg file to the addresses in 'NO_PROXY' environment variable. This should make the thin agent ignore the https_proxy environment variable when connecting to CPM
  10. Restart the agent and test.