cfn_monitor 0.4.1 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 420d2480a272de76dfcd2baad3c7cb3f955466dcff3fe2cf9ba2bcc2f607d3f6
4
- data.tar.gz: 0ccdcb98a99859f0cce7019ceedee88dff40b4f0dc63ea32e53d1d97b0dc1304
3
+ metadata.gz: 2b676c1a610e3de06748e27a03ce438b3958efdfcb87d0c0d120e98a65cdbfea
4
+ data.tar.gz: 11a020c7da71160c7c44c4217af6efc55b2a7af9e596f20d78be7667f86cdf66
5
5
  SHA512:
6
- metadata.gz: 6dd02e4fdee8bf609e43e11d423534e82cbfb68c6007969348074b72a5b05e2926c86cb2419318cde1df99a78dbfb408a7cdb5970cc0abd314a45e6f98ba0a48
7
- data.tar.gz: 4fcf0812c6941e3d7ac13579efd6d42156f982403f53d23f420f8ebee16cb166582f372c4614bfdb1959f120cafa033a64fc9548680ebc9b7f2915a0e4f68876
6
+ metadata.gz: 79222e692a97e214e440a83c5d79233e892d1ede6a7b477c9bfc4a1f3566d64ab9ac73df176c902e67b2173c6941e6b4643dbd222687132cbb054c2362e8f3c7
7
+ data.tar.gz: 27bf5f433afa3fbe6392a0d1e66a25a4a68f8a39631ea4ba6d61d745c7998560343b5554825c78ea3b870159654dd77f9590cad14bf589880a2cc6e62c8448d1
@@ -0,0 +1,25 @@
1
+ name: test and build gem
2
+ on:
3
+ push:
4
+ branches: [ master ]
5
+ pull_request:
6
+ branches: [ master ]
7
+
8
+ jobs:
9
+ build:
10
+ name: test + build
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ - name: set up ruby 2.7
16
+ uses: actions/setup-ruby@v1
17
+ with:
18
+ ruby-version: 2.7.x
19
+ - name: rspec
20
+ run: |
21
+ gem install rspec
22
+ rspec
23
+ - name: build gem
24
+ run: |
25
+ gem build cfn_monitor.gemspec
@@ -0,0 +1,34 @@
1
+ name: build image
2
+ on:
3
+ push:
4
+ branches: [ master ]
5
+
6
+ jobs:
7
+ build:
8
+ name: Build + Publish Container Image
9
+ runs-on: ubuntu-latest
10
+
11
+ steps:
12
+ - name: Check out the repo
13
+ uses: actions/checkout@v2
14
+
15
+ - name: Inject slug/short variables
16
+ uses: rlespinasse/github-slug-action@v3.x
17
+
18
+ - name: Set up Docker Buildx
19
+ uses: docker/setup-buildx-action@v1
20
+
21
+ - name: Login to GitHub Container Repository
22
+ uses: docker/login-action@v1
23
+ with:
24
+ registry: ghcr.io
25
+ username: ${{ github.repository_owner }}
26
+ password: ${{ secrets.GHCR_PUSH_TOKEN }}
27
+
28
+ - name: Build and push Container Image to GitHub Container Repository
29
+ uses: docker/build-push-action@v2
30
+ with:
31
+ context: .
32
+ file: ./Dockerfile
33
+ push: true
34
+ tags: ghcr.io/base2services/cfn-monitor:snapshot_${{env.GITHUB_REF_SLUG}}
@@ -0,0 +1,29 @@
1
+ name: release gem
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build + Publish Gem
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Check out the repo
14
+ uses: actions/checkout@v2
15
+
16
+ - name: Set up Ruby 2.7
17
+ uses: actions/setup-ruby@v1
18
+ with:
19
+ ruby-version: 2.7.x
20
+
21
+ - name: build gem
22
+ run: |
23
+ gem build cfn_monitor.gemspec
24
+
25
+ - name: Publish gem to rubygems
26
+ uses: dawidd6/action-publish-gem@v1
27
+ with:
28
+ api_key: ${{secrets.RUBYGEMS_API_KEY}}
29
+ github_token: ${{secrets.GITHUB_TOKEN}}
@@ -0,0 +1,33 @@
1
+ name: release docker image
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ build:
9
+ name: Build + Publish Container Image
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Check out the repo
14
+ uses: actions/checkout@v2
15
+
16
+ - name: Set up Docker Buildx
17
+ uses: docker/setup-buildx-action@v1
18
+
19
+ - name: Login to GitHub Container Repository
20
+ uses: docker/login-action@v1
21
+ with:
22
+ registry: ghcr.io
23
+ username: ${{ github.repository_owner }}
24
+ password: ${{ secrets.GHCR_PUSH_TOKEN }}
25
+
26
+ - name: Build and push Container Image to GitHub Container Repository
27
+ uses: docker/build-push-action@v2
28
+ with:
29
+ context: .
30
+ file: ./Dockerfile
31
+ push: true
32
+ tags: ghcr.io/base2services/cfn-monitor:${{ github.event.release.tag_name }}
33
+ build-args: CFN_MANAGE_VERSION=${{ github.event.release.tag_name }}
data/Dockerfile CHANGED
@@ -1,7 +1,16 @@
1
- FROM ruby:2.5-alpine
1
+ FROM ruby:2.7-alpine
2
2
 
3
- RUN gem install cfn_monitor
3
+ ARG CFN_MONITOR_VERSION=0.4.5
4
+
5
+ COPY . /src
4
6
 
5
7
  WORKDIR /src
6
8
 
7
- CMD ["cfn_monitor"]
9
+ RUN apk add --no-cache git && \
10
+ gem build cfn_monitor.gemspec && \
11
+ gem install cfn_monitor-${CFN_MONITOR_VERSION}.gem && \
12
+ rm -rf /src
13
+
14
+ RUN cfndsl -u 9.0.0
15
+
16
+ CMD cfn_monitor
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cfn_monitor (0.4.0)
4
+ cfn_monitor (0.4.2)
5
5
  aws-sdk-cloudformation (~> 1, < 2)
6
6
  aws-sdk-elasticloadbalancingv2 (~> 1, < 2)
7
7
  aws-sdk-s3 (~> 1, < 2)
@@ -12,23 +12,23 @@ GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
14
  aws-eventstream (1.0.3)
15
- aws-partitions (1.176.0)
16
- aws-sdk-cloudformation (1.23.0)
17
- aws-sdk-core (~> 3, >= 3.56.0)
15
+ aws-partitions (1.196.0)
16
+ aws-sdk-cloudformation (1.25.0)
17
+ aws-sdk-core (~> 3, >= 3.61.1)
18
18
  aws-sigv4 (~> 1.1)
19
- aws-sdk-core (3.56.0)
19
+ aws-sdk-core (3.62.0)
20
20
  aws-eventstream (~> 1.0, >= 1.0.2)
21
21
  aws-partitions (~> 1.0)
22
22
  aws-sigv4 (~> 1.1)
23
23
  jmespath (~> 1.0)
24
- aws-sdk-elasticloadbalancingv2 (1.30.0)
25
- aws-sdk-core (~> 3, >= 3.56.0)
24
+ aws-sdk-elasticloadbalancingv2 (1.33.0)
25
+ aws-sdk-core (~> 3, >= 3.61.1)
26
26
  aws-sigv4 (~> 1.1)
27
- aws-sdk-kms (1.22.0)
28
- aws-sdk-core (~> 3, >= 3.56.0)
27
+ aws-sdk-kms (1.24.0)
28
+ aws-sdk-core (~> 3, >= 3.61.1)
29
29
  aws-sigv4 (~> 1.1)
30
- aws-sdk-s3 (1.43.0)
31
- aws-sdk-core (~> 3, >= 3.56.0)
30
+ aws-sdk-s3 (1.46.0)
31
+ aws-sdk-core (~> 3, >= 3.61.1)
32
32
  aws-sdk-kms (~> 1)
33
33
  aws-sigv4 (~> 1.1)
34
34
  aws-sigv4 (1.1.0)
@@ -36,17 +36,17 @@ GEM
36
36
  cfndsl (0.17.0)
37
37
  diff-lcs (1.3)
38
38
  jmespath (1.4.0)
39
- rake (10.5.0)
39
+ rake (13.0.1)
40
40
  rspec (0.9.4)
41
- rspec-core (3.8.0)
41
+ rspec-core (3.8.2)
42
42
  rspec-support (~> 3.8.0)
43
- rspec-expectations (3.8.2)
43
+ rspec-expectations (3.8.4)
44
44
  diff-lcs (>= 1.2.0, < 2.0)
45
45
  rspec-support (~> 3.8.0)
46
- rspec-mocks (3.8.0)
46
+ rspec-mocks (3.8.1)
47
47
  diff-lcs (>= 1.2.0, < 2.0)
48
48
  rspec-support (~> 3.8.0)
49
- rspec-support (3.8.0)
49
+ rspec-support (3.8.2)
50
50
  thor (0.20.3)
51
51
 
52
52
  PLATFORMS
@@ -55,7 +55,7 @@ PLATFORMS
55
55
  DEPENDENCIES
56
56
  bundler (~> 2)
57
57
  cfn_monitor!
58
- rake (~> 10.0)
58
+ rake (~> 13.0)
59
59
  rspec (~> 0.9)
60
60
  rspec-core (~> 3.8)
61
61
  rspec-expectations (~> 3.8)
data/cfn_monitor.gemspec CHANGED
@@ -25,13 +25,13 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
 
27
27
  spec.add_dependency "thor", "~> 0.19"
28
- spec.add_dependency "cfndsl", "~> 0.16"
28
+ spec.add_dependency "cfndsl", "~> 0.16", "<0.17.1"
29
29
  spec.add_dependency "aws-sdk-cloudformation", "~> 1", "<2"
30
30
  spec.add_dependency "aws-sdk-s3", "~> 1", "<2"
31
31
  spec.add_dependency "aws-sdk-elasticloadbalancingv2", "~> 1", "<2"
32
32
 
33
33
  spec.add_development_dependency "bundler", "~> 2"
34
- spec.add_development_dependency "rake", "~> 10.0"
34
+ spec.add_development_dependency "rake", "~> 13.0"
35
35
  spec.add_development_dependency "rspec", "~> 0.9"
36
36
  spec.add_development_dependency "rspec-core", "~> 3.8"
37
37
  spec.add_development_dependency "rspec-expectations", "~> 3.8"
@@ -1,3 +1,3 @@
1
1
  module CfnMonitor
2
- VERSION = "0.4.1".freeze
2
+ VERSION = "0.4.5".freeze
3
3
  end
@@ -338,6 +338,34 @@ templates:
338
338
  Statistic: Minimum
339
339
  Threshold: 75
340
340
  EvaluationPeriods: 60
341
+ AuroraInstance:
342
+ DBConnections:
343
+ AlarmActions: crit
344
+ Namespace: AWS/RDS
345
+ MetricName: DatabaseConnections
346
+ ComparisonOperator: GreaterThanThreshold
347
+ DimensionsName: DBInstanceIdentifier
348
+ Statistic: Minimum
349
+ Threshold: 45 # This needs to be customised for whichever instance type is being used as it is not a percentage and they all differ
350
+ EvaluationPeriods: 10
351
+ CPUUtilizationHighSpike:
352
+ AlarmActions: crit
353
+ Namespace: AWS/RDS
354
+ MetricName: CPUUtilization
355
+ ComparisonOperator: GreaterThanThreshold
356
+ DimensionsName: DBInstanceIdentifier
357
+ Statistic: Minimum
358
+ Threshold: 95
359
+ EvaluationPeriods: 10
360
+ CPUUtilizationHighBase:
361
+ AlarmActions: warn
362
+ Namespace: AWS/RDS
363
+ MetricName: CPUUtilization
364
+ ComparisonOperator: GreaterThanThreshold
365
+ DimensionsName: DBInstanceIdentifier
366
+ Statistic: Minimum
367
+ Threshold: 75
368
+ EvaluationPeriods: 60
341
369
  DBCluster: # AWS::RDS::DBCluster
342
370
  CPUUtilizationHighSpike:
343
371
  AlarmActions: crit
@@ -459,6 +487,24 @@ templates:
459
487
  Statistic: Minimum
460
488
  Threshold: 75
461
489
  EvaluationPeriods: 10
490
+ CurrentConnectionsTask:
491
+ AlarmActions: task
492
+ Namespace: AWS/ElastiCache
493
+ MetricName: CurrConnections
494
+ ComparisonOperator: GreaterThanThreshold
495
+ DimensionsName: CacheClusterId
496
+ Statistic: Maximum
497
+ Threshold: 50000
498
+ EvaluationPeriods: 10
499
+ CurrentConnectionsCrit:
500
+ AlarmActions: crit
501
+ Namespace: AWS/ElastiCache
502
+ MetricName: CurrConnections
503
+ ComparisonOperator: GreaterThanThreshold
504
+ DimensionsName: CacheClusterId
505
+ Statistic: Maximum
506
+ Threshold: 60000
507
+ EvaluationPeriods: 10
462
508
  ElasticFileSystem: # AWS::EFS::FileSystem
463
509
  PercentIOLimitHigh:
464
510
  AlarmActions: crit
@@ -480,6 +526,7 @@ templates:
480
526
  Statistic: Sum
481
527
  Threshold: 5
482
528
  EvaluationPeriods: 2
529
+ TreatMissingData: notBreaching
483
530
  ApiEndpoint4xx:
484
531
  AlarmActions: warn
485
532
  Namespace: AWS/ApiGateway
@@ -490,6 +537,7 @@ templates:
490
537
  Statistic: Sum
491
538
  Threshold: 5
492
539
  EvaluationPeriods: 2
540
+ TreatMissingData: notBreaching
493
541
  Latency:
494
542
  AlarmActions: warn
495
543
  Namespace: AWS/ApiGateway
@@ -498,7 +546,7 @@ templates:
498
546
  #DimensionsName: ApiName
499
547
  Dimensions: [ { Name: 'ApiName', Value: '${name}' }]
500
548
  Statistic: Average
501
- Threshold: 5
549
+ Threshold: 1000
502
550
  EvaluationPeriods: 2
503
551
  DynamoDBTable: #AWS::DynamoDB::Table
504
552
  DynamoDBReadUsage:
@@ -528,6 +576,7 @@ templates:
528
576
  Statistic: Sum
529
577
  Threshold: 1
530
578
  EvaluationPeriods: 2
579
+ TreatMissingData: notBreaching
531
580
  DynamoDBWriteThrottleEvents:
532
581
  AlarmActions: warn
533
582
  Namespace: AWS/DynamoDB
@@ -537,6 +586,7 @@ templates:
537
586
  Statistic: Sum
538
587
  Threshold: 1
539
588
  EvaluationPeriods: 2
589
+ TreatMissingData: notBreaching
540
590
  ElasticLoadBalancerSingleInstance: # AWS::ElasticLoadBalancing::LoadBalancer
541
591
  HealthyHosts:
542
592
  AlarmActions: crit
@@ -695,6 +745,18 @@ templates:
695
745
  Period: 60
696
746
  EvaluationPeriods: 1
697
747
  MetricName: INodesUsedCount
748
+
749
+ Memory: # Pushed by the CloudWatch agent
750
+ HighMemoryUsage:
751
+ AlarmActions: crit
752
+ Namespace: CWAgent
753
+ ComparisonOperator: GreaterThanOrEqualToThreshold
754
+ Dimensions: [ { Name: 'host', Value: "${metric}" } ]
755
+ Statistic: Maximum
756
+ Threshold: 90 # Percentage used
757
+ Period: 60
758
+ EvaluationPeriods: 5
759
+ MetricName: MemoryUsedPercent
698
760
  TreatMissingData: breaching
699
761
 
700
762
  AmazonMQBroker: # AWS::AmazonMQ::Broker
@@ -751,7 +813,7 @@ templates:
751
813
  Period: 60
752
814
  EvaluationPeriods: 5
753
815
  MetricName: ApproximateAgeOfOldestMessage
754
- TreatMissingData: breaching
816
+ TreatMissingData: notBreaching
755
817
  ApproximateNumberOfMessagesVisible:
756
818
  AlarmActions: crit
757
819
  Namespace: AWS/SQS
@@ -762,7 +824,7 @@ templates:
762
824
  Period: 60
763
825
  EvaluationPeriods: 5
764
826
  MetricName: ApproximateNumberOfMessagesVisible
765
- TreatMissingData: breaching
827
+ TreatMissingData: notBreaching
766
828
  LambdaFunction: #AWS::Lambda::Function
767
829
  Throttles:
768
830
  AlarmActions: crit
@@ -73,7 +73,7 @@ CloudFormation do
73
73
  Resource("NrpeCheckFunction#{hostHash}") do
74
74
  Condition "Condition#{hostHash}" if alarm[:environments] != ['all']
75
75
  Type 'AWS::Lambda::Function'
76
- Property('Code', { S3Bucket: FnJoin('.', ['base2.lambda', Ref('AWS::Region')]), S3Key: 'aws-lambda-nrpe-check/0.1/handler.zip' })
76
+ Property('Code', { S3Bucket: FnJoin('.', ['base2.lambda', Ref('AWS::Region')]), S3Key: 'aws-lambda-nrpe-check/0.2/handler.zip' })
77
77
  Property('Handler', 'main')
78
78
  Property('MemorySize', 128)
79
79
  Property('Runtime', 'go1.x')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn_monitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Base2Services
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2019-07-11 00:00:00.000000000 Z
13
+ date: 2021-07-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -33,6 +33,9 @@ dependencies:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
35
  version: '0.16'
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: 0.17.1
36
39
  type: :runtime
37
40
  prerelease: false
38
41
  version_requirements: !ruby/object:Gem::Requirement
@@ -40,6 +43,9 @@ dependencies:
40
43
  - - "~>"
41
44
  - !ruby/object:Gem::Version
42
45
  version: '0.16'
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: 0.17.1
43
49
  - !ruby/object:Gem::Dependency
44
50
  name: aws-sdk-cloudformation
45
51
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +126,14 @@ dependencies:
120
126
  requirements:
121
127
  - - "~>"
122
128
  - !ruby/object:Gem::Version
123
- version: '10.0'
129
+ version: '13.0'
124
130
  type: :development
125
131
  prerelease: false
126
132
  version_requirements: !ruby/object:Gem::Requirement
127
133
  requirements:
128
134
  - - "~>"
129
135
  - !ruby/object:Gem::Version
130
- version: '10.0'
136
+ version: '13.0'
131
137
  - !ruby/object:Gem::Dependency
132
138
  name: rspec
133
139
  requirement: !ruby/object:Gem::Requirement
@@ -196,9 +202,12 @@ executables:
196
202
  extensions: []
197
203
  extra_rdoc_files: []
198
204
  files:
205
+ - ".github/workflows/build-gem.yml"
206
+ - ".github/workflows/push.yml"
207
+ - ".github/workflows/release-gem.yml"
208
+ - ".github/workflows/release-image.yml"
199
209
  - ".gitignore"
200
210
  - ".rspec"
201
- - ".travis.yml"
202
211
  - Dockerfile
203
212
  - Gemfile
204
213
  - Gemfile.lock
@@ -248,7 +257,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
257
  - !ruby/object:Gem::Version
249
258
  version: '0'
250
259
  requirements: []
251
- rubygems_version: 3.0.4
260
+ rubygems_version: 3.1.6
252
261
  signing_key:
253
262
  specification_version: 4
254
263
  summary: Configure and generate a cloudwatch monitoring cloudformation stack
data/.travis.yml DELETED
@@ -1,20 +0,0 @@
1
- sudo: required
2
- dist: trusty
3
- language: ruby
4
- rvm:
5
- - 2.5
6
- before_install:
7
- - gem install bundler:2.0.1
8
- - bundle install
9
- script:
10
- - bundle exec rake spec
11
- - gem build cfn_monitor.gemspec
12
- - gem install cfn_monitor-*.gem
13
- - cfn_monitor --version
14
- deploy:
15
- provider: rubygems
16
- api_key: "${RUBYGEMS_API_KEY}"
17
- gem: cfn_monitor
18
- on:
19
- all_branches: true
20
- condition: $TRAVIS_BRANCH =~ ^develop|master && $TRAVIS_EVENT_TYPE =~ ^push|api$ && $TRAVIS_REPO_SLUG == "base2Services/cfn-monitor"