Saturday, October 1, 2011

PHP script to show system status

Here is a simple PHP script to show system status:



<html>
<body>
<pre>
Uptime:
<?php system("uptime"); ?>
System Information:
<?php system("uname -a"); ?>
Memory Usage (MB):
<?php system("free -m"); ?>
Disk Usage:
<?php system("df -h"); ?>
CPU Information:
<?php system("cat /proc/cpuinfo | grep \"model name\|processor\""); ?>
Hostname:
<?php system("hostname -s"); ?>
</pre>
</body>
</html>
Save this as status.php or anything you like.Note that the system function should be enabled.

2 comments:

  1. Excellent pieces. Keep posting such kind of information on your blog. I really impressed by your blog.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete