OK, you said any input.
First, seems like a real potential for a security disaster. We're talking about giving (a web page?) the ability to open a remote shell.... the sysadmin part of me hears alarm bells dinging....
Next, you're going to have to write quite a script for that. You might wanna do some hard time looking around the net for something like this already written.
The acronym SNMP comes to mind. IIRC, php has extensions so it can speak that protocol.
Lastly, you might do something with some socket programming and telnet; however, most people don't open telnet anymore, so you've gotta do SSH, and that'd be even tricker, I'd think.
Your page will probably be communicating with a script that does the job; it might do it directly, though.
I'm sure it can be done. I can't really tell ya how, though, other than a few vague concept/ideas and, "do your homework and flow charting"...