Created
June 27, 2017 17:07
-
-
Save RohitRox/3f8b5c0e33cf899009a6ea91f157b151 to your computer and use it in GitHub Desktop.
NewRelic for Server ebextension config with instance environment and id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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