Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check_AWS_EC2_instance_status
1.4.27
2011-07-12
- Nagios 3.x
Apache
103972
File | Description |
---|---|
check_ec2_status.rb | The ruby script that check the status of an instance on AWS EC2. |
check_ec2_status.cfg | The definition of the nagios command. |
sample_host.cfg | Sample of use. |
encrypt_credentials.rb | Ruby script that encrypts Amazon Web Services Credentials. |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
The Amazon credentials (Access Key ID and Secret Access Key) are read from an encrypted file.
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
}
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)
Be the first to review this listing!