Skip to content

Instantly share code, notes, and snippets.

@amccarty
Created November 27, 2016 20:47
Show Gist options
  • Save amccarty/efb8b8cfd2a42363cf060ff7778a10f9 to your computer and use it in GitHub Desktop.
Save amccarty/efb8b8cfd2a42363cf060ff7778a10f9 to your computer and use it in GitHub Desktop.
Elastic Beanstalk memory monitor cron
#.ebextensions/01-memorymon.config
packages:
yum:
perl-Switch: []
perl-DateTime: []
perl-Sys-Syslog: []
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