boris 1.0.0.beta.1 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/CHANGELOG.md +11 -0
  2. data/README.md +114 -32
  3. data/Rakefile +19 -0
  4. data/lib/boris.rb +0 -13
  5. data/lib/boris/connectors.rb +25 -7
  6. data/lib/boris/connectors/snmp.rb +24 -4
  7. data/lib/boris/connectors/ssh.rb +32 -6
  8. data/lib/boris/connectors/wmi.rb +109 -54
  9. data/lib/boris/errors.rb +1 -1
  10. data/lib/boris/helpers/array.rb +62 -62
  11. data/lib/boris/helpers/constants.rb +22 -19
  12. data/lib/boris/helpers/hash.rb +7 -7
  13. data/lib/boris/helpers/network.rb +68 -0
  14. data/lib/boris/helpers/scrubber.rb +53 -51
  15. data/lib/boris/helpers/string.rb +148 -26
  16. data/lib/boris/lumberjack.rb +74 -47
  17. data/lib/boris/options.rb +28 -16
  18. data/lib/boris/profiler.rb +19 -0
  19. data/lib/boris/profilers/linux/redhat.rb +74 -0
  20. data/lib/boris/{profiles → profilers}/linux_core.rb +13 -4
  21. data/lib/boris/{profiles → profilers}/unix/solaris.rb +25 -15
  22. data/lib/boris/{profiles → profilers}/unix_core.rb +90 -85
  23. data/lib/boris/profilers/windows/windows2003.rb +11 -0
  24. data/lib/boris/profilers/windows/windows2008.rb +26 -0
  25. data/lib/boris/profilers/windows/windows2012.rb +11 -0
  26. data/lib/boris/{profiles → profilers}/windows_core.rb +36 -14
  27. data/lib/boris/structure.rb +173 -167
  28. data/lib/boris/target.rb +110 -168
  29. data/lib/boris/version.rb +3 -0
  30. metadata +32 -115
  31. data/boris.gemspec +0 -28
  32. data/doc/Array.html +0 -437
  33. data/doc/Boris.html +0 -230
  34. data/doc/Boris/ConnectionAlreadyActive.html +0 -123
  35. data/doc/Boris/ConnectionFailed.html +0 -127
  36. data/doc/Boris/Connector.html +0 -794
  37. data/doc/Boris/InvalidCredentials.html +0 -131
  38. data/doc/Boris/InvalidOption.html +0 -123
  39. data/doc/Boris/InvalidTargetName.html +0 -123
  40. data/doc/Boris/Lumberjack.html +0 -466
  41. data/doc/Boris/MissingCredentials.html +0 -123
  42. data/doc/Boris/NoActiveConnection.html +0 -123
  43. data/doc/Boris/NoProfileDetected.html +0 -123
  44. data/doc/Boris/Options.html +0 -783
  45. data/doc/Boris/Profiles.html +0 -117
  46. data/doc/Boris/Profiles/Linux.html +0 -1151
  47. data/doc/Boris/Profiles/RedHat.html +0 -875
  48. data/doc/Boris/Profiles/Solaris.html +0 -1230
  49. data/doc/Boris/Profiles/Structure.html +0 -2050
  50. data/doc/Boris/Profiles/UNIX.html +0 -893
  51. data/doc/Boris/Profiles/Windows.html +0 -1846
  52. data/doc/Boris/Profiles/Windows/Windows2003.html +0 -304
  53. data/doc/Boris/Profiles/Windows/Windows2008.html +0 -379
  54. data/doc/Boris/Profiles/Windows/Windows2012.html +0 -304
  55. data/doc/Boris/SNMPConnector.html +0 -512
  56. data/doc/Boris/SSHConnector.html +0 -633
  57. data/doc/Boris/Target.html +0 -2002
  58. data/doc/Boris/WMIConnector.html +0 -1134
  59. data/doc/BorisLogger.html +0 -217
  60. data/doc/Hash.html +0 -195
  61. data/doc/String.html +0 -1246
  62. data/doc/_index.html +0 -420
  63. data/doc/class_list.html +0 -53
  64. data/doc/css/common.css +0 -1
  65. data/doc/css/full_list.css +0 -57
  66. data/doc/css/style.css +0 -328
  67. data/doc/file.README.html +0 -183
  68. data/doc/file_list.html +0 -55
  69. data/doc/frames.html +0 -28
  70. data/doc/index.html +0 -183
  71. data/doc/js/app.js +0 -214
  72. data/doc/js/full_list.js +0 -173
  73. data/doc/js/jquery.js +0 -4
  74. data/doc/method_list.html +0 -1468
  75. data/doc/top-level-namespace.html +0 -126
  76. data/lib/boris/profiles/linux/redhat.rb +0 -77
  77. data/lib/boris/profiles/windows/windows2003.rb +0 -15
  78. data/lib/boris/profiles/windows/windows2008.rb +0 -23
  79. data/lib/boris/profiles/windows/windows2012.rb +0 -15
  80. data/test/connector_tests/test_snmp.rb +0 -35
  81. data/test/connector_tests/test_ssh.rb +0 -51
  82. data/test/connector_tests/test_wmi.rb +0 -129
  83. data/test/helper_tests/test_array.rb +0 -25
  84. data/test/helper_tests/test_hash.rb +0 -10
  85. data/test/helper_tests/test_string.rb +0 -136
  86. data/test/profile_tests/test_core_skeleton +0 -107
  87. data/test/profile_tests/test_linux_core.rb +0 -331
  88. data/test/profile_tests/test_redhat.rb +0 -134
  89. data/test/profile_tests/test_solaris.rb +0 -523
  90. data/test/profile_tests/test_unix_core.rb +0 -117
  91. data/test/profile_tests/test_windows.rb +0 -536
  92. data/test/setup_tests.rb +0 -14
  93. data/test/test_all.rb +0 -8
  94. data/test/test_options.rb +0 -44
  95. data/test/test_structure.rb +0 -136
  96. data/test/test_target.rb +0 -146
@@ -1,23 +1,31 @@
1
+ require 'boris/profiler'
2
+
3
+ require 'boris/profilers/linux/redhat'
4
+ require 'boris/profilers/unix/solaris'
5
+ require 'boris/profilers/windows/windows2003'
6
+ require 'boris/profilers/windows/windows2008'
7
+ require 'boris/profilers/windows/windows2012'
8
+
1
9
  module Boris
2
10
  class Options
11
+ include Lumberjack
12
+
3
13
  attr_accessor :options
4
14
 
5
15
  # Creates our options hash where the user can pass in an optional hash to immediately
6
16
  # override the default values.
7
17
  #
8
- # credentials = [{:user=>'joe', :password=>'mypassword', :connection_types=>[:ssh, :wmi]}]
18
+ # credentials = [{:user=>'myuser', :password=>'mypassword', :connection_types=>[:ssh, :wmi]}]
9
19
  # ssh_keys = ['/home/joe/private_key']
10
- # options = Boris::Options.new(:log_level=>:debug, :ssh_options=>{:keys=>ssh_keys}, :credentials=>credentials)
20
+ # options = Boris::Options.new(:log_level=>:debug, :credentials=>credentials, :ssh_options=>{:keys=>ssh_keys})
11
21
  #
12
22
  # @option options [Boolean] :auto_scrub_data should the target's data be scrubbed
13
23
  # after running #retrieve_all?
14
24
  # @option options [Array] :credentials an array of credentials in the format of
15
25
  # +:user+, +:password+, +:connection_types+. Only +:user+ is mandatory.
16
- # @option options [Symbol] :log_level The level of logging. Options are:
17
- # +:debug+, +:info+, +:warn+, +:error+, +:fatal (default)+
18
- # @option options [Array] profiles An array of module names of the profiles we wish
19
- # to have available for use on this target. {Boris::Profiles::RedHat} and
20
- # {Profiles::Solaris} are always the defaults, and Windows profiles are included
26
+ # @option options [Array] profilers An array of module names of the profilers we wish
27
+ # to have available for use on this target. {Boris::Profilers::RedHat} and
28
+ # {Profilers::Solaris} are always the defaults, and Windows profilers are included
21
29
  # as defaults as well if {Boris} is running on a Windows host (where WMI connections
22
30
  # are available)
23
31
  # @option options [Hash] snmp_options A hash of options supported by ruby-snmp.
@@ -25,14 +33,14 @@ module Boris
25
33
  #
26
34
  # @raise ArgumentError when invalid arguments are passed
27
35
  def initialize(options={})
36
+ @logger = Boris.logger
28
37
  @options = {}
29
38
 
30
39
  # set our defaults
31
40
  @options[:auto_scrub_data] ||= true
32
41
  @options[:credentials] ||= []
33
- @options[:log_level] ||= :fatal
34
- @options[:profiles] ||= [Profiles::RedHat, Profiles::Solaris]
35
- @options[:profiles].concat([Profiles::Windows::Windows2003, Profiles::Windows::Windows2008, Profiles::Windows::Windows2012]) if PLATFORM == :win32
42
+ @options[:profilers] ||= [Profilers::RedHat, Profilers::Solaris]
43
+ @options[:profilers].concat([Profilers::Windows2003, Profilers::Windows2008, Profilers::Windows2012]) if PLATFORM == :win32
36
44
  @options[:snmp_options] ||= {}
37
45
  @options[:ssh_options] ||= {}
38
46
 
@@ -46,7 +54,7 @@ module Boris
46
54
  end
47
55
 
48
56
  # Getter method for grabbing a value from the Options.
49
- # puts options[:log_level] #=> :debug
57
+ # puts options[:profilers] #=> [Profilers::RedHat]
50
58
  #
51
59
  # @param key symbol of the key-value pair
52
60
  # @return returns the value of specified key from Options
@@ -55,19 +63,23 @@ module Boris
55
63
  end
56
64
 
57
65
  # Setter method for setting the value in the options hash
58
- # puts options[:log_level] #=> :debug
59
- # options[:log_level] = :info
60
- # puts options[:log_level] #=> :info
66
+ # puts options[:profilers] #=> [Profilers::RedHat]
67
+ # options[:profilers] << Profilers::Solaris
68
+ # puts options[:profilers] #=> [Profilers::RedHat, Profilers::Solaris]
61
69
  # @raise ArgumentError when invalid options are provided
62
70
  def []=(key, val)
63
71
  raise ArgumentError, 'invalid option provided' if !@options.has_key?(key)
64
72
  @options[key] = val
65
73
  end
66
74
 
67
- # Provides a simple mechanism for adding credentials to the credentials array of Options.
75
+ # Provides a simple mechanism for adding credentials to the credentials array of Options. The connection types
76
+ # provided here tell Boris which connection methods this credential should be used for. If no connection types
77
+ # are provided, Boris will try to connect using all available connection types with this credential.
78
+ #
79
+ # @target.options.add_credential({:user=>'myuser', :password=>'mypassword', :connection_types=>[:ssh, :wmi]})
68
80
  #
69
81
  # @param cred [Hash] a credential hash. Values include +:user+, +:password+, and
70
- # +:connection_types+. +:user+ is mandatory, and +:connection_types+ should be an Array.
82
+ # +:connection_types+. +:user+ is mandatory, and +:connection_types+ should be an Array.
71
83
  # @raise ArgumentError when invalid credentials or connection_types are supplied
72
84
  def add_credential(cred)
73
85
  raise ArgumentError, 'invalid credential supplied (must be Hash)' if !cred.kind_of?(Hash)
@@ -0,0 +1,19 @@
1
+ require 'boris/structure'
2
+
3
+ require 'boris/helpers/array'
4
+ require 'boris/helpers/hash'
5
+ require 'boris/helpers/string'
6
+ require 'boris/helpers/scrubber'
7
+
8
+ module Boris; module Profilers
9
+ class Profiler
10
+ include Lumberjack
11
+ include Structure
12
+
13
+ def initialize(connector)
14
+ @host = connector.host
15
+ @logger = Boris.logger
16
+ @connector = connector
17
+ end
18
+ end
19
+ end; end
@@ -0,0 +1,74 @@
1
+ require 'boris/profiler'
2
+ require 'boris/profilers/linux_core'
3
+
4
+ module Boris; module Profilers
5
+ class RedHat < Linux
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
11
+
12
+ def get_file_systems; super; end
13
+ def get_hardware; super; end
14
+ def get_hosted_shares; super; end
15
+
16
+ def get_installed_applications
17
+ super
18
+
19
+ application_data = @connector.values_at('rpm -qa --queryformat "%{NAME}|%{VERSION}|%{VENDOR}|%{ARCH}|%{INSTALLTIME:date}\n" | sort')
20
+
21
+ application_data.each do |application|
22
+ application = application.split('|')
23
+ h = installed_application_template
24
+
25
+ h[:date_installed] = DateTime.parse(application[4])
26
+ h[:install_location] = nil
27
+ h[:name] = application[0]
28
+ h[:vendor] = application[2]
29
+ h[:version] = application[1]
30
+
31
+ @installed_applications << h
32
+ end
33
+
34
+ @installed_applications
35
+ end
36
+
37
+ def get_installed_patches; super; end
38
+
39
+ def get_installed_services
40
+ super
41
+ service_data = @connector.values_at("/sbin/chkconfig --list | awk {'print $1'}")
42
+
43
+ service_data.each do |service|
44
+ h = installed_service_template
45
+ h[:name] = service
46
+
47
+ @installed_services << h
48
+ end
49
+
50
+ @installed_services
51
+ end
52
+
53
+ def get_local_user_groups; super; end
54
+ def get_network_id; super; end
55
+ def get_network_interfaces; super; end
56
+
57
+ def get_operating_system
58
+ super
59
+
60
+ os_install_date = @connector.value_at("rpm -qa basesystem --queryformat '%{INSTALLTIME:date}\n'")
61
+ kernel_version = @connector.value_at('uname -r')
62
+ os_data = @connector.values_at('lsb_release -a | egrep -i "description|release"')
63
+
64
+ @operating_system[:date_installed] = DateTime.parse(os_install_date)
65
+ @operating_system[:kernel] = kernel_version
66
+
67
+ os_base_name = os_data.grep(/^description/i)[0].after_colon
68
+ @operating_system[:name] = os_base_name.split(/ linux /i)[0] + ' Linux'
69
+ @operating_system[:version] = os_base_name.scan(/linux (.*) release/i).join + ' ' + os_data.grep(/^release/i)[0].after_colon
70
+
71
+ @operating_system
72
+ end
73
+ end
74
+ end; end
@@ -1,8 +1,7 @@
1
- require 'boris/structure'
1
+ require 'boris/profiler'
2
2
 
3
- module Boris; module Profiles
4
- module Linux
5
- include Structure
3
+ module Boris; module Profilers
4
+ class Linux < Profiler
6
5
 
7
6
  def self.connection_type
8
7
  Boris::SSHConnector
@@ -27,6 +26,8 @@ module Boris; module Profiles
27
26
 
28
27
  @file_systems << h
29
28
  end
29
+
30
+ @file_systems
30
31
  end
31
32
 
32
33
  def get_hardware
@@ -59,6 +60,8 @@ module Boris; module Profiles
59
60
  else
60
61
  info 'no hardware information available (give me sudo access for dmidecode!)'
61
62
  end
63
+
64
+ @hardware
62
65
  end
63
66
 
64
67
  def get_hosted_shares; super; end
@@ -92,6 +95,8 @@ module Boris; module Profiles
92
95
 
93
96
  @local_user_groups << h
94
97
  end
98
+
99
+ @local_user_groups
95
100
  end
96
101
 
97
102
  def get_network_id
@@ -104,6 +109,8 @@ module Boris; module Profiles
104
109
  domain = nil if domain =~ /\(none\)/i
105
110
 
106
111
  @network_id[:domain] = domain.nil? ? hostname.join('.') : domain
112
+
113
+ @network_id
107
114
  end
108
115
 
109
116
  def get_network_interfaces
@@ -209,6 +216,8 @@ module Boris; module Profiles
209
216
  @network_interfaces << h
210
217
  end
211
218
  end
219
+
220
+ @network_interfaces
212
221
  end
213
222
 
214
223
  def get_operating_system; super; end
@@ -1,14 +1,11 @@
1
- require 'boris/profiles/unix_core'
1
+ require 'boris/profiler'
2
+ require 'boris/profilers/unix_core'
3
+ require 'boris/helpers/constants'
2
4
 
3
- module Boris; module Profiles
4
- module Solaris
5
- include UNIX
5
+ module Boris; module Profilers
6
+ class Solaris < UNIX
6
7
 
7
8
  SOLARIS_ZONE_MODEL = 'Oracle Virtual Platform'
8
-
9
- def self.connection_type
10
- UNIX.connection_type
11
- end
12
9
 
13
10
  def self.matches_target?(connector)
14
11
  return true if connector.value_at('uname') =~ /sunos/i
@@ -55,6 +52,8 @@ module Boris; module Profiles
55
52
  else
56
53
  cpu_data.grep(/vendor_id/i)[0].after_pipe
57
54
  end
55
+
56
+ @hardware
58
57
  end
59
58
 
60
59
  def get_hosted_shares
@@ -68,23 +67,24 @@ module Boris; module Profiles
68
67
  h[:path] = share[1]
69
68
  @hosted_shares << h
70
69
  end
70
+
71
+ @hosted_shares
71
72
  end
72
73
 
73
74
  def get_installed_applications
74
75
  super
75
76
 
76
77
  application_data = @connector.values_at("pkginfo -il -c application | egrep -i '^$|(name|version|basedir|vendor|instdate):'")
77
- application_data.join("\n").split("\n\n").each do |application|
78
-
79
- application = application.split("\n")
78
+ application_data.join("\n").split(/\n\n/).each do |application|
79
+ application = application.split(/\n/)
80
80
  h = installed_application_template
81
81
 
82
- date_installed = application.grep(/instdate:/i)[0].split(/instdate:/i)[1].strip
83
- h[:date_installed] = DateTime.strptime(date_installed, '%b %d %Y %H:%M')
84
82
  h[:name] = application.grep(/name:/i)[0].after_colon
85
83
  h[:version] = application.grep(/version:/i)[0].after_colon
86
84
 
87
- # these sometimes don't show up
85
+ # these items sometimes don't show up
86
+ date_installed = application.grep(/instdate:/i)[0]
87
+ h[:date_installed] = DateTime.strptime(date_installed.split(/instdate:/i)[1].strip, '%b %d %Y %H:%M') if date_installed
88
88
  install_location = application.grep(/basedir:/i)[0]
89
89
  h[:install_location] = install_location.after_colon if install_location
90
90
  vendor = application.grep(/vendor:/i)[0]
@@ -92,6 +92,8 @@ module Boris; module Profiles
92
92
 
93
93
  @installed_applications << h
94
94
  end
95
+
96
+ @installed_applications
95
97
  end
96
98
 
97
99
  def get_installed_patches
@@ -113,6 +115,8 @@ module Boris; module Profiles
113
115
 
114
116
  @installed_patches << h
115
117
  end
118
+
119
+ @installed_patches
116
120
  end
117
121
 
118
122
  def get_installed_services
@@ -125,6 +129,8 @@ module Boris; module Profiles
125
129
 
126
130
  @installed_services << h
127
131
  end
132
+
133
+ @installed_services
128
134
  end
129
135
 
130
136
  def get_local_user_groups; super; end
@@ -186,7 +192,7 @@ module Boris; module Profiles
186
192
  interface_line = ifconfig_data[0].split
187
193
  inet_line = ifconfig_data[1].split
188
194
 
189
- subnet = inet_line[3] ? inet_line[3].hex_to_address : nil
195
+ subnet = inet_line[3] ? inet_line[3].hex_to_ip_address : nil
190
196
 
191
197
  h[:status] = 'up' if interface_line[1] =~ /<up/i
192
198
 
@@ -278,6 +284,8 @@ module Boris; module Profiles
278
284
 
279
285
  @network_interfaces << h
280
286
  end
287
+
288
+ @network_interfaces
281
289
  end
282
290
 
283
291
  def get_operating_system
@@ -290,6 +298,8 @@ module Boris; module Profiles
290
298
  @operating_system[:kernel] = os_data[1]
291
299
  @operating_system[:name] = 'Oracle Solaris'
292
300
  @operating_system[:version] = os_data[0]
301
+
302
+ @operating_system
293
303
  end
294
304
 
295
305
  private
@@ -1,85 +1,90 @@
1
- require 'boris/structure'
2
-
3
- module Boris; module Profiles
4
- module UNIX
5
- include Structure
6
-
7
- def self.connection_type
8
- Boris::SSHConnector
9
- end
10
-
11
- def self.matches_target?(connector)
12
- return true if connector.value_at('uname -a') !~ /linux/i
13
- end
14
-
15
- def get_file_systems
16
- super
17
-
18
- file_system_command = %q{df -kl 2>/dev/null | grep ^/ | nawk '{print $1 "|" $2 / 1024 "|" $3 / 1024 "|" $6}'}
19
- @connector.values_at(file_system_command).each do |file_system|
20
- h = file_system_template
21
- file_system = file_system.split('|')
22
-
23
- h[:capacity_mb] = file_system[1].to_i
24
- h[:file_system] = file_system[0]
25
- h[:mount_point] = file_system[3]
26
- h[:used_space_mb] = file_system[2].to_i
27
-
28
- @file_systems << h
29
- end
30
- end
31
-
32
- def get_hardware; super; end
33
- def get_hosted_shares; super; end
34
- def get_installed_applications; super; end
35
- def get_installed_patches; super; end
36
- def get_installed_services; super; end
37
-
38
- def get_local_user_groups
39
- super
40
-
41
- user_data = @connector.values_at('cat /etc/passwd | grep -v "^#"')
42
- group_data = @connector.values_at('cat /etc/group | grep -v "^#"')
43
-
44
- users = []
45
- groups = []
46
-
47
- user_data.each do |x|
48
- h = {}
49
- x = x.split(':')
50
- h[:status] = nil
51
- h[:primary_group_id] = x[3]
52
- h[:username] = x[0]
53
- users << h
54
- end
55
-
56
- group_data.each do |group|
57
- group = group.split(':')
58
- h = {:members=>[], :name=>group[0]}
59
-
60
- h[:members] = users.select{|user| (user[:primary_group_id] == group[2])}.collect{|user| user[:username]}
61
-
62
- @local_user_groups << h
63
- end
64
- end
65
-
66
- def get_network_id
67
- super
68
-
69
- hostname = @connector.value_at('hostname')
70
- domain = @connector.value_at('domainname')
71
- domain = nil if domain =~ /\(none\)/i
72
-
73
- if hostname =~ /\./
74
- hostname = hostname.split('.').shift
75
- domain = hostname.join('.') if hostname =~ /\./
76
- end
77
-
78
- @network_id[:hostname] = hostname
79
- @network_id[:domain] = domain
80
- end
81
-
82
- def get_network_interfaces; super; end
83
- def get_operating_system; super; end
84
- end
85
- end; end
1
+ require 'boris/profiler'
2
+
3
+ module Boris; module Profilers
4
+ class UNIX < Profiler
5
+
6
+ def self.connection_type
7
+ Boris::SSHConnector
8
+ end
9
+
10
+ def self.matches_target?(connector)
11
+ return true if connector.value_at('uname -a') !~ /linux/i
12
+ end
13
+
14
+ def get_file_systems
15
+ super
16
+
17
+ file_system_command = %q{df -kl 2>/dev/null | grep ^/ | nawk '{print $1 "|" $2 / 1024 "|" $3 / 1024 "|" $6}'}
18
+ @connector.values_at(file_system_command).each do |file_system|
19
+ h = file_system_template
20
+ file_system = file_system.split('|')
21
+
22
+ h[:capacity_mb] = file_system[1].to_i
23
+ h[:file_system] = file_system[0]
24
+ h[:mount_point] = file_system[3]
25
+ h[:used_space_mb] = file_system[2].to_i
26
+
27
+ @file_systems << h
28
+ end
29
+
30
+ @file_systems
31
+ end
32
+
33
+ def get_hardware; super; end
34
+ def get_hosted_shares; super; end
35
+ def get_installed_applications; super; end
36
+ def get_installed_patches; super; end
37
+ def get_installed_services; super; end
38
+
39
+ def get_local_user_groups
40
+ super
41
+
42
+ user_data = @connector.values_at('cat /etc/passwd | grep -v "^#"')
43
+ group_data = @connector.values_at('cat /etc/group | grep -v "^#"')
44
+
45
+ users = []
46
+ groups = []
47
+
48
+ user_data.each do |x|
49
+ h = {}
50
+ x = x.split(':')
51
+ h[:status] = nil
52
+ h[:primary_group_id] = x[3]
53
+ h[:username] = x[0]
54
+ users << h
55
+ end
56
+
57
+ group_data.each do |group|
58
+ group = group.split(':')
59
+ h = {:members=>[], :name=>group[0]}
60
+
61
+ h[:members] = users.select{|user| (user[:primary_group_id] == group[2])}.collect{|user| user[:username]}
62
+
63
+ @local_user_groups << h
64
+ end
65
+
66
+ @local_user_groups
67
+ end
68
+
69
+ def get_network_id
70
+ super
71
+
72
+ hostname = @connector.value_at('hostname')
73
+ domain = @connector.value_at('domainname')
74
+ domain = nil if domain =~ /\(none\)/i
75
+
76
+ if hostname =~ /\./
77
+ hostname = hostname.split('.').shift
78
+ domain = hostname.join('.') if hostname =~ /\./
79
+ end
80
+
81
+ @network_id[:hostname] = hostname
82
+ @network_id[:domain] = domain
83
+
84
+ @network_id
85
+ end
86
+
87
+ def get_network_interfaces; super; end
88
+ def get_operating_system; super; end
89
+ end
90
+ end; end