[- use DBI; -] [- $req = shift; -] [# Lets look for UNIX Metacharacters in the query string from the browser #] [$ if $ENV{'QUERY_STRING'} =~ /([;\*\/'\$!#\(\)\[\]\{\}:'"])/ $] [- Execute ('error.html') -] [- exit -] [$ endif $] [- $LanChoice = $fdat{LanChoice}; -] [- chomp $LanChoice; -] [- $HostChoice = $fdat{HostChoice} -] [- chomp $HostChoice; -] [- $Event = $fdat{Event} -] [- chomp $Event; -] [$ if $Event eq "Inbnd" $] [- $TableName = "InBnd" -] [$ elsif $Event eq "Outbnd" $] [- $TableName = "OutBnd" -] [$ endif $] [$ if $LanChoice eq "" $]

 

[$ else $] [- ($dsn) = "DBI:mysql:FireWatch"; -] [- $dsn .= ";mysql_read_default_file=./sql.epl"; -] [- $dbh = DBI->connect($dsn); -] [- $sth = $dbh -> prepare (" select count(SRC_IP) as Event_Count,Ports.Service_Name,Ports.Port_Num, `${HostChoice}_${TableName}_Week$req->{weeknum}`.Protocol from `${HostChoice}_${TableName}_Week$req->{weeknum}`, Ports where `${HostChoice}_${TableName}_Week$req->{weeknum}`.DST_Port = Ports.Port_Num and `${HostChoice}_${TableName}_Week$req->{weeknum}`.Protocol = Ports.Protocol and Lan = '$LanChoice' and Event like '$Event%' group by `${HostChoice}_${TableName}_Week$req->{weeknum}`.DST_Port;"); -] [- $sth -> execute; -]

Real-Time Event Summary

[+ $LanChoice +] [+ $Event +] on [+ $HostChoice +]

[$ while @row = $sth -> fetchrow_array $] [$ endwhile $]
Event Count Service Name DST. Port Num. Protocol
[+ @row[0] +] [+ @row[1] +] [+ @row[2] +] [+ @row[3] +]
[- $sth = $dbh -> prepare (" select count(SRC_IP) as Event_Count,Ports.Service_Name,Ports.Port_Num, `${HostChoice}_${TableName}_Week$req->{LastWeekNum}`.Protocol from `${HostChoice}_${TableName}_Week$req->{LastWeekNum}`, Ports where `${HostChoice}_${TableName}_Week$req->{LastWeekNum}`.DST_Port = Ports.Port_Num and `${HostChoice}_${TableName}_Week$req->{LastWeekNum}`.Protocol = Ports.Protocol and Lan = '$LanChoice' and Event like '$Event%' group by `${HostChoice}_${TableName}_Week$req->{LastWeekNum}`.DST_Port;"); -] [- $sth -> execute; -]

Last Week's Event Summary

[+ $LanChoice +] [+ $Event +] on [+ $HostChoice +]

[$ while @row = $sth -> fetchrow_array $] [$ endwhile $]
Event Count Service Name DST. Port Num. Protocol.
[+ @row[0] +] [+ @row[1] +] [+ @row[2] +] [+ @row[3] +]
[$ endif $] [- $dbh->disconnect -]