File: report.pl

package info (click to toggle)
ntop 3%3A5.0.1%2Bdfsg1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 15,720 kB
  • ctags: 11,480
  • sloc: ansic: 79,804; sh: 21,658; python: 1,948; awk: 1,504; perl: 971; makefile: 745; php: 123; xml: 71; sql: 13; sed: 11
file content (33 lines) | stat: -rw-r--r-- 692 bytes parent folder | download | duplicates (2)
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
#
# The First Basic Report
# Cosimo Streppone <cosimo@cpan.org>
# 2006-03-14
#
# $Id: basic.pl 16 2006-03-27 16:51:09Z cosimo $

#use strict;
#use warnings;
use PDF::ReportWriter;

my $rw = PDF::ReportWriter->new();
my @data = ();


getFirstHost(0);
loadHost();
while(($host{'ethAddress'} ne "") || ($host{'ipAddress'} ne ""))  {
    push(@data, [ $host{'ethAddress'}, $host{'ipAddress'}, $host{'hostResolvedName'}, $host{'bytesSent'}, $host{'bytesRcvd'} ]);
    getNextHost(0);
    loadHost();
}

$rw->render_report('./perl/report/basic.xml', \@data);

# Produces `./basic.pdf', check xml to understand how

# 13 = PDF
send_http_header(13, "");
$rw->save();

sendFile("/tmp/basic.pdf", 0);