summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2008-10-24 15:39:29 +0000
committerTed Trask <ttrask01@yahoo.com>2008-10-24 15:39:29 +0000
commit1daf1912dcf944d391978275572d56389d85d482 (patch)
tree64a8c99d4d3febb60a8505b4ca85c4721d32033b
parentff4a1b152aa344dccae0d5dfd7c86b9e5bb77dff (diff)
downloadacf-snort-1daf1912dcf944d391978275572d56389d85d482.tar.bz2
acf-snort-1daf1912dcf944d391978275572d56389d85d482.tar.xz
Modified snort to display message if no alerts.
git-svn-id: svn://svn.alpinelinux.org/acf/snort/trunk@1564 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--snort-details-html.lsp40
1 files changed, 22 insertions, 18 deletions
diff --git a/snort-details-html.lsp b/snort-details-html.lsp
index b95298d..6c4091f 100644
--- a/snort-details-html.lsp
+++ b/snort-details-html.lsp
@@ -11,27 +11,31 @@ io.write("</span>")
<% viewlibrary.dispatch_component("status") %>
-<H1><%= data.label %></H1>
+<H2><%= data.label %></H2>
-<% for i,priority in ipairs(data.value) do %>
- <h2><%= priority.name %></h2>
- <% for cls in pairs(priority.value) do %>
- <h3><%= cls %></h3>
- <% for id,alert in pairs(priority.value[cls]) do %>
- <p><B><%= alert.value[1] %></B><BR>
- <% for j=2, table.maxn(alert.value) do %>
- <%= alert.value[j] %><BR>
- <% end %>
- <I>(This alarm is repeated <B><%= alert.count %></B> times)</I>
- <% if (table.maxn(alert.url) ~= 0) then %>
- ( URL's:
- <% for k,url in ipairs(alert.url) do %>
- <a href="<%= url %>" target="_new"><img src="/skins/static/tango/16x16/categories/applications-internet.png" alt="<%= url %>"></a>
+<%
+if #data.value == 0 then
+ io.write("No alerts found")
+else
+ for i,priority in ipairs(data.value) do %>
+ <h2><%= priority.name %></h2>
+ <% for cls in pairs(priority.value) do %>
+ <h3><%= cls %></h3>
+ <% for id,alert in pairs(priority.value[cls]) do %>
+ <p><B><%= alert.value[1] %></B><BR>
+ <% for j=2, table.maxn(alert.value) do %>
+ <%= alert.value[j] %><BR>
+ <% end %>
+ <I>(This alarm is repeated <B><%= alert.count %></B> times)</I>
+ <% if (table.maxn(alert.url) ~= 0) then %>
+ ( URL's:
+ <% for k,url in ipairs(alert.url) do %>
+ <a href="<%= url %>" target="_new"><img src="/skins/static/tango/16x16/categories/applications-internet.png" alt="<%= url %>"></a>
+ <% end %>
+ )
<% end %>
- )
+ </p>
<% end %>
- </p>
<% end %>
-
<% end %>
<% end %>