Skip to content

Instantly share code, notes, and snippets.

@giovanigenerali
Created December 9, 2018 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giovanigenerali/8aa515ef3810a432f8b85ea266f63ed8 to your computer and use it in GitHub Desktop.
Save giovanigenerali/8aa515ef3810a432f8b85ea266f63ed8 to your computer and use it in GitHub Desktop.
aws elastic beanstalk - memory monitor
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html
# .ebextensions/memory_monitor.config
container_commands:
00install:
command: "sudo yum install -y perl-Switch perl-DateTime perl-Sys-Syslog perl-LWP-Protocol-https perl-Digest-SHA.x86_64"
ignoreErrors: false
01download:
command: "curl https://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.2.zip -O"
ignoreErrors: true
02extract:
command: "unzip CloudWatchMonitoringScripts-1.2.2.zip"
ignoreErrors: true
03rmzip:
command: "rm CloudWatchMonitoringScripts-1.2.2.zip"
ignoreErrors: true
04cdinto:
command: "mv aws-scripts-mon/ /home/ec2-user"
ignoreErrors: true
05cron:
command: "crontab -l | grep -q 'mon-put-instance-data.pl' || crontab -l | { cat; echo '* * * * * /home/ec2-user/aws-scripts-mon/mon-put-instance-data.pl --mem-util --mem-used --mem-avail'; } | crontab -"
ignoreErrors: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment