boris 1.0.2 → 1.0.3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +58 -30
- data/Rakefile +7 -1
- data/code_lookups.yml +94 -0
- data/lib/boris.rb +17 -2
- data/lib/boris/connectors.rb +3 -2
- data/lib/boris/connectors/ssh.rb +92 -48
- data/lib/boris/connectors/wmi.rb +8 -5
- data/lib/boris/{helpers → core_ext}/array.rb +0 -0
- data/lib/boris/core_ext/datetime.rb +38 -0
- data/lib/boris/{helpers → core_ext}/hash.rb +0 -0
- data/lib/boris/{helpers → core_ext}/string.rb +91 -33
- data/lib/boris/{helpers → core_ext}/time.rb +0 -0
- data/lib/boris/helpers/constants.rb +6 -3
- data/lib/boris/helpers/scrubber.rb +2 -1
- data/lib/boris/options.rb +29 -7
- data/lib/boris/profiler_core.rb +15 -0
- data/lib/boris/profilers/big_ip/big_ip10.rb +10 -0
- data/lib/boris/profilers/big_ip/big_ip11.rb +10 -0
- data/lib/boris/profilers/big_ip_core.rb +210 -0
- data/lib/boris/profilers/brocade_fos/fos6.rb +10 -0
- data/lib/boris/profilers/brocade_fos_core.rb +144 -0
- data/lib/boris/profilers/cisco/ios12.rb +21 -0
- data/lib/boris/profilers/cisco/nxos5.rb +11 -0
- data/lib/boris/profilers/cisco_ios_core.rb +138 -0
- data/lib/boris/profilers/cisco_nxos_core.rb +148 -0
- data/lib/boris/profilers/linux/redhat/rhel5.rb +13 -0
- data/lib/boris/profilers/linux/redhat/rhel6.rb +13 -0
- data/lib/boris/profilers/linux/{redhat.rb → redhat_core.rb} +2 -8
- data/lib/boris/profilers/linux_core.rb +25 -7
- data/lib/boris/profilers/onboard_administrator/oa3.rb +10 -0
- data/lib/boris/profilers/onboard_administrator_core.rb +96 -0
- data/lib/boris/profilers/unix/solaris/solaris10.rb +11 -0
- data/lib/boris/profilers/unix/solaris/solaris11.rb +11 -0
- data/lib/boris/profilers/unix/{solaris.rb → solaris_core.rb} +13 -13
- data/lib/boris/profilers/unix_core.rb +23 -6
- data/lib/boris/profilers/windows/windows2003.rb +1 -2
- data/lib/boris/profilers/windows/windows2008.rb +1 -2
- data/lib/boris/profilers/windows/windows2012.rb +1 -2
- data/lib/boris/profilers/windows_core.rb +29 -8
- data/lib/boris/structure.rb +15 -0
- data/lib/boris/target.rb +19 -3
- data/lib/boris/version.rb +1 -1
- metadata +27 -11
- data/lib/boris/helpers.rb +0 -7
- data/lib/boris/profiler.rb +0 -18
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'boris/profilers/linux/redhat_core'
|
2
|
+
|
3
|
+
module Boris; module Profilers
|
4
|
+
class RHEL5 < RedHatCore
|
5
|
+
|
6
|
+
def self.matches_target?(connector)
|
7
|
+
release_data = connector.values_at(%q{ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb|system"}).join(' ')
|
8
|
+
if release_data =~ /redhat-release/i && connector.value_at('cat /etc/redhat-release') =~ /release 5\./
|
9
|
+
return true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end; end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'boris/profilers/linux/redhat_core'
|
2
|
+
|
3
|
+
module Boris; module Profilers
|
4
|
+
class RHEL6 < RedHatCore
|
5
|
+
|
6
|
+
def self.matches_target?(connector)
|
7
|
+
release_data = connector.values_at(%q{ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb|system"}).join(' ')
|
8
|
+
if release_data =~ /redhat-release/i && connector.value_at('cat /etc/redhat-release') =~ /release 6\./
|
9
|
+
return true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end; end
|
@@ -1,13 +1,7 @@
|
|
1
|
-
require 'boris/profiler'
|
2
1
|
require 'boris/profilers/linux_core'
|
3
2
|
|
4
3
|
module Boris; module Profilers
|
5
|
-
class
|
6
|
-
|
7
|
-
def self.matches_target?(connector)
|
8
|
-
release_data = connector.values_at(%q{ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb|system" | cut -d '/' -f3 | cut -d '-' -f1 | cut -d '_' -f1}).join(' ')
|
9
|
-
return true if release_data =~ /redhat/i
|
10
|
-
end
|
4
|
+
class RedHatCore < LinuxCore
|
11
5
|
|
12
6
|
def get_file_systems; super; end
|
13
7
|
def get_hardware; super; end
|
@@ -66,7 +60,7 @@ module Boris; module Profilers
|
|
66
60
|
|
67
61
|
os_base_name = os_data.grep(/^description/i)[0].after_colon
|
68
62
|
@operating_system[:name] = os_base_name.split(/ linux /i)[0] + ' Linux'
|
69
|
-
@operating_system[:version] = os_base_name.
|
63
|
+
@operating_system[:version] = os_base_name.extract(/linux (.+) release/i) + ' ' + os_data.grep(/^release/i)[0].after_colon
|
70
64
|
|
71
65
|
@operating_system
|
72
66
|
end
|
@@ -1,16 +1,13 @@
|
|
1
|
-
require 'boris/
|
1
|
+
require 'boris/profiler_core'
|
2
2
|
|
3
3
|
module Boris; module Profilers
|
4
|
-
class
|
4
|
+
class LinuxCore
|
5
|
+
include ProfilerCore
|
5
6
|
|
6
7
|
def self.connection_type
|
7
8
|
Boris::SSHConnector
|
8
9
|
end
|
9
10
|
|
10
|
-
def self.matches_target?(connector)
|
11
|
-
return true if connector.value_at('uname -a') =~ /linux/i
|
12
|
-
end
|
13
|
-
|
14
11
|
def get_file_systems
|
15
12
|
super
|
16
13
|
|
@@ -50,9 +47,10 @@ module Boris; module Profilers
|
|
50
47
|
@hardware[:memory_installed_mb] = memory_data.to_i
|
51
48
|
|
52
49
|
hardware_data = @connector.values_at('/usr/bin/sudo /usr/sbin/dmidecode -t 0,1,4', true)
|
50
|
+
|
53
51
|
if hardware_data.any?
|
54
52
|
# grab the cpu speed again (because its value is usually more useful/relevant than that found via /proc/cpuinfo)
|
55
|
-
@hardware[:cpu_speed_mhz] = hardware_data.grep(/current speed/i)[0].after_colon.
|
53
|
+
@hardware[:cpu_speed_mhz] = hardware_data.grep(/current speed/i)[0].after_colon.extract(/(\d+)/).to_i
|
56
54
|
@hardware[:firmware_version] = hardware_data.grep(/version/i)[0].after_colon
|
57
55
|
@hardware[:model] = hardware_data.grep(/product name/i)[0].after_colon
|
58
56
|
@hardware[:serial] = hardware_data.grep(/serial number/i)[0].after_colon
|
@@ -221,5 +219,25 @@ module Boris; module Profilers
|
|
221
219
|
end
|
222
220
|
|
223
221
|
def get_operating_system; super; end
|
222
|
+
|
223
|
+
def get_running_processes
|
224
|
+
super
|
225
|
+
|
226
|
+
now = DateTime.parse(@connector.value_at('date'))
|
227
|
+
process_data = @connector.values_at('ps -eo time,etime,comm | tail -n +2 | grep -v defunct')
|
228
|
+
process_data.each do |process|
|
229
|
+
process = process.split
|
230
|
+
|
231
|
+
h = running_process_template
|
232
|
+
|
233
|
+
h[:cpu_time] = process.shift.pad_elapsed_time
|
234
|
+
h[:date_started] = DateTime.parse_start_date(now, process.shift)
|
235
|
+
h[:command] = process.join(' ')
|
236
|
+
|
237
|
+
@running_processes << h
|
238
|
+
end
|
239
|
+
|
240
|
+
@running_processes
|
241
|
+
end
|
224
242
|
end
|
225
243
|
end; end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'boris/profilers/onboard_administrator_core'
|
2
|
+
|
3
|
+
module Boris; module Profilers
|
4
|
+
class OA3 < OnboardAdministratorCore
|
5
|
+
|
6
|
+
def self.matches_target?(connector)
|
7
|
+
return true if connector.values_at('show fru').join =~ /firmware version: 3/i
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end; end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
require 'boris/profiler_core'
|
2
|
+
|
3
|
+
module Boris; module Profilers
|
4
|
+
class OnboardAdministratorCore
|
5
|
+
include ProfilerCore
|
6
|
+
|
7
|
+
attr_reader :enclosure_data
|
8
|
+
|
9
|
+
def self.connection_type
|
10
|
+
Boris::SSHConnector
|
11
|
+
end
|
12
|
+
|
13
|
+
def enclosure_data
|
14
|
+
@enclosure_data ||= @connector.values_at('show enclosure info')
|
15
|
+
end
|
16
|
+
|
17
|
+
def fru_data
|
18
|
+
@fru_data ||= @connector.values_at('show fru')
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_file_systems; super; end
|
22
|
+
|
23
|
+
def get_hardware
|
24
|
+
super
|
25
|
+
|
26
|
+
enclosure_data
|
27
|
+
|
28
|
+
@hardware[:firmware_version] = fru_data.grep(/firmware version/i)[0].after_colon
|
29
|
+
@hardware[:model] = enclosure_data.grep(/enclosure type/i)[0].after_colon
|
30
|
+
@hardware[:serial] = enclosure_data.grep(/serial number/i)[0].after_colon
|
31
|
+
@hardware[:vendor] = VENDOR_HP
|
32
|
+
|
33
|
+
@hardware
|
34
|
+
end
|
35
|
+
|
36
|
+
def get_hosted_shares; super; end
|
37
|
+
def get_installed_applications; super; end
|
38
|
+
def get_installed_patches; super; end
|
39
|
+
def get_installed_services; super; end
|
40
|
+
def get_local_user_groups; super; end
|
41
|
+
|
42
|
+
def get_network_id
|
43
|
+
super
|
44
|
+
|
45
|
+
@network_id[:hostname] = enclosure_data.grep(/enclosure name/i)[0].after_colon
|
46
|
+
|
47
|
+
@network_id
|
48
|
+
end
|
49
|
+
|
50
|
+
def get_network_interfaces
|
51
|
+
super
|
52
|
+
|
53
|
+
ethernet_interfaces = @connector.values_at('show oa network all').join("\n").strip.split(/Onboard Administrator #\d/i)[1..-1]
|
54
|
+
|
55
|
+
ethernet_interfaces.each do |interface|
|
56
|
+
interface = interface.split(/\n/)
|
57
|
+
|
58
|
+
h = network_interface_template
|
59
|
+
|
60
|
+
h[:mac_address] = interface.grep(/mac address/i)[0].split.last
|
61
|
+
h[:model] = 'Unknown Ethernet Adapter'
|
62
|
+
h[:name] = interface.grep(/name/i)[0].after_colon
|
63
|
+
h[:status] = interface.grep(/link status/i)[0] =~ /not active/i ? 'down' : 'up'
|
64
|
+
h[:type] = 'ethernet'
|
65
|
+
h[:vendor] = VENDOR_HP
|
66
|
+
|
67
|
+
if h[:status] == 'up'
|
68
|
+
link_settings = interface.grep(/link settings/i)[0]
|
69
|
+
|
70
|
+
h[:auto_negotiate] = link_settings =~ /auto/i ? true : nil
|
71
|
+
h[:current_speed_mbps] = link_settings.extract(/(\d+) mbps/i).to_i
|
72
|
+
h[:duplex] = link_settings =~ /half duplex/i ? 'half' : 'full'
|
73
|
+
ip_address = interface.grep(/ipv4 address/i)[0].after_colon
|
74
|
+
subnet_mask = interface.grep(/netmask/i)[0].after_colon
|
75
|
+
h[:ip_addresses] << {:ip_address=>ip_address, :subnet=>subnet_mask}
|
76
|
+
end
|
77
|
+
|
78
|
+
@network_interfaces << h
|
79
|
+
end
|
80
|
+
|
81
|
+
@network_interfaces
|
82
|
+
end
|
83
|
+
|
84
|
+
def get_operating_system
|
85
|
+
super
|
86
|
+
|
87
|
+
@operating_system[:name] = 'HP Onboard Administrator'
|
88
|
+
@operating_system[:version] = fru_data.grep(/firmware version/i)[0].after_colon
|
89
|
+
|
90
|
+
@operating_system
|
91
|
+
end
|
92
|
+
|
93
|
+
def get_running_processes; super; end
|
94
|
+
|
95
|
+
end
|
96
|
+
end; end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'boris/profilers/unix/solaris_core'
|
2
|
+
|
3
|
+
module Boris; module Profilers
|
4
|
+
class Solaris10 < SolarisCore
|
5
|
+
|
6
|
+
def self.matches_target?(connector)
|
7
|
+
release_data = connector.value_at('uname -a')
|
8
|
+
return true if release_data =~ /sunos.+5\.10/i
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end; end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'boris/profilers/unix/solaris_core'
|
2
|
+
|
3
|
+
module Boris; module Profilers
|
4
|
+
class Solaris11 < SolarisCore
|
5
|
+
|
6
|
+
def self.matches_target?(connector)
|
7
|
+
release_data = connector.value_at('uname -a')
|
8
|
+
return true if release_data =~ /sunos.+5\.11/i
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end; end
|
@@ -1,15 +1,10 @@
|
|
1
|
-
require 'boris/profiler'
|
2
1
|
require 'boris/profilers/unix_core'
|
3
|
-
require 'boris/helpers/constants'
|
2
|
+
#require 'boris/helpers/constants'
|
4
3
|
|
5
4
|
module Boris; module Profilers
|
6
|
-
class
|
5
|
+
class SolarisCore < UNIXCore
|
7
6
|
|
8
7
|
SOLARIS_ZONE_MODEL = 'Oracle Virtual Platform'
|
9
|
-
|
10
|
-
def self.matches_target?(connector)
|
11
|
-
return true if connector.value_at('uname') =~ /sunos/i
|
12
|
-
end
|
13
8
|
|
14
9
|
def get_file_systems; super; end
|
15
10
|
|
@@ -146,7 +141,7 @@ module Boris; module Profilers
|
|
146
141
|
|
147
142
|
## ETHERNET
|
148
143
|
# first, grab the link properties for all connections via the kstat command
|
149
|
-
link_properties = @connector.values_at(%q{/usr/bin/kstat -c net -p | egrep "ifspeed|link_(up|duplex|autoneg)" | nawk '{print $1 "|" $2}'})
|
144
|
+
link_properties = @connector.values_at(%q{/usr/bin/kstat -c net -p | egrep "ifspeed|link_(up|duplex|autoneg)" | nawk '{print $1 "|" $2}' | egrep -v "aggr|lo|dman|sppp"})
|
150
145
|
|
151
146
|
# now create a definitive list of interfaces found on this host. to do this, we pull
|
152
147
|
# the interfaces from the link_properties (kstat cmd) output.
|
@@ -162,7 +157,7 @@ module Boris; module Profilers
|
|
162
157
|
dns_servers = @connector.values_at("cat /etc/resolv.conf | grep ^nameserver | awk '{print $2}'")
|
163
158
|
|
164
159
|
# then get ethernet interface config from ifconfig
|
165
|
-
interface_configs = @connector.values_at(%q{/sbin/ifconfig -a | egrep 'flags|inet|zone' | nawk '{if($2~/^flags/ && $1!~/^(lo|dman|sppp)/) {current_line=$0; getline; {if($1!~/^zone/) {$1=$1; print current_line "\n" $0 "\n"}}}}'}).join("\n").strip.split(/\n\n/)
|
160
|
+
interface_configs = @connector.values_at(%q{/sbin/ifconfig -a | egrep 'flags|inet|zone' | nawk '{if($2~/^flags/ && $1!~/^(aggr|lo|dman|sppp)/) {current_line=$0; getline; {if($1!~/^zone/) {$1=$1; print current_line "\n" $0 "\n"}}}}'}).join("\n").strip.split(/\n\n/)
|
166
161
|
|
167
162
|
# now get the macs of active ethernet connections (for backup in cases where we
|
168
163
|
# can't get macs from prtpicl)
|
@@ -192,7 +187,6 @@ module Boris; module Profilers
|
|
192
187
|
h[:model] = 'Unknown Ethernet Adapter'
|
193
188
|
h[:status] = 'down'
|
194
189
|
h[:type] = 'ethernet'
|
195
|
-
h[:vendor] = 'Unknown'
|
196
190
|
|
197
191
|
# grab the ifconfig output matching this interface
|
198
192
|
matched_ifconfig_data = interface_configs.grep(/#{h[:name]}:/)
|
@@ -217,7 +211,13 @@ module Boris; module Profilers
|
|
217
211
|
h[:model] = 'Virtual Ethernet Adapter'
|
218
212
|
h[:vendor] = VENDOR_ORACLE
|
219
213
|
else
|
220
|
-
|
214
|
+
|
215
|
+
hardware = hardware_details.grep(/driver-name\|.*#{fi[:driver]}/).grep(/instance\|.*#{fi[:instance]}/)[0]
|
216
|
+
|
217
|
+
# if this interface doesn't have any hardware associated with it, we're not interested
|
218
|
+
next if hardware.nil?
|
219
|
+
|
220
|
+
hardware = hardware.split(/\n/)
|
221
221
|
|
222
222
|
h[:vendor_id] = hardware.grep(/vendor-id\|/)[0].after_pipe unless hardware.grep(/vendor-id\|/).empty?
|
223
223
|
h[:model_id] = hardware.grep(/device-id\|/)[0].after_pipe unless hardware.grep(/device-id\|/).empty?
|
@@ -257,7 +257,7 @@ module Boris; module Profilers
|
|
257
257
|
end unless duplex_setting.empty?
|
258
258
|
|
259
259
|
end
|
260
|
-
|
260
|
+
|
261
261
|
@network_interfaces << h
|
262
262
|
end
|
263
263
|
end
|
@@ -282,7 +282,7 @@ module Boris; module Profilers
|
|
282
282
|
h[:type] = 'fibre'
|
283
283
|
|
284
284
|
current_speed = hba.grep(/current speed/i)[0].after_colon
|
285
|
-
speed = current_speed.
|
285
|
+
speed = current_speed.extract(/(\d+)/).to_i
|
286
286
|
h[:current_speed_mbps] = current_speed =~ /gb/i ? speed * 1000 : speed
|
287
287
|
|
288
288
|
@network_interfaces << h
|
@@ -1,16 +1,13 @@
|
|
1
|
-
require 'boris/
|
1
|
+
require 'boris/profiler_core'
|
2
2
|
|
3
3
|
module Boris; module Profilers
|
4
|
-
class
|
4
|
+
class UNIXCore
|
5
|
+
include ProfilerCore
|
5
6
|
|
6
7
|
def self.connection_type
|
7
8
|
Boris::SSHConnector
|
8
9
|
end
|
9
10
|
|
10
|
-
def self.matches_target?(connector)
|
11
|
-
return true if connector.value_at('uname -a') !~ /linux/i
|
12
|
-
end
|
13
|
-
|
14
11
|
def get_file_systems
|
15
12
|
super
|
16
13
|
|
@@ -86,5 +83,25 @@ module Boris; module Profilers
|
|
86
83
|
|
87
84
|
def get_network_interfaces; super; end
|
88
85
|
def get_operating_system; super; end
|
86
|
+
|
87
|
+
def get_running_processes
|
88
|
+
super
|
89
|
+
|
90
|
+
now = DateTime.parse(@connector.value_at('date'))
|
91
|
+
process_data = @connector.values_at('ps -eo time,etime,comm | tail +2 | grep -v defunct')
|
92
|
+
process_data.each do |process|
|
93
|
+
process = process.strip.split
|
94
|
+
|
95
|
+
h = running_process_template
|
96
|
+
|
97
|
+
h[:cpu_time] = process.shift.pad_elapsed_time
|
98
|
+
h[:date_started] = DateTime.parse_start_date(now, process.shift)
|
99
|
+
h[:command] = process.join(' ')
|
100
|
+
|
101
|
+
@running_processes << h
|
102
|
+
end
|
103
|
+
|
104
|
+
@running_processes
|
105
|
+
end
|
89
106
|
end
|
90
107
|
end; end
|
@@ -1,8 +1,7 @@
|
|
1
|
-
require 'boris/profiler'
|
2
1
|
require 'boris/profilers/windows_core'
|
3
2
|
|
4
3
|
module Boris; module Profilers
|
5
|
-
class Windows2003 <
|
4
|
+
class Windows2003 < WindowsCore
|
6
5
|
|
7
6
|
def self.matches_target?(connector)
|
8
7
|
return true if connector.value_at('SELECT Name FROM Win32_OperatingSystem')[:name] =~ /2003/
|
@@ -1,8 +1,7 @@
|
|
1
|
-
require 'boris/profiler'
|
2
1
|
require 'boris/profilers/windows_core'
|
3
2
|
|
4
3
|
module Boris; module Profilers
|
5
|
-
class Windows2008 <
|
4
|
+
class Windows2008 < WindowsCore
|
6
5
|
|
7
6
|
def self.matches_target?(connector)
|
8
7
|
return true if connector.value_at('SELECT Name FROM Win32_OperatingSystem')[:name] =~ /2008/
|
@@ -1,8 +1,7 @@
|
|
1
|
-
require 'boris/profiler'
|
2
1
|
require 'boris/profilers/windows_core'
|
3
2
|
|
4
3
|
module Boris; module Profilers
|
5
|
-
class Windows2012 <
|
4
|
+
class Windows2012 < WindowsCore
|
6
5
|
|
7
6
|
def self.matches_target?(connector)
|
8
7
|
return true if connector.value_at('SELECT Name FROM Win32_OperatingSystem')[:name] =~ /2012/
|
@@ -1,7 +1,8 @@
|
|
1
|
-
require 'boris/
|
1
|
+
require 'boris/profiler_core'
|
2
2
|
|
3
3
|
module Boris; module Profilers
|
4
|
-
class
|
4
|
+
class WindowsCore
|
5
|
+
include ProfilerCore
|
5
6
|
|
6
7
|
APP32_KEYPATH = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
|
7
8
|
APP64_KEYPATH = 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall'
|
@@ -27,10 +28,6 @@ module Boris; module Profilers
|
|
27
28
|
Boris::WMIConnector
|
28
29
|
end
|
29
30
|
|
30
|
-
def self.matches_target?(connector)
|
31
|
-
return true if connector.value_at('SELECT Name FROM Win32_OperatingSystem')[:name] =~ /windows/i
|
32
|
-
end
|
33
|
-
|
34
31
|
def get_file_systems
|
35
32
|
super
|
36
33
|
|
@@ -262,7 +259,8 @@ module Boris; module Profilers
|
|
262
259
|
members = @connector.values_at("SELECT * FROM Win32_GroupUser WHERE GroupComponent = \"Win32_Group.Domain='#{@network_id[:hostname]}',Name='#{group[:name]}'\"")
|
263
260
|
|
264
261
|
members.each do |member|
|
265
|
-
hostname, username = member[:partcomponent].
|
262
|
+
hostname, username = member[:partcomponent].scan(/["|'](.*?)["|']/).flatten
|
263
|
+
|
266
264
|
group[:members] << "#{hostname}\\#{username}"
|
267
265
|
end
|
268
266
|
end
|
@@ -323,9 +321,10 @@ module Boris; module Profilers
|
|
323
321
|
# of this NIC's driver registry key and get the translated value from the list of options
|
324
322
|
# (found in the \Enum subkey)
|
325
323
|
interface_driver_config = @connector.registry_values_at(cfg_keypath)
|
326
|
-
h[:auto_negotiate] = false
|
327
324
|
duplex_reg_value = interface_driver_config.select {|key, val| DUPLEX_REG_VALS.include?(key)}
|
328
325
|
|
326
|
+
h[:auto_negotiate] = false
|
327
|
+
|
329
328
|
if duplex_reg_value.empty?
|
330
329
|
h[:auto_negotiate] = true
|
331
330
|
h[:duplex] = 'auto'
|
@@ -444,6 +443,28 @@ module Boris; module Profilers
|
|
444
443
|
|
445
444
|
@operating_system
|
446
445
|
end
|
446
|
+
|
447
|
+
def get_running_processes
|
448
|
+
super
|
449
|
+
|
450
|
+
process_data = @connector.values_at('SELECT CommandLine, CreationDate, KernelModeTime, UserModeTime FROM Win32_Process')
|
451
|
+
process_data.each do |process|
|
452
|
+
next if process[:commandline].nil?
|
453
|
+
|
454
|
+
h = running_process_template
|
455
|
+
|
456
|
+
cpu_time = Time.at((process[:kernelmodetime].to_i + process[:usermodetime].to_i) / 10000000).utc
|
457
|
+
days = (cpu_time - Time.at(0).utc).to_i / (24 * 60 * 60)
|
458
|
+
|
459
|
+
h[:command] = process[:commandline]
|
460
|
+
h[:cpu_time] = "#{"%02d" % days}-#{cpu_time.strftime('%H:%M:%S')}"
|
461
|
+
h[:date_started] = DateTime.strptime(process[:creationdate], '%Y%m%d%H%M%S.%N%z')
|
462
|
+
|
463
|
+
@running_processes << h
|
464
|
+
end
|
465
|
+
|
466
|
+
@running_processes
|
467
|
+
end
|
447
468
|
|
448
469
|
def get_product_key(app_name, guid=nil)
|
449
470
|
|