#  This software was derived from SATAN 1.1.1 by Dan Farmer and Wietse Venema
#  (http://www.porcupine.org/satan).
#
#
# List hosts that provide a specific service.
#
($_SERVICE, $_sort_order) = split(/,/, $html_script_args);
($_service = $_SERVICE) =~ tr/+!/ \//;

print CLIENT <<EOF;
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
  function movepic(img_name,img_src) {
  document[img_name].src=img_src;
}
</SCRIPT>
<title> Host Table - $_service Servers </title>
<LINK REV="made" HREF="mailto:satan\@fish.com">
<LINK REV="updated" HREF="mailto:sara\@arc.com">
</HEAD>
<BODY>
<TABLE BORDER="0" WIDTH="650">
<TR><TD BGCOLOR="#000000">
<FONT Color="#FFFFFF">
<H2><Center> Host Table - $_service Servers </Center></H2>
</TD><TR></TABLE>
<UL>

<h3> 
$server_severities{$_service} Vulnerable/$server_counts{$_service} total.
Vulnerability counts in parentheses.
</h3>

<H4> Sort hosts by:
<a href="sara_info_servers.pl,$_SERVICE,name,">name</a> |
<a href="sara_info_servers.pl,$_SERVICE,domain,">domain</a> |
<a href="sara_info_servers.pl,$_SERVICE,type,">system type</a> |
<a href="sara_info_servers.pl,$_SERVICE,subnet,">subnet</a> |
<a href="sara_info_servers.pl,$_SERVICE,severity,">problem count</a> |
<a href="sara_info_servers.pl,$_SERVICE,severity_type,">problem type</a>
</H4>
EOF

@_hosts = keys %{$servers{$_service}};
do "$html_root/reporting/sort_hosts.pl";
print CLIENT $@ if $@;

print CLIENT <<EOF;
<hr> <a href="/"> Back to the SARA start page </a> |
<a href=/reporting/analysis.pl> Back to SARA Reporting and Analysis </a>
</UL></UL></TABLE>
</BODY>
</HTML>
EOF
