mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 03:07:43 +02:00
vpn-statistics: change graphs and datatypes of rrd
This commit is contained in:
committed by
Alexander Marx
parent
0d0ee70f3b
commit
c9ac8b8052
20
html/cgi-bin/netovpnrw.cgi
Normal file → Executable file
20
html/cgi-bin/netovpnrw.cgi
Normal file → Executable file
@@ -50,17 +50,21 @@ if ( $querry[0] ne "" && $querry[0] ne "UNDEF"){
|
||||
&Header::openpage($Lang::tr{'host to net vpn'}, 1, '');
|
||||
&Header::openbigbox('100%', 'left');
|
||||
|
||||
my @vpngraphs = `find /var/log/rrd/collectd/localhost/openvpn-*/ -not -path *openvpn-UNDEF* -name *.rrd|sort`;
|
||||
my @vpngraphs = `find /var/log/rrd/collectd/localhost/openvpn-*/ -not -path *openvpn-UNDEF* -not -path *openvpn-*n2n* -name *.rrd|sort`;
|
||||
foreach (@vpngraphs){
|
||||
$_ =~ /(.*)\/openvpn-(.*)\/if_octets.rrd/;
|
||||
push(@vpns,$2);
|
||||
if($_ =~ /(.*)\/openvpn-(.*)\/if_octets_derive.rrd/){
|
||||
push(@vpns,$2);
|
||||
}
|
||||
}
|
||||
foreach (@vpns) {
|
||||
&Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
|
||||
&Graphs::makegraphbox("netovpnrw.cgi",$_,"week");
|
||||
&Header::closebox();
|
||||
if(@vpns){
|
||||
foreach (@vpns) {
|
||||
&Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
|
||||
&Graphs::makegraphbox("netovpnrw.cgi",$_,"week");
|
||||
&Header::closebox();
|
||||
}
|
||||
}else{
|
||||
print "<center>".$Lang::tr{'no data'}."</center>";
|
||||
}
|
||||
|
||||
my $output = '';
|
||||
|
||||
&Header::closebigbox();
|
||||
|
||||
@@ -52,15 +52,19 @@ if ( $querry[0] ne ""){
|
||||
|
||||
my @vpngraphs = `find /var/log/rrd/collectd/localhost/openvpn-*-n2n/ -not -path *openvpn-UNDEF* -name *traffic.rrd|sort`;
|
||||
foreach (@vpngraphs){
|
||||
$_ =~ /(.*)\/openvpn-(.*)\/if_octets-traffic.rrd/;
|
||||
push(@vpns,$2);
|
||||
if($_ =~ /(.*)\/openvpn-(.*)\/if_octets_derive-traffic.rrd/){
|
||||
push(@vpns,$2);
|
||||
}
|
||||
}
|
||||
foreach (@vpns) {
|
||||
&Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
|
||||
&Graphs::makegraphbox("netovpnsrv.cgi",$_,"week");
|
||||
&Header::closebox();
|
||||
if (@vpns){
|
||||
foreach (@vpns) {
|
||||
&Header::openbox('100%', 'center', "$_ $Lang::tr{'graph'}");
|
||||
&Graphs::makegraphbox("netovpnsrv.cgi",$_,"week");
|
||||
&Header::closebox();
|
||||
}
|
||||
}else{
|
||||
print "<center>".$Lang::tr{'no data'}."</center>";
|
||||
}
|
||||
|
||||
my $output = '';
|
||||
|
||||
&Header::closebigbox();
|
||||
|
||||
Reference in New Issue
Block a user