From 852cc43567a812e4289f0cbb1ba23dc5e16eb2ec Mon Sep 17 00:00:00 2001 From: Raf Date: Thu, 10 May 2018 13:19:25 +0200 Subject: [PATCH 1/3] - Option to stack IPv4 and IPv6 together - defaults update --- www/config.inc | 19 ++++++++++--------- www/config_defaults.inc | 4 ++-- www/func.inc | 6 +++++- www/gengraph.php | 21 +++++++++++++++++++-- www/top.php | 19 +++++++++++++++++-- 5 files changed, 53 insertions(+), 16 deletions(-) diff --git a/www/config.inc b/www/config.inc index ecb423d..d0d2ac6 100644 --- a/www/config.inc +++ b/www/config.inc @@ -2,23 +2,23 @@ /* changes these values to suit your local configuration */ -$rrdpath = "/data/as-stats/rrd"; -$daystatsfile = "/data/as-stats/asstats_day.txt"; +$rrdpath = "/var/cache/as-stats/rrd"; +$daystatsfile = "/var/cache/as-stats/asstats_day.sqlite"; $rrdtool = "/usr/bin/rrdtool"; -$daypeerstatsfile = "/data/as-stats/peerasstats_day.txt"; +$daypeerstatsfile = "/var/cache/as-stats/peerasstats_day.txt"; $showpeeras = false; $asinfofile = "asinfo.txt"; -$knownlinksfile = "/data/as-stats/conf/knownlinks"; -$outispositive = true; +$knownlinksfile = "/opt/AS-Stats/conf/knownlinks"; +$outispositive = false; $show95th = true; -$ntop = 20; +$ntop = 100; $showv6 = true; $showtitledetail = true; $vertical_label = true; # vertical IN/OUT label in graph -$brighten_negative = true; # brighten the "negative" part of graphs +$brighten_negative = false; # brighten the "negative" part of graphs $whois = "/usr/bin/whois"; $assetpath = "asset"; @@ -45,12 +45,13 @@ $top_intervals[] = array( 'statsfile' => '/data/as-stats/asstats_week.txt', 'label' => '1 week' ); +*/ $top_intervals[] = array( 'hours' => 30*24, - 'statsfile' => '/data/as-stats/asstats_month.txt', + 'statsfile' => '/var/cache/as-stats/asstats_month.sqlite', 'label' => '30 days' ); -*/ +/**/ /* END - no closing php tag needed here (prevents problems with stray whitespace) */ diff --git a/www/config_defaults.inc b/www/config_defaults.inc index 835faa7..d411b5b 100644 --- a/www/config_defaults.inc +++ b/www/config_defaults.inc @@ -8,11 +8,11 @@ $default_graph_height = 360; /* Size of graphs on top N AS page */ $top_graph_width = 600; -$top_graph_height = 220; +$top_graph_height = 250; /* Size of graphs on AS-Set page */ $asset_graph_width = 600; -$asset_graph_height = 200; +$asset_graph_height = 250; /* Defaults for other settings, introduced in recent versions */ $vertical_label = true; # vertical IN/OUT label in graph diff --git a/www/func.inc b/www/func.inc index 4cbcd93..a11b23c 100644 --- a/www/func.inc +++ b/www/func.inc @@ -238,7 +238,11 @@ function getHTMLImg($as, $ipversion, $desc, $start, $end, $peerusage, $alt, $cla global $top_graph_width; global $top_graph_height; - $dname = rawurlencode("AS$as - $desc - IPV$ipversion"); + $ipvstring = "$ipversion"; + if($ipversion == 0 || $ipversion == 46 || $ipversion == 64) + $ipvstring = "4+IPv6"; + + $dname = rawurlencode("AS$as - $desc - IPv$ipvstring"); $result = "$alt $tag6, + 'color' => $v4link['color'], + 'descr' => $v4link['descr']); + $v6links[] = $link; + } + $knownlinks = array_merge($knownlinks, $v6links); +} + $rrdfile = getRRDFileForAS($as, $peerusage); if ($compat_rrdtool12) { @@ -74,7 +91,7 @@ if($showtitledetail && @$_GET['dname'] != "") $cmd .= "--title " . escapeshellarg($_GET['dname']) . " "; else if (isset($_GET['v']) && is_numeric($_GET['v'])) - $cmd .= "--title IPv" . $_GET['v'] . " "; + $cmd .= "--title IPv" . $versionstring . " "; if (isset($_GET['nolegend'])) $cmd .= "--no-legend "; diff --git a/www/top.php b/www/top.php index 9269495..839078f 100644 --- a/www/top.php +++ b/www/top.php @@ -19,6 +19,12 @@ $hours = 24; if (@$_GET['numhours']) $hours = (int)$_GET['numhours']; +$mixv4v6 = false; +if (isset($_GET['mixv4v6'])) { + $mixv4v6 = $_GET['mixv4v6']; + $showv6 = false; +} + if ($peerusage) $statsfile = $daypeerstatsfile; else { @@ -82,10 +88,14 @@ $class = (($i % 2) == 0) ? "even" : "odd";
IPv4: ~ in / out in the last
- +
IPv6: ~ in / out in the last
+ +
Total: ~ in / + out in the last
+