onering-report-plugins 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
if Facter::Util::Resolution.which('vgc-monitor')
|
|
2
|
+
virident_cards = []
|
|
3
|
+
|
|
4
|
+
Facter::Util::Resolution.exec("vgc-monitor | grep '^/dev'").split("\n").each do |card|
|
|
5
|
+
name, partitions, model, status = card.strip.chomp.split(/\s+/)
|
|
6
|
+
card = {
|
|
7
|
+
:name => name,
|
|
8
|
+
:model => model.strip,
|
|
9
|
+
:status => status.downcase,
|
|
10
|
+
:driver => {},
|
|
11
|
+
:partitions => []
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
part = {}
|
|
15
|
+
part_name = nil
|
|
16
|
+
details = Facter::Util::Resolution.exec("vgc-monitor -d #{name}").split(/\n/).collect{|i| i.strip.split(/\s*:\s*/,2) }
|
|
17
|
+
|
|
18
|
+
details.each_index do |i|
|
|
19
|
+
detail = details[i]
|
|
20
|
+
|
|
21
|
+
if detail.length == 2
|
|
22
|
+
case detail.first
|
|
23
|
+
when 'vgc-monitor'
|
|
24
|
+
card[:driver][:tool_version] = detail.last
|
|
25
|
+
|
|
26
|
+
# when 'Driver Uptime'
|
|
27
|
+
# card[:driver][:uptime] = detail.last
|
|
28
|
+
|
|
29
|
+
when 'Serial Number'
|
|
30
|
+
card[:serial] = detail.last
|
|
31
|
+
|
|
32
|
+
when 'Temperature'
|
|
33
|
+
card[:temperature] = detail.last.split(' ').first.to_i
|
|
34
|
+
|
|
35
|
+
when 'Rev'
|
|
36
|
+
card[:description] = detail.last
|
|
37
|
+
|
|
38
|
+
when 'Card State Details'
|
|
39
|
+
st = detail.last.downcase
|
|
40
|
+
next if st == 'normal'
|
|
41
|
+
card[:status_detail] = st
|
|
42
|
+
|
|
43
|
+
when 'Action Required'
|
|
44
|
+
action = detail.last.downcase
|
|
45
|
+
next if action == 'none'
|
|
46
|
+
card[:action_required] = action
|
|
47
|
+
|
|
48
|
+
# partitions
|
|
49
|
+
when 'Mode'
|
|
50
|
+
part[part_name][:mode] = detail.last
|
|
51
|
+
|
|
52
|
+
when 'Total Flash Bytes'
|
|
53
|
+
part[part_name][:throughput] ||= {}
|
|
54
|
+
part[part_name][:throughput][:read_bytes] = detail.last.split(' ').first.to_i
|
|
55
|
+
part[part_name][:throughput][:write_bytes] = details[i+1].first.split(' ').first.to_i
|
|
56
|
+
|
|
57
|
+
when 'Remaining Life'
|
|
58
|
+
part[part_name][:life_remaining] = detail.last.delete('%').to_f
|
|
59
|
+
|
|
60
|
+
when 'Partition State'
|
|
61
|
+
part[part_name][:state] = detail.last.downcase
|
|
62
|
+
|
|
63
|
+
when 'Flash Reserves Left'
|
|
64
|
+
part[part_name][:reserves_remaining] = detail.last.delete('%').to_f
|
|
65
|
+
|
|
66
|
+
end
|
|
67
|
+
else
|
|
68
|
+
if detail.first.to_s =~ /^\/dev\/(vgc[a-z]+[0-9]+)\s+([0-9]+) [KMGTPEZY]?B\s+([a-z]+)$/
|
|
69
|
+
card[:partitions] << part unless part_name.nil?
|
|
70
|
+
|
|
71
|
+
part_name = $1
|
|
72
|
+
part[part_name] ||= {}
|
|
73
|
+
part[part_name][:name] = part_name
|
|
74
|
+
part[part_name][:size] = ($2.to_i * (1024 ** 3))
|
|
75
|
+
part[part_name][:raid_enabled] = ($3 == 'enabled')
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
card[:partitions] << part unless part_name.nil?
|
|
82
|
+
virident_cards << card
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
Facter.add("virident") do
|
|
86
|
+
setcode do
|
|
87
|
+
virident_cards
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: onering-report-plugins
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.11
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -13,7 +13,7 @@ date: 2013-04-09 00:00:00.000000000 Z
|
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: onering-client
|
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirement: &19911060 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ! '>='
|
|
@@ -21,12 +21,7 @@ dependencies:
|
|
|
21
21
|
version: '0'
|
|
22
22
|
type: :runtime
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements:
|
|
25
|
-
none: false
|
|
26
|
-
requirements:
|
|
27
|
-
- - ! '>='
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
version: '0'
|
|
24
|
+
version_requirements: *19911060
|
|
30
25
|
description: Base plugins for providing system information via the Onering client
|
|
31
26
|
utility
|
|
32
27
|
email: ghetzel@outbrain.com
|
|
@@ -34,24 +29,26 @@ executables: []
|
|
|
34
29
|
extensions: []
|
|
35
30
|
extra_rdoc_files: []
|
|
36
31
|
files:
|
|
37
|
-
- lib/reporter/default/properties_facter.rb
|
|
38
|
-
- lib/reporter/default/stats_disk.rb
|
|
39
|
-
- lib/reporter/default/properties_xen.rb
|
|
40
|
-
- lib/reporter/default/properties_openvz.rb
|
|
41
|
-
- lib/reporter/default/properties_network.rb
|
|
42
|
-
- lib/reporter/default/properties_physical.rb
|
|
43
|
-
- lib/reporter/default/properties_ohai.rb
|
|
44
|
-
- lib/reporter/default/stats_base.rb
|
|
45
|
-
- lib/reporter/default/properties_services.rb
|
|
46
|
-
- lib/reporter/default/properties_chef.rb
|
|
47
32
|
- lib/facter/onering_properties_openvz.rb
|
|
33
|
+
- lib/facter/onering_properties_network.rb
|
|
34
|
+
- lib/facter/onering_properties_virident.rb
|
|
35
|
+
- lib/facter/onering_properties_services.rb
|
|
48
36
|
- lib/facter/onering_properties_chef.rb
|
|
49
37
|
- lib/facter/onering_properties_physical.rb
|
|
50
|
-
- lib/facter/onering_properties_xen.rb
|
|
51
|
-
- lib/facter/onering_properties_services.rb
|
|
52
|
-
- lib/facter/onering_properties_network.rb
|
|
53
38
|
- lib/facter/onering_properties_system.rb
|
|
54
39
|
- lib/facter/onering_properties_id.rb
|
|
40
|
+
- lib/facter/onering_properties_xen.rb
|
|
41
|
+
- lib/reporter/default/properties_physical.rb
|
|
42
|
+
- lib/reporter/default/properties_facter.rb
|
|
43
|
+
- lib/reporter/default/stats_disk.rb
|
|
44
|
+
- lib/reporter/default/properties_openvz.rb
|
|
45
|
+
- lib/reporter/default/properties_xen.rb
|
|
46
|
+
- lib/reporter/default/properties_chef.rb
|
|
47
|
+
- lib/reporter/default/stats_virident.rb
|
|
48
|
+
- lib/reporter/default/properties_ohai.rb
|
|
49
|
+
- lib/reporter/default/properties_network.rb
|
|
50
|
+
- lib/reporter/default/properties_services.rb
|
|
51
|
+
- lib/reporter/default/stats_base.rb
|
|
55
52
|
homepage: https://github.com/outbrain/onering-report-plugins
|
|
56
53
|
licenses: []
|
|
57
54
|
post_install_message:
|
|
@@ -72,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
72
69
|
version: '0'
|
|
73
70
|
requirements: []
|
|
74
71
|
rubyforge_project:
|
|
75
|
-
rubygems_version: 1.8.
|
|
72
|
+
rubygems_version: 1.8.11
|
|
76
73
|
signing_key:
|
|
77
74
|
specification_version: 3
|
|
78
75
|
summary: Onering system reporting plugins
|