fauguste/cloudwatch-script-php

PHP script for cloud watch metrics ans alarms generation

v0.0.15 2021-03-11 13:18 UTC

This package is not auto-updated.

Last update: 2024-12-21 19:37:12 UTC


README

Build Status Scrutinizer Code Quality SensioLabsInsight Code Climate Test Coverage

Amazon CloudWatch Monitoring Scripts for EC2 Instance

This project provide some scripts in order to monitor your EC2 instances with CloudWatch.
You can add your own scripts in the plugin directory.

Requirements

This libraries are required for this project :

# Using PHP5
php5-cli, php5-curl

# Using PHP7
php-cli, php-curl

Configuration

Authorize this policy :

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Stmt1446055544000",
            "Effect": "Allow",
            "Action": [
                "cloudwatch:PutMetricAlarm",
                "cloudwatch:PutMetricData",
                "cloudwatch:DeleteAlarms"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}

Using IAM roles

   'profil':'YOUR_PROFIL',

Using credentials

Add your key and secret in the config file.

   'key':'YOUR_KEY',
   'secret':'YOUR_SECRET',

Usage

Send metrics to CloudWatch (Run every 5 minutes)`

php metrics.php [-f config-file]

Create alarms in CloudWatch (Run one time)

php alarmes.php [-f config-file]

Delete alarms in CloudWatch (Run one time)

php delete-alarmes.php [-f config-file]

Plugins

License

This application licensed by Apache License Version 2.0.