|
Search Tech-Forums - link takes you to our Forum's search page. Note: The following is only a text archive! To view the actual forum discussion, please visit our website at http://www.tech-forums.net Pages:1 System info using PHP(Click here to view the original thread with full colors/images)Posted by: TheMajor [color=darkred]I need some php script to display my system info. Like CPU usage, memory usage, average load etc. I am running Apache 1.3.33 with PHP 4.3.9. [b]On Windows XP Pro![/b][/color] Posted by: Sevoma Here you go, Frans [code] <?php ?> <html> <head> <title><?php echo $SERVER_NAME; ?> - Server Information</title> <STYLE type=text/css> BODY { FONT-SIZE: 8pt; COLOR: black; FONT-FAMILY: Verdana,arial, helvetica, serif; margin : 0 0 0 0;} </STYLE> </head> <body> <pre> <center>The Major's Server Info</center> <b>Uptime:</b> <?php system("uptime"); ?> <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> <br> <br> </body> </html> [/code] Posted by: TheMajor [color=darkred]It doesn't display any values. Just for example: Disk usage: <nothing>[/color] Posted by: Sevoma Thats because you use a windows server. Sorry, I cannot help you. :( Posted by: realtechtalk [QUOTE][i]Originally posted by Sevoma [/i] [B]Thats because you use a windows server. Sorry, I cannot help you. :( [/B][/QUOTE] That sounds very likely or it could also be the Apache user does not have privileges to run those commands. Posted by: zsuatt its been written for you ;) check [url]http://phpsysinfo.sourceforge.net/[/url] Posted by: TheMajor [color=darkred]It's only for Linux servers.[/color] Posted by: zsuatt u didnt say u needed it for windows. Anyways some guys got it working for windows too :) [url]http://www.cjsimmons.net/phpsysinfo/[/url] Posted by: TheMajor [color=darkred]I found that too, but I don't have XML support I think. Probably some module for Apache?[/color] Posted by: zsuatt I dont think so, I think what it does is, it uses linux files like /proc/uptime and /proc/cpuinfo to get all the information, so there may be a way to find an equivalent for those in windows, and change the script to adopt to those changes. Its possible, but requires some coding i guess... Posted by: zsuatt hey i found something new for you :D [url]http://aspsysinfo.sourceforge.net/[/url] give it a try and tell me if it works ;) Posted by: TheMajor [color=darkred]I can't figure out if this is for IIS or Apache. Also, I don't have ASP support.[/color] vBulletin Copyright ©2000 - 2003, Jelsoft Enterprises Limited. PPC Management vB Easy Archive Final - Created by Xenon |