chef-monitor 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/chef-logmon +1 -0
- data/lib/chef_monitor/item.rb +15 -0
- data/lib/chef_monitor/logmon.rb +1 -1
- data/lib/chef_monitor/version.rb +1 -1
- metadata +2 -2
data/bin/chef-logmon
CHANGED
data/lib/chef_monitor/item.rb
CHANGED
@@ -95,6 +95,8 @@ class Monitor
|
|
95
95
|
def get_item_json(object)
|
96
96
|
begin
|
97
97
|
item = rest.get_rest(object)
|
98
|
+
# item.delete('automatic') if item['automatric']
|
99
|
+
item = view_node_data(item) if item.class == Chef::Node
|
98
100
|
result = JSON.pretty_generate(item)
|
99
101
|
rescue Exception => e
|
100
102
|
Monitor::Log.new(e.message + ' with object: ' + @organization + "/" + object , 'ERROR')
|
@@ -103,6 +105,19 @@ class Monitor
|
|
103
105
|
return result
|
104
106
|
end
|
105
107
|
|
108
|
+
def view_node_data(node)
|
109
|
+
result = {}
|
110
|
+
result["name"] = node.name
|
111
|
+
result["chef_environment"] = node.chef_environment
|
112
|
+
result["normal"] = node.normal_attrs
|
113
|
+
result["run_list"] = node.run_list
|
114
|
+
result["default"] = node.default_attrs
|
115
|
+
result["override"] = node.override_attrs
|
116
|
+
# result["automatic"] = node.automatic_attrs
|
117
|
+
result
|
118
|
+
end
|
119
|
+
|
120
|
+
|
106
121
|
def commit(path)
|
107
122
|
current_dir = Dir.pwd
|
108
123
|
commit_dir = File.join(path, @organization)
|
data/lib/chef_monitor/logmon.rb
CHANGED
@@ -47,7 +47,7 @@ class Monitor
|
|
47
47
|
data = {}
|
48
48
|
data['time'] = $3
|
49
49
|
data['user'] = $16
|
50
|
-
data['server'] =
|
50
|
+
data['server'] = LOGMONNAME
|
51
51
|
data['org'] = $5.split('/')[2] unless $5.split('/')[2].nil?
|
52
52
|
data['object'] = $5.split('/')[3] unless $5.split('/')[3].nil?
|
53
53
|
data['name'] = $5.split('/')[4] unless $5.split('/')[4].nil?
|
data/lib/chef_monitor/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bunny
|