Skip to content

Commit

Permalink
add 95th percentile image output options to example vnstat.cgi
Browse files Browse the repository at this point in the history
  • Loading branch information
vergoh committed Jan 14, 2024
1 parent 91a77f1 commit c3b60b0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions examples/vnstat.cgi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w

# vnstat.cgi -- example cgi for vnStat image output
# copyright (c) 2008-2023 Teemu Toivola <tst at iki dot fi>
# copyright (c) 2008-2024 Teemu Toivola <tst at iki dot fi>
#
# based on mailgraph.cgi
# copyright (c) 2000-2007 ETH Zurich
Expand Down Expand Up @@ -55,7 +55,7 @@ my $scriptname = '';
################


my $VERSION = "1.17";
my $VERSION = "1.18";
my $cssbody = "body { background-color: $bgcolor; }";
my $csscommonstyle = "a { text-decoration: underline; }\na:link { color: #b0b0b0; }\na:visited { color: #b0b0b0; }\na:hover { color: #000000; }\nsmall { font-size: 8px; color: #cbcbcb; }\nimg { border: 0; vertical-align: top; }\ntable { border: 0; }\ntable td { vertical-align: top; }\nsmall { display: block; }\n";
my $metarefresh = "";
Expand Down Expand Up @@ -364,6 +364,15 @@ sub main
elsif ($query =~ /^(\d+)-y-l$/) {
handle_image($interfaces[$1], "$tmp_dir/vnstat_$1_y_l.png", "-y 0");
}
elsif ($query =~ /^(\d+)-95rx$/) {
handle_image($interfaces[$1], "$tmp_dir/vnstat_$1_95rx.png", "--95 0");
}
elsif ($query =~ /^(\d+)-95tx$/) {
handle_image($interfaces[$1], "$tmp_dir/vnstat_$1_95tx.png", "--95 1");
}
elsif ($query =~ /^(\d+)-95total$/) {
handle_image($interfaces[$1], "$tmp_dir/vnstat_$1_95total.png", "--95 2");
}
elsif ($query =~ /^(\d+)-f$/) {
print_single_interface_html($1);
}
Expand Down

0 comments on commit c3b60b0

Please sign in to comment.