(0, ‘Socket error: [Errno 111] Connection refused’)

Had the same problem as the previous poster, this is what solved the issue: To enable the CIM agent on the ESXi 6.5 host, run this command via CLI:

esxcli system wbem set –enable true

Documentation:
https://kb.vmware.com/s/article/2148910

and

https://kb.vmware.com/s/article/1025757?r=2&Quarterback.validateRoute=1&KM_Utility.getArticleData=1&KM_Utility.getGUser=1&KM_Utility.getArticleLanguage=2&KM_Utility.getArticle=1