Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save joshes/0a7c05c5b600347575e0422641c9d3bc to your computer and use it in GitHub Desktop.
Save joshes/0a7c05c5b600347575e0422641c9d3bc to your computer and use it in GitHub Desktop.
Elastic Beanstalk memory monitor cron
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/mon-scripts.html
#.ebextensions/01-memorymon.config
packages:
yum:
perl-Switch: []
perl-DateTime: []
perl-Sys-Syslog: []
perl-LWP-Protocol-https: []
perl-Digest-SHA.x86_64: []
container_commands:
00download:
command: "wget http://ec2-downloads.s3.amazonaws.com/cloudwatch-samples/CloudWatchMonitoringScripts-v1.1.0.zip"
ignoreErrors: true
01extract:
command: "unzip CloudWatchMonitoringScripts-v1.1.0.zip"
ignoreErrors: true
02rmzip:
command: "rm CloudWatchMonitoringScripts-v1.1.0.zip"
ignoreErrors: true
03cdinto:
command: "mv aws-scripts-mon/ /home/ec2-user"
ignoreErrors: true
04cron:
test: test ! -f /var/spool/cron/root
command: "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