10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/metadata/ScanProfile/modules/VmScanItemNteventlog.rb', line 10
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
|