Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Broken "vnstat info" tab on pfSense 2.2.6 and vnstat 1.12

    Scheduled Pinned Locked Moved Traffic Monitoring
    1 Posts 1 Posters 884 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vizi0n
      last edited by

      Hi everyone,

      I had issues with the "vnstat info" tab that would not display anything but a gray box when I selected an interface.

      Looking into the code of "/usr/local/www/diag_vnstat2.php" I discovered this block of code

      
      if ($_REQUEST['getactivity']) {
              if ($_REQUEST['sorttype']) {
                      $sorttype = escapeshellarg($_REQUEST['sorttype']);
              } else {
                      $sorttype = gettext("-h");
                      $text = shell_exec("/usr/local/bin/vnstat -i {$aaaa} {$sorttype}");
                      echo $text;
              }
              exit;
      }
      
      

      By moving the "$text" and the following echo line outside of the if statement, it worked.

      Like this:

      
      if ($_REQUEST['getactivity']) {
              if ($_REQUEST['sorttype']) {
                      $sorttype = escapeshellarg($_REQUEST['sorttype']);
              } else {
                      $sorttype = gettext("-h");
              }
              $text = shell_exec("/usr/local/bin/vnstat -i {$aaaa} {$sorttype}");
              echo $text;
              exit;
      }
      
      

      I hope this can help someone else with that issue

      1 Reply Last reply Reply Quote 0
      • First post
        Last post
      Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.