Forum


Notice to all users

We are migrating towards a new forum system located at community.teamspeak.com, as such this forum will become read-only on January 29, 2020

Results 1 to 5 of 5
  1. #1
    Join Date
    July 2010
    Location
    Germany
    Posts
    3

    Search a Traffic Display for Website

    Hi,

    I want to show my customers their actuall traffic on our website if they are logged in.
    We have a minimum traffic they have to reach per week so they need to look up their actuall traffic !.

    Someone can help me or know a way to make it easy ?

  2. #2
    Join Date
    May 2010
    Posts
    6,310
    Hello

    With other users we have in dev an Trafic web interface that a several hosters asked us.
    I'll post in this forum the next week.

    And have you try TSviewer of Gametracker ?

  3. #3
    Join Date
    July 2010
    Location
    Germany
    Posts
    3
    Server viewer isnt the problem !

    I need some statistic about the traffic.
    I have a TSadmin for my desktop where i can see the traffic. So there must be a way to get this information and put in php or something else.

  4. #4
    Join Date
    October 2007
    Location
    Romania
    Posts
    35
    Quote Originally Posted by S!mpl3 View Post
    Server viewer isnt the problem !

    I need some statistic about the traffic.
    I have a TSadmin for my desktop where i can see the traffic. So there must be a way to get this information and put in php or something else.
    mrtg can do it, indeed! but you need to write the data retrieval scripts by yourself.

  5. #5
    Join Date
    August 2007
    Location
    Germany
    Posts
    24
    For this you will need the Teamspeak 3 Framework

    PHP Code:
    <?
    //Path to the TeamSpeak3.php in the Teamspeak 3 Framework
    require_once("ts3f/libraries/TeamSpeak3/TeamSpeak3.php");


    try
    {
      /* connect to server and get TeamSpeak3_Node_Host object by URI */
      $ts3_ServerInstance = TeamSpeak3::factory("serverquery://<serverip>:<queryport>/");
      $channelsum = 0;
      $useron = 0;
      $usermax = 0; 
      foreach($ts3_ServerInstance as $ts3_VirtualServer) {

              $channelsum = $channelsum + $ts3_VirtualServer["virtualserver_channelsonline"];
              $useron = $useron + $ts3_VirtualServer["virtualserver_clientsonline"] -1;
              $usermax = $usermax + $ts3_VirtualServer["virtualserver_maxclients"];
    }
        $gtraff = (double)$ts3_ServerInstance["connection_bytes_sent_total"] + (double)$ts3_ServerInstance["connection_bytes_received_total"];

      echo ('<h2>Teamspeak 3</h2>');
      echo ('<br>');
      echo ('<strong>Channelanzahl: </strong>');
      echo ($channelsum);
      echo ('<br>');
      echo ('<strong>User Online: </strong>');
      echo ($useron.'/'.$usermax);
      echo ('<br>');
      echo ('<strong>Gesamttraffic: </strong>');
      echo (@round($gtraff/1024/1024/1024, 2));
      echo (' GB');
      echo ('<br><br>');
      
      /* iterate through host and list virtual servers */
      echo "<table cellspacing='0' cellpadding='0' bordercolor='#ffffff' border='1' align='center' style='font-size: x-small'>\n" .
           "  <tr align='center' bgcolor='#EDF5FA'>\n" .
           "  <td><strong>ID</strong></td>\n" .
           "  <td><strong>UDP-Port</strong></td>\n" .
           "  <td><strong>Name</strong></td>\n" .
           "  <td><strong>Slots</strong></td>\n" .
           "  <td><strong>Laufzeit</strong></td>\n" .
           "  <td><strong>Traffic pro Tag</strong></td>\n" .
           "  <td><strong>Traffic gesamt</strong></td>\n" .
           "</tr>\n";
      $id = '0';
      foreach($ts3_ServerInstance as $ts3_VirtualServer) {
              $uptime = @round($ts3_VirtualServer["virtualserver_uptime"]/60/60/24);
              $traff = ($ts3_VirtualServer["connection_bytes_sent_total"]+$ts3_VirtualServer["connection_bytes_received_total"]);
              $id = ($id+1);
              
    if ($id % 2 == 0){
       echo "<tr align='center' bgcolor='#EDF5FA'>";
    }else{
       echo "<tr align='center'>";
       }
        echo "  <td>" . $id . "</td>\n" .
             "  <td>" . $ts3_VirtualServer["virtualserver_port"] . "</td>\n" .
             "  <td>" . $ts3_VirtualServer["virtualserver_name"] . "</td>\n" .
             "  <td>" . ($ts3_VirtualServer["virtualserver_clientsonline"] -1) ."/". $ts3_VirtualServer["virtualserver_maxclients"] . "</td>\n" .
             "  <td>" . $uptime . " Tag(e)</td>\n" .
             "  <td>" . @round($traff/$uptime/1024/1024, 2) . " MB</td>\n" .
             "  <td>" . @round($traff/1024/1024/1024, 2) . " GB</td>\n" .
             "</tr>\n";
      }
      echo "</table>\n";
    }
    catch(Exception $e)
    {
      echo "Error (ID " . $e->getCode() . ") <b>" . $e->getMessage() . "</b>";
    }

    ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can't display TS on Guildlaunch website
    By Newly in forum General Questions
    Replies: 4
    Last Post: September 19th, 2012, 08:58 AM
  2. [Search] TeamSpeak3 Traffic List
    By irokiller in forum Tools / Web Based
    Replies: 3
    Last Post: January 11th, 2011, 07:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •