Error while installing ambari agent

Hi Sir, On installing the agent I am getting the below error:

File “/var/lib/ambari-agent/cache/common-services/AMBARI_METRICS/0.1.0/package/scripts/metrics_collector.py”, line 131, in
AmsCollector().execute()
File “/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py”, line 218, in execute
method(env)

And there is some more lines of error in the file. Would you be able to tell me what things I could check please! By checking the links online I was able to do the below troubleshooting :

  1. Checked the path configured in HDP.repo, ambari.repo and hdp.repo. The paths resolve fine.
  2. Ran “yum search ambari-agent ambari-server ambari-metrics-collector” to check whether ambari-metrics-collector exists or not, but it does exist.
  3. Changed the ownber of hdp.repo from root to ec2-user and then ran, but still the same issue.

Sir, please tell me what are the things that I could check please!!