Location: PHPKode > projects > Ptk-forensics > ptk/lib/get_stat.php
<?
/*
PTK  - DFLabs
Copyright (C) 2008 - DFLabs srl - All rights reserved
hide@address.com
*/
include("check_session.php");
	$out = shell_exec("vmstat");
	$out = split("\n", $out);
	if(preg_match("/(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/", $out[2], $arr)){
		$free = $arr[4];
		$cpu = $arr[14];
	}
	
	$out = shell_exec("df --block-size=M");
	$out = split("\n", $out);
	if(preg_match("/(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/", $out[1], $arr)){
		$disk = $arr[1];
		$disk_free = $arr[4];
		$disk_usage = $arr[5];
	}	
	echo "<b>Free memory:</b> $free Kb | <b>CPU:</b> $cpu%| <b>Free disk:</b> $disk_free | <b>Disk usage:</b> $disk_usage";
?>
Return current item: Ptk-forensics