Sha256: e602bbc3db92c28d846518e722d68ae2ff2530512e499871adc822842bd5abb7

Contents?: true

Size: 1.09 KB

Versions: 66

Compression:

Stored size: 1.09 KB

Contents

module VmScanItemNteventlog
  def to_xml
    xml = @xml_class.newNode('scan_item')
    xml.add_attributes('guid' => @params['guid'], 'name' => @params['name'], 'item_type' => @params['item_type'])
    d = scan_definition
    xml.root << d[:data] if d[:data]
    xml
  end

  def parse_data(vm, data, &_blk)
    if data.nil?
      d = scan_definition
      if d[:data].nil?
        if vm.rootTrees[0].guestOS == "Windows"
          begin
            st = Time.now
            $log.info "Scanning [Profile-EventLogs] information."
            yield({:msg => 'Scanning Profile-EventLogs'}) if block_given?
            ntevent = Win32EventLog.new(vm.rootTrees[0])
            ntevent.readAllLogs(d['content'])
          rescue MiqException::NtEventLogFormat
            $log.warn $!.to_s
          rescue => err
            $log.error "Win32EventLog: #{err}"
            $log.error err.backtrace.join("\n")
          ensure
            d[:data] = ntevent.xmlDoc
            $log.info "Scanning [Profile-EventLogs] information ran for [#{Time.now - st}] seconds."
          end
        end
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
manageiq-smartstate-0.10.1 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.10.0 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.9.0 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.8.1 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.8.0 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.7.0 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.6.2 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.5.10 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.3.10 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.6.1 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.3.9 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.6.0 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.5.9 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.5.8 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.3.8 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.5.7 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.3.7 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.5.6 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.3.6 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb
manageiq-smartstate-0.5.5 lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb