Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

having trouble installing awslogs agent

I'm having issues trying to instal awslogs agent on my ec2 node. When I run this command:

sudo python ./awslogs-agent-setup.py --region us-east-1

it seems to fail at step 2 like this:

Launching interactive setup of CloudWatch Logs agent ... 

Step 1 of 5: Installing pip ...DONE

Step 2 of 5: Downloading the latest CloudWatch Logs agent bits ... 
Traceback (most recent call last):
  File "./awslogs-agent-setup.py", line 1144, in <module>
    main()
  File "./awslogs-agent-setup.py", line 1140, in main
    setup.setup_artifacts()
  File "./awslogs-agent-setup.py", line 696, in setup_artifacts
    self.install_awslogs_cli()
  File "./awslogs-agent-setup.py", line 523, in install_awslogs_cli
    subprocess.call([AWSCLI_CMD, 'configure', 'set', 'plugins.cwlogs', 'cwlogs'], env=DEFAULT_ENV)
  File "/usr/lib64/python2.7/subprocess.py", line 524, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib64/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

what directory or file is it missing?

like image 596
lightweight Avatar asked Feb 01 '17 23:02

lightweight


People also ask

How do I install CloudWatch log agent?

Installation process overviewDownload the agent package. Modify the CloudWatch agent configuration file and specify the metrics that you want to collect. Install and start the agent on your servers. As you install the agent on an EC2 instance, you attach the IAM role that you created in step 1.


1 Answers

Amazon Linux 2

The awslogs agent is available now as a yum package https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/QuickStartEC2Instance.html

sudo yum install -y awslogs
sudo systemctl start awslogsd
sudo systemctl enable awslogsd.service

Make sure to change the AWS Region as mentionned in the doc

like image 102
Cyril Duchon-Doris Avatar answered Sep 17 '22 15:09

Cyril Duchon-Doris