op5 APS and CentOS 6
You do not need to install any dependencies. All shall already be in place as long as you have op5 Monitor >= 6.2 installed.
First of all you need to create a new user in AWS with read-only permissions. It's easy to do, just use IAM dashboard in the AWS Management Console.
- Create a new user in AIM
Don't bother giving the new user a password, it's not needed.
- Save the Access Key ID and Secret Access Key by clicking "Download Credentials". or click "Show User Security Credentials" and copy the keys from there.
- Attach the "ReadOnlyAccess" user policy on the newly created user.
- Now go back to the Console home and click EC2
Under NETWORK & SECURITY click Key Pairs
- Create a new one with the same name as the user you created. The key pair will be downloaded when created.
- Save that one to your op5 Monitor server as:
- Use your "access-key id" and "secret access key" to generate the encrypted credentials file like this:
RUBYOPT=rubygems /usr/bin/ruby /opt/plugins/check_aws/encrypt_credentials.rb -v -A <Access Key ID> -S <Secret Access Key> -f /opt/plugins/check_aws/check_aws.cfg
- Test if all works:
RUBYOPTS=rubygems /usr/bin/ruby /opt/plugins/check_aws/check_ec2_status.rb -a ec2-hostname.us-west-2.compute.amazonaws.com -i i-INSTANCEID -f /opt/plugins/check_aws/check_aws.cfg
EC2 Status Check: OK - State Name: running, State Code: 16|running=1
Live demo available in our demo-system!