用于检查aws cloudwatch度量的nagios插件

nagios-cloudwatch-plugin的Python项目详细描述


此插件用于检查aws cloudwatch度量。它使用流行的boto 用于收集度量值的库此插件当前没有 直接提供aws凭据-为此,请咨询botodocs

设置

  1. pip安装nagios cloudwatch插件

  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
    

用法

cloudwatch度量

有关CloudWatch如何存储度量的信息,请查看doc

  • 简单的EC2 CPU利用率检查,具有警告和临界阈值范围:

    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
    

释放量

0.2.7-2018年5月1日:添加了指定AWS凭证配置文件的选项。谢谢l13t

0.2.6-2014年10月23日:更新了自述示例,修复了输入错误。谢谢桑皮尔森!

0.2.5-2014年9月9日:支持将区域作为参数传递,默认为boto default。谢谢格雷厄姆里昂!

0.2.4-2013年11月20日:增加了对单个度量的增量监控的支持。感谢nesquick&skenke!

0.2.3-2013年11月20日:增加了对两个指标之间的监控比率的支持感谢nesQuick&skenke

开发

把我叉在Github上。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
有没有一种方法可以将不同的java web应用程序组合到一个web应用程序(war)中而不相互影响?   java一次屏蔽两位   java如何在多个类上初始化元素?   java在后台服务中处理通知或使用GCM(或其他推送通知服务)   java从const方法调用JNI函数   javascript如何使用函数/方法返回?   Java优化:声明类变量与使用临时变量   java字符算术基数8 vs基数10   Java流收集要存储的对象列表   swing我正在用Java中的keyListener制作一个精灵移动器   在Gradle构建脚本中使用Scala(或java)方法   java Android Mediaplayer下一步按钮不起作用   Java Sound API在播放音频文件后将其锁定   java将变量从外部类传递到内部类的最佳方法   使用play framework的博客web应用程序出现java逻辑错误   java我们可以在Spring批处理中处理大型zip文件吗?   java如何检查JTable的选定行的特定列中的值是否已经在JList中?