Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I downloaded the AWS CloudWatch command line api and I have also set the env_path variable that is AWS_CLOUDWATCH_HOME=local/usr/CloudWatch. But when I run mon-cmd, I get command not found error in the console. I am working on ubuntu 10.04 server which is a EC2 instance.

It's been to couple of days I am struck with this problem, in spite of setting the path variables correctly I am facing this problem.

Kindly help me out

share|improve this question
    
Can you find this command mod-cmd in your system somewhere? Use locate or find to check. –  Khaled Jan 7 '12 at 10:30

2 Answers 2

up vote 1 down vote accepted

Command not found usually means exactly that - that the operating system can't locate the command you are trying to execute. The operating system only looks in a select few folders for the application. This list of folders is defined by the PATH variable.

You can view your current PATH variable with:

echo $PATH

One possible output of this is: /usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/aws/bin:/root/bin

You will note, in the above output that I have my AWS API tools in /opt/aws/bin. Edit your PATH variable to include the location of the mon-cmd program. You can do so, either: Temporarily (from bash prompt):

PATH=$PATH:/path/to/api-tools

Or permanently, by modifying (or appending) the PATH in your users' .bash_profile:

PATH=$PATH:/path/to/api-tools
export $PATH

Be careful! Ensure you do not leave out the $PATH - this includes the existing PATH and only adds the new one - otherwise you will overwrite your existing PATH and no programs will work if they are not run with an absolute path.

You can verify that you have done so successfully by running (which should return the correct location)

whereis mon-cmd

(Sample output: mon-cmd: /path/to/api-tools/mon-cmd)

Alternatively, you can run the command directly from wherever it is located:

/path/to/api-tools/mod-cmd`
share|improve this answer

Find the file with find / -type f -name mon-cmd 2>/dev/null then add the folder where the file is located to $PATH by running: export PATH=$PATH:/path/to_mon-cmd/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.