Report EC2 instance id as a ganglia metric
EC2 instances provide metadata via http://169.254.169.254/latest/meta-data. Here's a oneliner to fetch the instance id of a running EC2 instance and supply it to Ganglia as a custom metric.
gmetric --name=vmInstanceId --value=`wget -q -O - http://169.254.169.254/latest/meta-data/instance-id || die \"wget instance-id has failed: $?\"` --type=string --slope=zero --tmax=0 --dmax=0
The wget part is flatteringly imitated from this Stackoverflow post.














