Class: Nexpose::Site
- Inherits:
-
Object
- Object
- Nexpose::Site
- Defined in:
- lib/nexpose-functions.rb
Instance Method Summary collapse
-
#load_csv_hostnames(nsc, csvfile) ⇒ Object
Load asset hostnames from a CSV file.
Instance Method Details
#load_csv_hostnames(nsc, csvfile) ⇒ Object
Load asset hostnames from a CSV file.
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/nexpose-functions.rb', line 133 def load_csv_hostnames(nsc, csvfile) puts "Loading site..." @site = Site.load(@nsc, self.id) puts "Building hostname/asset list..." @hostnames = [] CSV.foreach(@csvfile) do |line| @hostnames << HostName.new(line[0]) end puts "Saving site assets..." @site.included_addresses = @hostnames @site.save(@nsc) puts "Done." puts "Site #{self.id} now has #{@hostnames.length} assets." end |