[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/var/www/se3/tests/ -> test_disks.php (source)

   1  <?php
   2  
   3  
   4     /**
   5     
   6     * Page qui teste l occupation des disques.
   7     * @Version $Id: test_disks.php 4764 2009-11-08 17:31:37Z crob $ 
   8     * @Projet LCS / SambaEdu 
   9     * @auteurs Philippe Chadefaux  MrT
  10     * @Licence Distribue selon les termes de la licence GPL
  11     * @note
  12     * Modifications proposées par Sébastien Tack (MrT)
  13     * Optimisation du lancement des scripts bash par la technologie asynchrone Ajax.
  14   
  15     
  16     */
  17  
  18     /**
  19  
  20     * @Repertoire: /tests/
  21     * file: test_disks.php
  22     */
  23  
  24  
  25  
  26  require_once ('entete_ajax.inc.php');
  27  
  28  
  29  // Partition root
  30  
  31  $df_t=disk_total_space("/");
  32  $df_f=disk_free_space("/");
  33  $d1_freespace=$df_f / 1048576;
  34  $d1_totalspace=$df_t / 1048576;
  35  $d1_usedspace=$d1_totalspace - $d1_freespace;
  36  $pourcent=$d1_usedspace / $d1_totalspace;
  37  $pourc = $pourcent*100;
  38  $pourc = round($pourc, 2);
  39  $d1_usedspace = $d1_usedspace / 1024;
  40  $d1_usedspace = round($d1_usedspace,2);
  41  $d1_totalspace = $d1_totalspace / 1024;
  42  $d1_totalspace = round($d1_totalspace,2);
  43  $d1_freespace = $d1_freespace / 1024;
  44  $d1_freespace = round($d1_freespace,2);
  45  $disk1 = $pourc;
  46  
  47  // Partition /var/se3
  48  
  49  $df_t=disk_total_space("/var/se3");
  50  $df_f=disk_free_space("/var/se3");
  51  $d2_freespace=$df_f / 1048576;
  52  $d2_totalspace=$df_t / 1048576;
  53  $d2_usedspace=$d2_totalspace - $d2_freespace;
  54  $pourcent=$d2_usedspace / $d2_totalspace;
  55  $pourc = $pourcent*100;
  56  $pourc = round($pourc, 2);
  57  $d2_usedspace = $d2_usedspace / 1024;
  58  $d2_usedspace = round($d2_usedspace,2);
  59  $d2_totalspace = $d2_totalspace / 1024;
  60  $d2_totalspace = round($d2_totalspace,2);
  61  $d2_freespace = $d2_freespace / 1024;
  62  $d2_freespace = round($d2_freespace,2);
  63  $disk2 = $pourc;
  64  
  65  // Partition /home
  66  $df_t=disk_total_space("/home");
  67  $df_f=disk_free_space("/home");
  68  $d3_freespace=$df_f / 1048576;
  69  $d3_totalspace=$df_t / 1048576;
  70  $d3_usedspace=$d3_totalspace - $d3_freespace;
  71  $pourcent=$d3_usedspace / $d3_totalspace;
  72  $pourc = $pourcent*100;
  73  $pourc = round($pourc, 2);
  74  $d3_usedspace = $d3_usedspace / 1024;
  75  $d3_usedspace = round($d3_usedspace,2);
  76  $d3_totalspace = $d3_totalspace / 1024;
  77  $d3_totalspace = round($d3_totalspace,2);
  78  $d3_freespace = $d3_freespace / 1024;
  79  $d3_freespace = round($d3_freespace,2);
  80  $disk3 = $pourc;
  81  
  82  // Partition /var
  83  $df_t=disk_total_space("/var");
  84  $df_f=disk_free_space("/var");
  85  $d4_freespace=$df_f / 1048576;
  86  $d4_totalspace=$df_t / 1048576;
  87  $d4_usedspace=$d4_totalspace - $d4_freespace;
  88  $pourcent=$d4_usedspace / $d4_totalspace;
  89  $pourc = $pourcent*100;
  90  $pourc = round($pourc, 2);
  91  $d4_usedspace = $d4_usedspace / 1024;
  92  $d4_usedspace = round($d4_usedspace,2);
  93  $d4_totalspace = $d4_totalspace / 1024;
  94  $d4_totalspace = round($d4_totalspace,2);
  95  $d4_freespace = $d4_freespace / 1024;
  96  $d4_freespace = round($d4_freespace,2);
  97  $disk4 = $pourc;
  98  
  99  $flux .= "var arr_space_disks1=new Array('$disk1','$d1_totalspace','$d1_usedspace','$d1_freespace');";
 100  $flux .= "var arr_space_disks2=new Array('$disk2','$d2_totalspace','$d2_usedspace','$d2_freespace');";
 101  $flux .= "var arr_space_disks3=new Array('$disk3','$d3_totalspace','$d3_usedspace','$d3_freespace');";
 102  $flux .= "var arr_space_disks4=new Array('$disk4','$d4_totalspace','$d4_usedspace','$d4_freespace');";
 103  die($flux);
 104  ?>


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1