Changeset 66 for client/php/Linux.php


Ignore:
Timestamp:
Jan 2, 2016, 12:17:56 AM (8 years ago)
Author:
chronos
Message:
  • Moved: Measure scripts should be part of client, not statistic web itself.
Location:
client/php
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • client/php/Linux.php

    r63 r66  
    2323}
    2424
    25 function Ping()
     25function Ping($Host = 'nix.cz')
    2626
    27   exec('ping nix.cz -c 1 -W 1|grep time=', $Row);
     27  exec('ping '.$Host.' -c 1 -W 1|grep time=', $Row);
    2828  // W - timeout in seconds
    2929  // c - ping count
     
    124124}
    125125
    126 function DiskUtilization()
     126function DiskUtilization($Device = 'sda')
    127127{
    128128  $Output = array();
    129   exec('iostat -d sda -x -m 2 2', $Output);   // 2 second measure delay
     129  exec('iostat -d '.$Device.' -x -m 2 2', $Output);   // 2 second measure delay
    130130  $Row = $Output[6];
    131131  while(strpos($Row, '  ') !== false) $Row = str_replace('  ', ' ', $Row);
     
    135135}
    136136
    137 function DiskFree()
     137function DiskFree($Path)
    138138{
    139   return(disk_free_space('/'));
     139  return(disk_free_space($Path));
    140140}
    141141
Note: See TracChangeset for help on using the changeset viewer.