<?php

$bytes = disk_free_space(".");
$total = disk_total_space(".");
function getSymbolByQuantity($bytes)
{
    $symbols = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB');
    $exp = floor(log($bytes) / log(1024));
    return sprintf('%.2f ' . $symbols[$exp], $bytes / pow(1024, floor($exp)));
}
echo "Total: " . getSymbolByQuantity($total) . '<hr>';
$si_prefix = array('B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB');
$base = 1024;
$class = min((int) log($bytes, $base), count($si_prefix) - 1);
echo $bytes . '<br />';
echo sprintf('%1.2f', $bytes / pow($base, $class)) . ' ' . $si_prefix[$class] . '<br />';
echo '<hr><br><hr>';
$bytes = disk_free_space("/");
$total = disk_total_space("/");
function getSymbolByQuantity2($bytes)
{
    $symbols = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB');
    $exp = floor(log($bytes) / log(1024));
    return sprintf('%.2f ' . $symbols[$exp], $bytes / pow(1024, floor($exp)));
}
echo "Total: " . getSymbolByQuantity2($total) . '<hr>';
$si_prefix = array('B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB');
$base = 1024;
$class = min((int) log($bytes, $base), count($si_prefix) - 1);
echo $bytes . '<br />';
echo sprintf('%1.2f', $bytes / pow($base, $class)) . ' ' . $si_prefix[$class] . '<br />';
Exemplo n.º 2
0
$dbVersion = "MySQL: " . $dbVersion[0];
$dbStat = preg_replace("/\\s{2,}/", "<br />", POD::stat());
//}
/* Webserver information */
$webServer = "Unknown";
if (function_exists('apache_get_version')) {
    $webServer = apache_get_version();
}
/* OS version */
$osVersion = "Unknown";
if (function_exists('php_uname')) {
    $osVersion = php_uname();
}
/* Disk space */
$totalSpace = getSymbolByQuantity(disk_total_space(dirname(__FILE__)));
$freeSpace = getSymbolByQuantity(disk_free_space(dirname(__FILE__)));
$diskSpace = "{$freeSpace} / {$totalSpace} (Free/Total)";
/* Load average */
$loadAvg = "Unknown";
if (function_exists('sys_getloadavg')) {
    $loadAvg = sys_getloadavg();
    $loadAvg = "Last 1,5,15 min(s): {$loadAvg[0]} / {$loadAvg[1]} / {$loadAvg[2]}";
}
?>
	<div id="part-system-generalinfo" class="part">
		<h2 class="caption"><span class="main-text"><?php 
echo _t('Server 정보');
?>
</span></h2>
		
		<table>
    //$output = shell_exec('chmod -R 777 /var/www/thermolog/');
    //echo "<pre>$output</pre>";
    echo "  <head> <meta http-equiv=\"refresh\" content=\"1;URL='../thermolog.php'\"> </head> <body> <h2>Symlink wird erstellt...</h2></body>";
}
//-------------------------------------------------------------------------------------------------------------------------------------
// Freien Speicherplatz auslesen ######################################################################################################
//-------------------------------------------------------------------------------------------------------------------------------------
function getSymbolByQuantity($bytes)
{
    $symbols = array('B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB');
    $exp = floor(log($bytes) / log(1024));
    return sprintf('%.2f ' . $symbols[$exp], $bytes / pow(1024, floor($exp)));
}
## Anwendung:
$hdGnu = disk_free_space("./thermolog");
$space = getSymbolByQuantity($hdGnu);
//-------------------------------------------------------------------------------------------------------------------------------------
// Auswertung des Löschen Buttons #####################################################################################################
//-------------------------------------------------------------------------------------------------------------------------------------
if (isset($_POST['submit'])) {
    if (isset($_POST) && count($_POST) > 0) {
        // Alle $_POST Variablen in einer schleife Überprüfen
        echo "<ul>";
        foreach ($_POST as $key => $value) {
            $search = "/TEMPLOG/";
            if (true == preg_match($search, $key)) {
                // Nur $_POST Variablen mit der Teilbezeichnung "TEMPLOG" überprüfen
                $csv = $verzeichnis;
                $csv .= "{$key}";
                $csv .= ".csv";
                $png = $verzeichnis_plot;
Exemplo n.º 4
0
            <tr><td>&nbsp;</td><td>&nbsp;</td></tr>

            <tr><td><b>Disk Utilization</b></td><td>&nbsp;</td></tr>
            <tr><td>Root Free Space:</td><td>
<?php 
$diskTotal = disk_total_space("/");
$diskFree = disk_free_space("/");
printf("%s (%2.0f%%)\n", getSymbolByQuantity($diskFree), $diskFree * 100 / $diskTotal);
?>
              </td></tr>
            <tr><td>Media Free Space:</td><td>
<?php 
$diskTotal = disk_total_space($mediaDirectory);
$diskFree = disk_free_space($mediaDirectory);
printf("%s (%2.0f%%)\n", getSymbolByQuantity($diskFree), $diskFree * 100 / $diskTotal);
?>
              </td></tr>

            <tr><td></td><td></td></tr>
          </table>
        </div>
      </div>
    <div class="clear"></div>
    </fieldset>
    <div id='logViewer' title='Log Viewer' style="display: none">
      <pre>
        <div id='logText'>
        </div>
      </pre>
    </div>