41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/risu/templates/ms_update_summary.rb', line 41
def render output
output.text Report.classification.upcase, :align => :center
output.text "\n"
output.font_size(22) { output.text Report.title, :align => :center }
output.font_size(18) {
output.text "Microsoft Update Summary", :align => :center
output.text "\n"
output.text "This report was prepared by\n#{Report.author}", :align => :center
}
output.text "\n\n\n"
output.font_size(12)
results = Array.new
= ["Hostname","Operating System", "Windows Update Status"]
= {0 => 108, 1 => 264, 2 => 140}
Item.ms_update.each do |item|
host = Host.find_by_id(item.host_id)
if host == nil
next
end
row = Array.new
row.push(host.name)
row.push(host.os)
if item.plugin_output =~ /'Automatic Updates' are disabled/
row.push("Disabled")
else
row.push("Enabled")
end
results.push(row)
end
output.table([] + results, :header => true, :column_widths => , :row_colors => ['FFFFFF', '336699']) do
row(0).style(:font_style => :bold, :background_color => 'CCCCCC')
cells.borders = [:top, :bottom, :left, :right]
end
end
|