Click to See Complete Forum and Search --> : Showing uptime, processes etc on the web


tEd\newbie
02-26-2003, 11:10 AM
I have a personal webserver running apache her beside me, and i want to be able to execute some commands, and show the output on a web page.

For example the uptime, how many eggdrop's are running etc.

I know there are things like phpSys but I want it to be a bit more personal :)

So im guessing the best way to do this would be php ?

Feel free to drop me some snippet's if you got :)

Strike
02-26-2003, 11:19 AM
Originally posted by tEd\newbie
I have a personal webserver running apache her beside me, and i want to be able to execute some commands, and show the output on a web page.

For example the uptime, how many eggdrop's are running etc.

I know there are things like phpSys but I want it to be a bit more personal :)

So im guessing the best way to do this would be php ?

Feel free to drop me some snippet's if you got :)
Any web scripting language will do, PHP and CGI would be easiest, IMO. Figure out how to get the info at the command-line and then use that language's tools to grab output from command-line programs to display it on the web.

iDxMan
02-26-2003, 08:56 PM
PHP would be a fine start, but for some quick execution of uptime/ps/etc you could start out with basic shell scripts then move onto something else.

eg:


#!/bin/sh

set -f

echo Content-type: text/plain
echo

uptime


php:

<?php
system("uptime");
?>


Take a look at the system, exec and passthru functions.

http://www.php.net/manual/en/function.system.php

-r