deprecation of tools that will not be supported.

This commit is contained in:
Colin Johnson
2013-10-11 03:58:32 +00:00
parent af24aa1cdf
commit 6efedd313c
8 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
# Introduction:
ec2-write-storage-used was created to extend Amazon's default metrics for EC2 instances to include a metric for the amount of storage space used on an individual EC2 instance.
# Directions For Use:
ec2-write-storage-used.sh
## Example of Use:
The most valuable use of this application is to be run through cron on a regular basis.
# Additional Information:
- Author: Colin Johnson / colin@cloudavail.com
- Date: 2011-12-09
- Version 0.1
- License Type: GNU GENERAL PUBLIC LICENSE, Version 3

View File

@@ -0,0 +1,17 @@
#!/bin/bash -
#get instance id - used for putting metric
INSTANCE_ID=`GET http://169.254.169.254/latest/meta-data/instance-id`
INSTANCE_AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone/`
INSTANCE_REGION=${INSTANCE_AZ%?}
#belowshould be changed to grep - get only everything after % space slash
filesystemlist=`df -l | grep -i \/ | cut -c57-100` #add -l to restrict to local file systems
for filesystemmountpoint in $filesystemlist
do
storageused=`df | grep %\ *$filesystemmountpoint$ | grep -o [0-9]*% | tr -d %` #need to error check and possibly remove leading white space
mon-put-data --region $INSTANCE_REGION --metric-name StorageUsed --namespace EC2/Storage --value $storageused --unit Percent --dimensions FileSystem=$filesystemmountpoint,InstanceId=$INSTANCE_ID
done
#to run in cron every 5 minutes - note that you must first provide credentials for mon-put-data
#echo "*/5 * * * * ec2-user /usr/local/bin/ec2-write-storage-used.sh" > /etc/cron.d/ec2-write-storage-used