| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |

Topics
To use the commands described in this guide, you must install and configure the command line tools.
To install the Amazon CloudWatch command line tools
Download the command line tools from Amazon CloudWatch Tools.
Save and unpack the Amazon CloudWatch archive to a convenient location on your workstation.
Enter the command java -version to determine the version of Java installed on your workstation. If you do not have version 1.5 or newer, download and install a newer version from http://www.java.com.
Set the JAVA_HOME environment variable to point to your Java installation.
The following is an example of how to set this environment variable in Linux and UNIX.
$export JAVA_HOME=<PATH>
The following is an example of the syntax in Windows.
C:\>set JAVA_HOME=<PATH>
Make the following addition to your PATH environment variable.
On Linux and UNIX, you can update your PATH as follows:
$export PATH=$PATH:$JAVA_HOME/bin
Note
The export command applies only to the current shell session.
To permanently create or update an environment variable, include the command in a start-up script.
For example, if you use Bash shell, you can include commands in your ~/.bashrc or /etc/profile file.
On Windows the syntax is slightly different:
C:\>set PATH=%PATH%;%JAVA_HOME%\bin
Note
The Windows environment variables are reset when you close
the command window. You might want to set them
permanently with the setx command.
Set the AWS_CLOUDWATCH_HOME environment variable to the location
where you unpacked the CloudWatch archive.
On Linux and UNIX, you can set this environment variable as follows:
$exportAWS_CLOUDWATCH_HOME=<path-to-tools>
On Windows the syntax is slightly different:
C:\>setAWS_CLOUDWATCH_HOME=<path-to-tools>
Make the following addition to your PATH environment variable.
On Linux and UNIX, you can update your PATH as follows:
$export PATH=$PATH:$AWS_CLOUDWATCH_HOME/bin
On Windows the syntax is slightly different:
C:\>set PATH=%PATH%;%AWS_CLOUDWATCH_HOME%\bin
Before you use Amazon CloudWatch, you must provide your AWS credentials to the command line tools. You can use your AWS access keys.
To use access keys with the command line tools
Navigate to the AWS security credentials page.
You will be prompted to log in if you haven't already.
Scroll down to Access Credentials to get your Access Key ID and your Secret Access Key.

Add your access key id and secret access key to the file named credential-file-path.template.
On Linux and UNIX, you can find the file here:
$AWS_CLOUDWATCH_HOME/credential-file-path.template
On Windows, you can find the file here:
%AWS_CLOUDWATCH_HOME%\credential-file-path.template
Rename the file and save it to a convenient location on your workstation.
If you are using Linux or UNIX, set the file permissions as follows:
$chmod 600<credential file name>
On Windows, you do not need to change the file permissions.
Set the AWS_CREDENTIAL_FILE environment variable to the fully-qualified path of the credential file you just created.
On Linux and UNIX, you can set this environment variable as follows:
$export AWS_CREDENTIAL_FILE=<path-to-file>
On Windows the syntax is slightly different:
C:\>set AWS_CREDENTIAL_FILE=<path-to-file>
To test your installation and configuration of Amazon CloudWatch
On your workstation, open a new command prompt.
Type the command mon-cmd.
You should see output similar to the following:
Command Name Description ------------ ----------- mon-delete-alarms Delete alarms mon-describe-alarm-history Describe alarm history mon-describe-alarms Describe alarms fully. mon-describe-alarms-for-metric Describe all alarms ... a single metric mon-disable-alarm-actions Disable all actions for a given alarm mon-enable-alarm-actions Enable all actions for a given alarm mon-get-stats Get metric statistics mon-list-metrics List user's metrics mon-put-data Put metric data mon-put-metric-alarm Create new alarm or update existing one mon-set-alarm-state Manually set the state of an alarm mon-version Prints the version ... tool and the API For help on a specific command, type '<commandname> --help'
This completes your installation and configuration of the CloudWatch command line tools.
