chef-deployment-monitor 1.2.4 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/chef-deployment-monitor.gemspec +1 -2
- data/lib/chef_deployment_monitor/logmon.rb +17 -0
- data/lib/chef_logmon.rb +0 -2
- metadata +3 -19
- data/lib/chef_api_monkey_patch.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fc01ed2f5e97ce4442ec89031ac0347a812222e37bf891acc1333a3fbda6ac07
|
4
|
+
data.tar.gz: 16f89af361c11223084a159182648827623d4fb0b473778fa56a0bfcd9c069de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08edcfc1b1cfe4958f8afc40616215dbde1dae0d282b12b89855f98cc2d489a4e9ffd3d5211fbac408cf5192ced9ce8b54d064ae1767c341800b6b8048411662'
|
7
|
+
data.tar.gz: '0829e69664e9754fa38bcf4dc0376b7a476c89150879159ec8e4aa59571f1a7b1898d3b57a680f147efb2f9a5e41929ed9479fcbd63ae7357fb17b32afb8ca27'
|
@@ -3,7 +3,7 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'chef-deployment-monitor'
|
6
|
-
s.version = '1.
|
6
|
+
s.version = '1.3.0'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.has_rdoc = false
|
9
9
|
s.extra_rdoc_files = ['LICENSE']
|
@@ -21,7 +21,6 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.add_dependency 'daemons', '>= 1.1.9'
|
22
22
|
s.add_dependency 'mixlib-config'
|
23
23
|
s.add_dependency 'json'
|
24
|
-
s.add_dependency 'chef-api', '>= 0.7.1'
|
25
24
|
|
26
25
|
s.add_development_dependency 'rake'
|
27
26
|
s.add_development_dependency 'rubocop'
|
@@ -78,6 +78,22 @@ class Chef
|
|
78
78
|
Monitor::Config[:blacklisted?].call(data)
|
79
79
|
end
|
80
80
|
|
81
|
+
def extract_query_string(url)
|
82
|
+
return unless url
|
83
|
+
|
84
|
+
query_string = url.split('?', 2)[1]
|
85
|
+
return unless query_string
|
86
|
+
|
87
|
+
result = {}
|
88
|
+
query_string.split('&').each do |value|
|
89
|
+
segments = value.split('=', 2)
|
90
|
+
next if segments[0].nil? || segments[0].empty?
|
91
|
+
|
92
|
+
result[segments[0]] = segments[1]
|
93
|
+
end
|
94
|
+
result
|
95
|
+
end
|
96
|
+
|
81
97
|
def scan(line)
|
82
98
|
@regex = /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - (.{0})- \[([^\]]+?)\] "(\w+) ([^\s]+?) (HTTP\/1\.1)" (\d+) "(.*)" (\d+) "-" "(.*)" "(.*)" "(.*)" "(.*)" "(.*)" "(.*)" "(.*)" "(.*)" "(.*)"/
|
83
99
|
if line =~ @regex
|
@@ -89,6 +105,7 @@ class Chef
|
|
89
105
|
data['org'] = Regexp.last_match(5).split('/')[2] unless Regexp.last_match(5).split('/')[2].nil?
|
90
106
|
data['object'] = Regexp.last_match(5).split('/')[3] unless Regexp.last_match(5).split('/')[3].nil?
|
91
107
|
data['name'] = Regexp.last_match(5).split('/')[4] unless Regexp.last_match(5).split('/')[4].nil?
|
108
|
+
data['query'] = extract_query_string(Regexp.last_match(5))
|
92
109
|
if Regexp.last_match(5).split('/')[3] == 'policy_groups'
|
93
110
|
data['subobject'] = Regexp.last_match(5).split('/')[5] unless Regexp.last_match(5).split('/')[5].nil?
|
94
111
|
data['subname'] = Regexp.last_match(5).split('/')[6] unless Regexp.last_match(5).split('/')[6].nil?
|
data/lib/chef_logmon.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-deployment-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sander Botman
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-03-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: file-tail
|
@@ -67,20 +67,6 @@ dependencies:
|
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: chef-api
|
72
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
-
requirements:
|
74
|
-
- - ">="
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: 0.7.1
|
77
|
-
type: :runtime
|
78
|
-
prerelease: false
|
79
|
-
version_requirements: !ruby/object:Gem::Requirement
|
80
|
-
requirements:
|
81
|
-
- - ">="
|
82
|
-
- !ruby/object:Gem::Version
|
83
|
-
version: 0.7.1
|
84
70
|
- !ruby/object:Gem::Dependency
|
85
71
|
name: rake
|
86
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -126,7 +112,6 @@ files:
|
|
126
112
|
- Rakefile
|
127
113
|
- bin/chef-logmon
|
128
114
|
- chef-deployment-monitor.gemspec
|
129
|
-
- lib/chef_api_monkey_patch.rb
|
130
115
|
- lib/chef_deployment_monitor/config.rb
|
131
116
|
- lib/chef_deployment_monitor/log.rb
|
132
117
|
- lib/chef_deployment_monitor/logmon.rb
|
@@ -151,8 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
136
|
- !ruby/object:Gem::Version
|
152
137
|
version: '0'
|
153
138
|
requirements: []
|
154
|
-
|
155
|
-
rubygems_version: 2.6.13
|
139
|
+
rubygems_version: 3.0.3
|
156
140
|
signing_key:
|
157
141
|
specification_version: 4
|
158
142
|
summary: Chef Monitoring tool to monitor all changes made
|
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'chef-api'
|
2
|
-
# TODO: remove when https://github.com/sethvargo/chef-api/pull/56 merged
|
3
|
-
module ChefAPI
|
4
|
-
class Resource::Node
|
5
|
-
collection_path '/nodes'
|
6
|
-
|
7
|
-
schema do
|
8
|
-
attribute :name, type: String, primary: true, required: true
|
9
|
-
attribute :automatic, type: Hash, default: {}
|
10
|
-
attribute :default, type: Hash, default: {}
|
11
|
-
attribute :normal, type: Hash, default: {}
|
12
|
-
attribute :override, type: Hash, default: {}
|
13
|
-
attribute :run_list, type: Array, default: []
|
14
|
-
attribute :policy_name, type: String
|
15
|
-
attribute :policy_group, type: String
|
16
|
-
|
17
|
-
# Enterprise Chef attributes
|
18
|
-
attribute :chef_environment, type: String, default: '_default'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
Logify.level = :error # ignore the stupid ssl_verify warnings in chef-api
|