summaryrefslogtreecommitdiffstats
path: root/snort-status-html.lsp
blob: 5dafd62c7413c8ccbee75a4adb564b840a40fe57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
<% local form = ... 
require("viewfunctions")
%>
<%
--[[ DEBUG INFORMATION
io.write("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
io.write(html.cfe_unpack(form))
io.write("</span>")
--]]
%>

<H1>SYSTEM INFO</H1>
<DL>
<% 
local myform = form.status 
local tags = { "status", "version", "autostart", }
displayinfo(myform,tags,"viewonly")
%>
</DL>

<H2>PROGRAM SPECIFIC OPTIONS/INFORMATION</H2>
<DL>
<dt>Counted alerts</dt>
<dd><%= form.alerts %> alert(s)</dd>
</DL>

<h1>ALERT LIST</h1>

<% for i=1, table.maxn(form.alertresult) do %>
	<h2><%= form.alertresult[i]["name"] %></h2>
	<% for j in pairs(form.alertresult[i]["value"]) do %>
		<h3><%= j %></h3>
		<% for k in pairs(form.alertresult[i]["value"][j]) do %>
			<p><B><%= form.alertresult[i]["value"][j][k]["value"][1] %></B><BR>
			<% for l=2, table.maxn(form.alertresult[i]["value"][j][k]["value"]) do %>
				<%= form.alertresult[i]["value"][j][k]["value"][l] %><BR>
			<% end %>
			<I>(This alarm is repeated <B><%= form.alertresult[i]["value"][j][k]["count"] %></B> times)</I>
			<% if (table.maxn(form.alertresult[i]["value"][j][k]["url"]) ~= 0) then %>
				( URL's:
				<% for q=1, table.maxn(form.alertresult[i]["value"][j][k]["url"]) do %>
					<a href="<%= form.alertresult[i]["value"][j][k]["url"][q] %>" target="_new"><img src="/static/tango/16x16/categories/applications-internet.png" alt="<%= form.alertresult[i]["value"][j][k]["url"][q] %>"></a>
				<% end %>
			)
			<% end %>
			</p>
		<% end %>

	<% end %>
<% end %>