Page 1 of 1

system() question

Posted: Tue Aug 31, 2004 12:23 pm
by johncal
Hello all,
Thanks in advance for reading.

I am working on a "network status" site
(sort of a graphical version of Big Brother)
and I am having trouble with the system() function.
An example would be

Code: Select all

system("uname -a")
So, the issue is I need this system() function to give me info
about another server, NOT the webserver that this php function
is physically on.

Using something like

Code: Select all

system("free -m")
correctly gives me the
memory info, however this info is for the webserver the code is on.
Again, I need to get info about
another webserver on the same network.

Also, all the boxes on the network are linux.
If I am still being vague, please let me know.

Thanks again for any input!

best regards,

John

Posted: Tue Aug 31, 2004 12:44 pm
by mchaggis
The following function should do you:

string exec ( string command [, array &output [, int &return_var]])
(http://uk.php.net/manual/en/function.exec.php)