Module: Risu::Templates::HostTemplateHelper

Included in:
TemplateHelper
Defined in:
lib/risu/base/host_template_helper.rb

Instance Method Summary collapse

Instance Method Details

#unsupported_os(title, plugin_name) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/risu/base/host_template_helper.rb', line 26

def unsupported_os title, plugin_name
	if item_count_by_plugin_name(plugin_name) <= 0
		return
	end

	heading2 title

	headers = ["Host"]
	data = Array.new

	findings =  Item.where(:plugin_id => Plugin.where(:plugin_name => plugin_name).first.id)

	findings.each do |finding|
		host = Host.find_by_id(finding.host_id)

		host_string = "#{host.name}"
		host_string << " (#{host.fqdn})" if host.fqdn != nil

		row = Array.new
		row.push host_string

		data << row
	end

	@output.table([headers] + data, :header => true, :width => output.bounds.width) do
		row(0).style(:font_style => :bold, :background_color => 'cccccc')
		cells.borders = [:top, :bottom, :left, :right]
	end

	text "\n"

end

#unsupported_os_appendix_sectionObject



60
61
62
63
64
65
66
67
68
# File 'lib/risu/base/host_template_helper.rb', line 60

def unsupported_os_appendix_section
	unsupported_os("Unsupported Windows NT Installations", "Microsoft Windows NT 4.0 Unsupported Installation Detection")
	unsupported_os("Unsupported Windows 2000 Installations", "Microsoft Windows 2000 Unsupported Installation Detection")
	unsupported_os("Unsupported Windows XP Installations", "Microsoft Windows XP Unsupported Installation Detection")
	unsupported_os("Unsupported Windows 2003 Installations", "Microsoft Windows Server 2003 Unsupported Installation Detection")
	unsupported_os("Unsupported Windows 8 Installations", "Microsoft Windows 8 Unsupported Installation Detection")

	text "\n"
end