Changeset 18 for measure_scripts


Ignore:
Timestamp:
Oct 22, 2007, 4:58:12 PM (17 years ago)
Author:
george
Message:

Přidáno: Měření pingu na nix.cz

File:
1 edited

Legend:

Unmodified
Added
Removed
  • measure_scripts/traffic.php

    r13 r18  
    2121  }
    2222  restore_error_handler();
     23}
     24
     25function Ping()
     26
     27  //$File = fopen('/a/log/ping_nix.txt', 'r');
     28  //$Row = fgets($File);
     29  //fclose($File);
     30  exec('ping nix.cz -c 1 |grep time=', $Row);
     31  $Parts = explode(' ', $Row);
     32  if(count($Parts) > 6)
     33  {
     34    $Time = $Parts[7];
     35    $TimeParts = explode('=', $Time);
     36    return($TimeParts[1]);
     37  } else return(0);
    2338}
    2439
     
    180195  file_get_contents($URL.'?MeasureId=15&Value='.$Value);
    181196     
     197  // Ping nix.cz
     198  $Value = Ping();
     199  file_get_contents($URL.'?MeasureId=16&Value='.$Value);
     200 
    182201  sleep(60);
    183202}
Note: See TracChangeset for help on using the changeset viewer.