Skip to content

Instantly share code, notes, and snippets.

@RohitRox
Created June 27, 2017 17:07
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 RohitRox/3f8b5c0e33cf899009a6ea91f157b151 to your computer and use it in GitHub Desktop.
Save RohitRox/3f8b5c0e33cf899009a6ea91f157b151 to your computer and use it in GitHub Desktop.
NewRelic for Server ebextension config with instance environment and id
packages:
yum:
newrelic-sysmond: []
rpm:
newrelic: http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm
commands:
"01":
command: nrsysmond-config --set license_key=LICENSE_KEY
"02":
command: echo hostname=`aws ec2 describe-tags --filters "Name=resource-id,Values=$(curl -s http://169.254.169.254/latest/meta-data/instance-id)" "Name=key,Values=elasticbeanstalk:environment-name" --region=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document | jq -r .region) --output=json | jq -r '.Tags[0].Value +"-"+ .Tags[0].ResourceId'` >> /etc/newrelic/nrsysmond.cfg
"03":
command: /etc/init.d/newrelic-sysmond start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment