]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - html/cgi-bin/netinternal.cgi
suricata: Change midstream policy to "pass-flow"
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / netinternal.cgi
CommitLineData
4e481c3a
CS
1#!/usr/bin/perl
2###############################################################################
3# #
4# IPFire.org - A linux based firewall #
0d08de33 5# Copyright (C) 2005-2010 IPFire Team #
4e481c3a
CS
6# #
7# This program is free software: you can redistribute it and/or modify #
8# it under the terms of the GNU General Public License as published by #
9# the Free Software Foundation, either version 3 of the License, or #
10# (at your option) any later version. #
11# #
12# This program is distributed in the hope that it will be useful, #
13# but WITHOUT ANY WARRANTY; without even the implied warranty of #
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15# GNU General Public License for more details. #
16# #
17# You should have received a copy of the GNU General Public License #
18# along with this program. If not, see <http://www.gnu.org/licenses/>. #
19# #
20###############################################################################
21
22use strict;
23
24# enable only the following on debugging purpose
25#use warnings;
26#use CGI::Carp 'fatalsToBrowser';
27
28require '/var/ipfire/general-functions.pl';
29require "${General::swroot}/lang.pl";
30require "${General::swroot}/header.pl";
31require "${General::swroot}/graphs.pl";
32
33my %color = ();
34my %mainsettings = ();
35my %netsettings=();
36&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
37&General::readhash("${General::swroot}/main/settings", \%mainsettings);
8186b372 38&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
4e481c3a
CS
39
40my @graphs=();
41my @wireless=();
42
4190b2a6
LAH
43&Header::showhttpheaders();
44&Header::openpage($Lang::tr{'network traffic graphs internal'}, 1, '');
45&Header::openbigbox('100%', 'left');
4e481c3a 46
4190b2a6
LAH
47push (@graphs, ($netsettings{'GREEN_DEV'}));
48if (&Header::blue_used() && $netsettings{'BLUE_DEV'}) {push (@graphs, ($netsettings{'BLUE_DEV'})); }
49if (&Header::orange_used() && $netsettings{'ORANGE_DEV'}) {push (@graphs, ($netsettings{'ORANGE_DEV'})); }
4e481c3a 50
4190b2a6
LAH
51my @wirelessgraphs = `ls -dA /var/log/rrd/collectd/localhost/wireless* 2>/dev/null`;
52foreach (@wirelessgraphs){
53 $_ =~ /(.*)\/wireless-(.*)/;
54 push(@wireless,$2);
55}
4e481c3a 56
4190b2a6
LAH
57foreach (@graphs) {
58 &Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
59 &Graphs::makegraphbox("netinternal.cgi",$_,"day");
60 &Header::closebox();
61}
4e481c3a 62
4190b2a6
LAH
63foreach (@wireless) {
64 &Header::openbox('100%', 'center', "Wireless $_ $Lang::tr{'graph'}");
65 &Graphs::makegraphbox("netinternal.cgi","wireless".$_,"day");
66 &Header::closebox();
67}
4e481c3a 68
4190b2a6
LAH
69&Header::closebigbox();
70&Header::closepage();