PHP frontend for the vnStatI utility. Easily get up to date graphs of your network traffic using vnStat.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
716 B

7 years ago
  1. <?php
  2. //
  3. // vnstati.php
  4. // vnStatGraphP
  5. //
  6. // Created by Mr. Gecko on 3/28/16.
  7. // Copyright (c) 2016 Mr. Gecko's Media (James Coleman). All rights reserved. http://mrgeckosmedia.com/
  8. //
  9. require("config.php");
  10. //No caching as this is always changing.
  11. header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
  12. header("Pragma: no-cache");
  13. header("Content-type: image/png");
  14. //Prepare extra arguments for executing the command.
  15. $arguments = "";
  16. if ($noHeader) {
  17. $arguments .= " -nh";
  18. }
  19. if ($noEdge) {
  20. $arguments .= " -ne";
  21. }
  22. if ($noLegend) {
  23. $arguments .= " -nl";
  24. }
  25. if ($rateUnit) {
  26. $arguments .= " -ru";
  27. }
  28. passthru($vnStatIBin." -i ".escapeshellarg($iface)." -".$graph.$arguments." -o -");
  29. ?>