<h3>Netdisco Statistics</h3>
<UL>
    <LI><% $device_count %> devices with <% $device_port_count %> interfaces
        using <% $device_count + $device_ip_count %> IPs
    <LI><% $device_links %> layer 2 links between devices.
    <LI><% $node_count %> nodes in <% $node_table_count %> entries. 
    <LI><% $ip_count %> IPs in <% $ip_table_count %> entries.
</UL>
<P>
Statistics took <%$time9 - $time1 %> seconds to process.
<!-- 
<% $time2-$time1 %>
<% $time3-$time2 %>
<% $time4-$time3 %>
<% $time5-$time4 %>
<% $time6-$time5 %>
<% $time7-$time6 %>
<% $time8-$time7 %>
<% $time9-$time8 %>
-->
<h3>Glossary</h3>
<UL TYPE=disc>
    <LI><B>Devices</B> - Switch, Router, ...
    <LI><B>Device Interface</B> - Port
    <LI><B>Node</B> - MAC Address.  Something connected to the network.  Server, Printer, ...
    <LI><B>Node Entry</B> - Mapping between a MAC Address and a Switch Port.
        <BR>From MAC Forwarding table in Layer 2 devices.
    <LI><B>IP Entry</B> - Mapping between an IP and a MAC Address.
        <BR>From ARP Cache Entries in Layer 3 devices.
</UL>
<& SELF:about_box &>
<%init>
    $m->flush_buffer();
    my $time1 = time;
    my $device_count = sql_scalar('device',['COUNT(*)']);
    my $time2 = time;
    my $device_port_count = sql_scalar('device_port',['COUNT(*)']);
    my $time3 = time;
    my $device_ip_count = sql_scalar('device_ip',['COUNT(alias)']);
    my $time4 = time;
    my $node_count = sql_scalar('node',['COUNT(DISTINCT(mac))']);
    my $time5 = time;
    my $node_table_count = sql_scalar('node',['COUNT(*)']);
    my $time6 = time;
    my $ip_count = sql_scalar('node_ip',['COUNT(DISTINCT(ip))']);
    my $time7 = time;
    my $ip_table_count = sql_scalar('node_ip',['COUNT(ip)']);
    my $time8 = time;
    my $device_links  = sql_scalar('device_port',['COUNT(*)'],{'remote_ip' => 'is not null'});
    my $time9 = time;
</%init>
<%method about_box>
% my $pg_ver = sql_scalar('device',['version()']);
<h3>About Netdisco</h3>
<TABLE BORDER=0 CLASS="box">
<TR>
    <TD ROWSPAN=6>&nbsp;</TD>
    <TD><B><A HREF="http://netdisco.org">Netdisco</A> Version</B>:</TD>
    <TD><B><%$netdisco::VERSION%></B></TD>
    <TD ROWSPAN=6>&nbsp;</TD>
</TR>
<TR>
    <TD><A HREF="http://www.perl.org">Perl</A> Version:</TD>
    <TD><% join('.',map(ord,split(//,($^V)))) %> (<%$]%>)</TD>
</TR>
<TR>
    <TD VALIGN=TOP><A HREF="http://www.postgresql.org">Postgres</A> Version:</TD>
    <TD><%$pg_ver |h%><BR>
        DBI <%$DBI::VERSION |h%>  DBD::Pg <%$DBD::Pg::VERSION |h%>
    </TD>
</TR>
<TR>
    <TD><A HREF="http://httpd.apache.org">Apache</A> Info:</TD>
    <TD><%$ENV{SERVER_SOFTWARE}%></TD>
</TR>
<TR>
    <TD><A HREF="http://perl.apache.org">mod_perl</A> Version:</TD>
    <TD><%$mod_perl::VERSION%></TD>
</TR>
<TR>
    <TD><A HREF="http://www.masonhq.com">Mason</A>:</TD>
    <TD>
        <A HREF="http://www.masonhq.com"><IMG SRC="<%$path%>/powered_by_mason.jpg" WIDTH=88 HEIGHT=31 BORDER=0 ALT="Powered by Mason"></A>
        Version <%$HTML::Mason::VERSION%></TD>
</TR>
</TABLE>
<%init>
my $path   = $netdisco::CONFIG{webpath};
</%init>
</%method>
<%method title>
- About Netdisco \
</%method>
%# $Id: stats.html,v 1.9 2006/10/25 23:08:15 fenner Exp $
%# vim:syntax=mason
