Others

Check_AWS_EC2_instance_status

Description:

This is a ruby script that checks the status of an instance on Amazon Web Service EC2 using Amazon EC2 API.
The Amazon credentials (Access Key ID and Secret Access Key) are read from an encrypted file.

Current Version

1.4.27

Last Release Date

2011-07-12

Compatible With

  • Nagios 3.x

License

Apache


Project Files
Project Notes
Using Amazon EC2 API, this is possible to retrieve the status of an instance without installing any agent or configuring SNMP daemon. Moreover, this requires only read-only credentials that could be easily generated using Amazon IAM. For security reasons, we use encrypted credentials that are decrypted by this plugin. Here is a command line sample of use: debian-secludit # RUBYOPT=rubygems ruby check_ec2_status.rb -v -a ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com -i i-XXXXXXXX -f ec2_credentials_1.cfg ** Launching EC2 status retrieval on instance ID: i-XXXXXXXX on Amazon Server: $ec2.us-east-1.amazonaws.com Amazon Server: ec2.us-east-1.amazonaws.com EC2 Status Check: OK - State Name: running, State Code: 16|running=1 The ec2_credentials_1.cfg files contains the encrypted credentials as follow: [blank_space]ec2_access_id[blank_space]B64_encoding(BF-CBC-Cipher_encoding(Access Key ID) [blank_space]ec2_access_key[blank_space]B64_encoding(BF-CBC-Cipher_encoding(Secret Access Key) You can use the encrypt_credentials.rb ruby script that does that as follow: debian-secludit # RUBYOPT=rubygems ruby encrypt_credentials.rb -A XXXXXXXXXXXXXXXXXXXX -S XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -f ec2_credentials.cfg Here is a sample configuration file for nagios. define host { name Amazon_EC2_Instance_Name use generic-host address ec2-XXX-XXX-XXX-XXX.compute-1.amazonaws.com check_command check_ec2_status!i-XXXXXXXX!/etc/nagios3/credentials/ec2_credentials_1.cfg max_check_attempts 3 }
Reviews (0) Add a Review
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
0 (0)
Favorites
0
Views
103,898