sensu-plugins / sensu-plugins-aws

This plugin provides native AWS instrumentation for monitoring and metrics collection, including: health and metrics for various AWS services, such as EC2, RDS, ELB, and more, as well as handlers for EC2, SES, and SNS.
http://sensu-plugins.io
MIT License
81 stars 143 forks source link

Add new plugin check-expiring-reservations.rb #354

Closed boutetnico closed 4 years ago

boutetnico commented 5 years ago

Pull Request Checklist

Is this in reference to an existing issue? No

General

New Plugins

Purpose

Warn about upcoming instance reservations expiration.

Example usage:

Check all reservations in a region:

$ ruby check-expiring-reservations.rb -r eu-west-1
CheckExpiringReservations OK: All checked reservations are ok

Check if a specific reservation <reservation_id> expires before 15 days with critical status:

$ ruby check-expiring-reservations.rb -r eu-west-1 -R <reservation_id> -c 15
CheckExpiringReservations CRITICAL:  reservation <reservation_id> (r5.xlarge x 1) expires in 11 days;

Warn if any reservation in the region expires before 30 days:

$ ruby check-expiring-reservations.rb -r eu-west-1 -w 30
CheckExpiringReservations WARNING:  reservation <reservation_id> (c5.large x 4) expires in 21 days; reservation <reservation_id> (r5.xlarge x 1) expires in 11 days;

Known Compatibility Issues

None