I haven't played with vztop before, but it sounds like it's just virtuozzo's version of the "top" command.
That said, "top" (and apparently vztop) are interactive programs. They don't just print data out and end, so trying to capture the output could be tricky or next to impossible. Sometimes PHP has trouble capturing unusual outputs, and a general rule of thumb is that if you pipe the output to a file, like this:
somecommand > output.txt
...then output.txt should contain whatever text PHP should be able to read. (there may be exceptions, but it's usually true)
I know you said that they want that exact command, but vztop/top is really just running the vzps/ps command every few seconds, so the vzps command should be able to dump all the same process data (with the correct parameters). You could probably take that dump and convert it into output that looks like vztop's screen.
If you don't want to do that, then the only other things I can think of are beyond normal PHP. There could be a program out there that hooks into the operating system's graphics level (or at least right above it), and dumps out the current screen view to a file. If such a program exists, you could start the program with PHP, run the program with PHP, wait a second or two and kill the vztop process, then pull in the logged screen view.
Also, depending on how similar vztop is to top, you could also try out this solution:
http://www.directadmin.com
Main Topics
Browse All Topics





by: yauhingPosted on 2009-10-06 at 19:18:51ID: 25511728
Did you check the access right of the user, which start the web server?