Monitor Amazon Instances, status and metrics using Ruby SDK

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.

  1. Create a new user in AIM
    Don't bother giving the new user a password, it's not needed.
  2. 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.
  3. Attach the "ReadOnlyAccess" user policy on the newly created user.
  4. Now go back to the Console home and click EC2
    Under NETWORK & SECURITY click Key Pairs
  5. Create a new one with the same name as the user you created. The key pair will be downloaded when created.
  6. Save that one to your OP5 Monitor server as:
  7. 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
  8. Test if all works:
    RUBYOPTS=rubygems /usr/bin/ruby /opt/plugins/check_aws/check_ec2_status.rb -a -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