unknown"; } $cpu_info .= " MHz Processor(s)\n"; //Get the memory info, and grab the cool stuf $meminfo = file("/proc/meminfo"); for ($i = 0; $i < count($meminfo); $i++) { list($item, $data) = split(":", $meminfo[$i], 2); $item = chop($item); $data = chop($data); if ($item == "MemTotal") { $total_mem =$data; } if ($item == "MemFree") { $free_mem = $data; } if ($item == "SwapTotal") { $total_swap = $data; } if ($item == "SwapFree") { $free_swap = $data; } if ($item == "Buffers") { $buffer_mem = $data; } if ($item == "Cached") { $cache_mem = $data; } if ($item == "MemShared") {$shared_mem = $data; } } $used_mem = ( $total_mem - $free_mem ); $used_swap = ( $total_swap - $free_swap ); $percent_free = round( $free_mem / $total_mem * 100 ); $percent_used = round( $used_mem / $total_mem * 100 ); $percent_swap = round( ( $total_swap - $free_swap ) / $total_swap * 100 ); $percent_swap_free = round( $free_swap / $total_swap * 100 ); $percent_buff = round( $buffer_mem / $total_mem * 100 ); $percent_cach = round( $cache_mem / $total_mem * 100 ); $percent_shar = round( $shared_mem / $total_mem * 100 ); //Now it's time to grab the cool stuff from the hard drive //This one is not quite as straight forward..... exec ("df", $x); $count = 1; while ($count < sizeof($x)) { list($drive[$count], $size[$count], $used[$count], $avail[$count], $percent[$count], $mount[$count]) = split(" +", $x[$count]); $percent_part[$count] = str_replace( "%", "", $percent[$count] ); $count++; } ?>
Generated by phpSystem