Commit 48a00b13 by John Jarvis

use ami id and instance id for the hostname

parent 06125c07
......@@ -4,6 +4,8 @@ stop on runlevel [016]
respawn
chdir {{ newrelic_logwatch_dir }}
pre-start script
sed -i "s/HOSTNAME/$(hostname)/" {{ newrelic_logwatch_dir }}/config/newrelic_plugin.yml
instance_id=$(ec2metadata --instance-id)
ami_id=$(ec2metadata --ami-id)
sed -i "s/HOSTNAME/${ami_id}-${instance_id}/" {{ newrelic_logwatch_dir }}/config/newrelic_plugin.yml
end script
exec ruby newrelic_logwatcher_agent.rb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment