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 filtering by prefix option in check-cloudwatch-alarms.rb #351

Closed boutetnico closed 4 years ago

boutetnico commented 5 years ago

Pull Request Checklist

Is this in reference to an existing issue? No

General

Purpose

Add a new option --name-prefix / -p allowing to limit alarms considered in the check by a given prefix. The prefix works with the alarm name.

Here is an example:

ruby check-cloudwatch-alarms.rb  -s OK
CloudWatchCheck CRITICAL: 2 in 'OK' state: prod-alarm,staging-alarm
ruby check-cloudwatch-alarms.rb  -s OK -p staging
CloudWatchCheck CRITICAL: 1 in 'OK' state: staging-alarm

Known Compatibility Issues

None