diff --git a/bin/rrd-extractstats.pl b/bin/rrd-extractstats.pl index f134269..ef9f378 100755 --- a/bin/rrd-extractstats.pl +++ b/bin/rrd-extractstats.pl @@ -51,9 +51,9 @@ foreach my $rrdfile (@rrdfiles) { } print "\n"; -my $query = 'create table stats(asn int'; +my $query = 'create table stats("asn" int'; foreach my $link (@links) { - $query .= ", ${link}_in int, ${link}_out int, ${link}_v6_in int, ${link}_v6_out int"; + $query .= ", \"${link}_in\" int, \"${link}_out\" int, \"${link}_v6_in\" int, \"${link}_v6_out\" int"; } $query .= ');'; diff --git a/www/func.inc b/www/func.inc index a11b23c..d032e28 100644 --- a/www/func.inc +++ b/www/func.inc @@ -112,9 +112,9 @@ function getasstats_top($ntop, $statfile, $selected_links) { $query_total = '0'; $query_links = ''; foreach($selected_links as $tag){ - $query_links .= "${tag}_in, ${tag}_out, ${tag}_v6_in, ${tag}_v6_out, "; + $query_links .= "\"${tag}_in\", \"${tag}_out\", \"${tag}_v6_in\", \"${tag}_v6_out\", "; $nlinks += 4; - $query_total .= " + ${tag}_in + ${tag}_out + ${tag}_v6_in + ${tag}_v6_out"; + $query_total .= " + \"${tag}_in\" + \"${tag}_out\" + \"${tag}_v6_in\" + \"${tag}_v6_out\""; } $query = "select asn, $query_links $query_total as total from stats order by total desc limit $ntop";