Skip to main content

Nagios plugin to check AWS CloudWatch metrics

Project description

This plugin for checks AWS CloudWatch metrics. It uses the popular boto library to gather metric values. This plugin does not currently have a means of directly supplying AWS credentials - for this, consult the boto docs.

Setup

  1. pip install nagios-cloudwatch-plugin

  2. /usr/local/bin/check_cloudwatch.py -h:

              usage: check_cloudwatch.py [-h] -n NAMESPACE -m METRIC [-d DIMENSIONS]
                                         [-s {Average,Sum,SampleCount,Maximum,Minimum}]
                                         [-p PERIOD] [-l LAG] [-r]
                                         [--divisor-namespace DIVISOR_NAMESPACE]
                                         [--divisor-metric DIVISOR_METRIC]
                                         [--divisor-dimensions DIVISOR_DIMENSIONS]
                                         [--divisor-statistic {Average,Sum,SampleCount,Maximum,Minimum}]
                                         [--delta DELTA] [-w RANGE] [-c RANGE] [-v]
                                         [-R REGION]
                             [-P profile_name]
    
              Nagios plugin to check cloudwatch metrics
    
              optional arguments:
                -h, --help            show this help message and exit
                -n NAMESPACE, --namespace NAMESPACE
                                      namespace for cloudwatch metric
                -m METRIC, --metric METRIC
                                      metric name
                -d DIMENSIONS, --dimensions DIMENSIONS
                                      dimensions of cloudwatch metric in the format
                                      dimension=value[,dimension=value...]
                -s {Average,Sum,SampleCount,Maximum,Minimum}, --statistic {Average,Sum,SampleCount,Maximum,Minimum}
                                      statistic used to evaluate metric
                -p PERIOD, --period PERIOD
                                      the period in seconds over which the statistic is
                                      applied
                -l LAG, --lag LAG     delay in seconds to add to starting time for gathering
                                      metric. useful for ec2 basic monitoring which
                                      aggregates over 5min periods
                -r, --ratio           this activates ratio mode
                --divisor-namespace DIVISOR_NAMESPACE
                                      ratio mode: namespace for cloudwatch metric of the
                                      divisor
                --divisor-metric DIVISOR_METRIC
                                      ratio mode: metric name of the divisor
                --divisor-dimensions DIVISOR_DIMENSIONS
                                      ratio mode: dimensions of cloudwatch metric of the
                                      divisor
                --divisor-statistic {Average,Sum,SampleCount,Maximum,Minimum}
                                      ratio mode: statistic used to evaluate metric of the
                                      divisor
                --delta DELTA         time in seconds to build a delta mesurement
                -w RANGE, --warning RANGE
                                      warning if threshold is outside RANGE
                -c RANGE, --critical RANGE
                                      critical if threshold is outside RANGE
                -v, --verbose         increase verbosity (use up to 3 times)
                -R REGION, --region REGION
                                      The AWS region to read metrics from
    -P profile_name, --profile profile_name
                          Profile name from ~/.aws/credentials

Usage

Cloudwatch metrics

For information on how CloudWatch stores metrics check this doc out.

  • Simple EC2 CPU Utilization check, with warning and critical threshold ranges:

    check_cloudwatch.py -R us-west-2 -n AWS/EC2 -m CPUUtilization -p 600 -d InstanceId=i-abcd1234 -w 0:75 -c 0:90
    check_cloudwatch.py -R us-west-2 -n AWS/EC2 -m CPUUtilization -p 600 -d InstanceId=i-1bcd1234 -w 0:75 -c 0:90 -P dc-live
    check_cloudwatch.py -R us-west-2 -n AWS/EC2 -m CPUUtilization -p 600 -d InstanceId=i-2bcd1234 -w 0:75 -c 0:90 -P dc-staging

Releases

0.2.8 - June 03, 2020: Bugfix: An error was thrown when using the –profile argument with –ratio mode. Thanks thewizarodofoz!

0.2.7 - May 01, 2018: Added option to specify AWS credential profile. Thanks l13t!

0.2.6 - Oct 23, 2014: Updated Readme example, fixed typoes. Thanks sampierson !

0.2.5 - Sep 09, 2014: Support passing region as an argument, defaulting to boto default. Thanks grahamlyons!

0.2.4 - Nov 20, 2013: Added support for delta monitoring of a single metric. Thanks nesQuick & s0enke!

0.2.3 - Nov 20, 2013: Added support for monitoring ratio between two metrics. Thanks nesQuick & s0enke!

Develop

Fork me on Github.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nagios-cloudwatch-plugin-0.2.8.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file nagios-cloudwatch-plugin-0.2.8.tar.gz.

File metadata

  • Download URL: nagios-cloudwatch-plugin-0.2.8.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for nagios-cloudwatch-plugin-0.2.8.tar.gz
Algorithm Hash digest
SHA256 0490724ecf3054cfc7c80fdc786c201cd5033d58f3328ade088542f97cfb2182
MD5 56fec4467d038c05fb910a6cd1f4fae6
BLAKE2b-256 687dde0cdb5d311594a42270af00562bca3c8453863a884351b3a911b54e7c5d

See more details on using hashes here.

File details

Details for the file nagios_cloudwatch_plugin-0.2.8-py3-none-any.whl.

File metadata

  • Download URL: nagios_cloudwatch_plugin-0.2.8-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2

File hashes

Hashes for nagios_cloudwatch_plugin-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 34b96d8054b24a3622a3c764818a302394436543e9acceea7d792dfe7e911ded
MD5 57166b31f501bce4e00688d80aff670c
BLAKE2b-256 278f67f2176bcc2d66b48f9c55accd80392ae89a7b915e5fc099a691e9eb6fa5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page