开发者

Getting remote performance data using php

I need to find remote data such as RAM usage, swap usage, number of processors, etc, using a php script from the local computer and 10 other remote computers.

How can I go about it?

The remote computers are all running Linux, and they can run any service that is needed of the machine.

What I have in mind is that I can somehow use ssh using the PHP script. Then use top or something to find what I need.

It also needs to be a开发者_如何学C single PHP file that displays all the information.


I think you will probably want to look at PHP Expect, it allows you to do something like connect to a remote host, and provide input/responses to output on the remote.

http://us3.php.net/manual/en/book.expect.php


Have you considered a monitoring suite like Nagios instead of PHP? I think Nagios can give you all this data in a central web-based interface. As far as I know, it has a learning curve that is not entirely trivial, but it may still beat building a PHP solution.


You can use PHP sockets to communicate with servers remotely via SNMP. The remote servers need to have SNMP activated and configured to provide the data you need, such as hardware info, bandwidth, disk space, swap usage, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜