Ein Snippet welches euch ein paar aktuelle Daten eueres Servers/Systems anzeigt. So z.B. System Information, CPU Information, Memory Usage, Disk Usage und Uptime:
<pre> <b>Uptime:</b> <?php $foo = exec('cat /proc/uptime'); preg_match("/(.*) (.*)/",$foo, $matches); $sek = round($matches[1]); $n = date_create('now', new DateTimeZone('GMT')); $d = clone $n; $d->modify($sek . ' seconds'); $diff = $n->diff($d); echo $diff->format('%a day(s) %h hour(s) %i minute(s) %s second(s)'); ?> <b>System Information:</b> <?php system("uname -a"); ?> <b>Memory Usage (MB):</b> <?php system("free -m"); ?> <b>Disk Usage:</b> <?php system("df -h"); ?> <b>CPU Information:</b> <?php system("cat /proc/cpuinfo | grep \"model name\\|processor\""); ?> </pre>
Letzte Kommentare