Re: Monitoring Remote Server Services using php !!!
| From: | chris smith | Date: | Thu, 25 May 2006 13:35:54 +0000 |
| Subject: | Re: Monitoring Remote Server Services using php !!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236888@lists.php.net to get a copy of this message | ||
On 5/25/06, Phil Martin <darkinner.lists@gmail.com> wrote:
Hi everybody,No such function exists. You should check out http://www.nagios.org - it's not php but it does what you want. -- Postgresql & php tutorials http://www.designmagick.com/I'm new to the list and also new to php, I hope I can learn manythings from here.My first doubt is the following: I'm trying to create a small monitorsystem, just to suit my needs in monitoring some services in my application. I've found some functions that return to me the service by port, name and so on (getservbyport, getservbyname). What I need is to monitor remote server services, I mean, lets suppose I have a server 192.168.0.2 with a ssh server running. I'd like to see the status (up/down) of that server from another machine, like 192.168.0.1. I don't want to use some monitoring softwares out there in the web, i know they exist and in fact I use many of them like nagios, cacti and so on, but I'm planning to do my own small solution.What I need is some function that asks me a remote IP, port andprotocol as input data and results TRUE/FALSE (any boolean value), just to see if the service is up. I did that making a function using nmap, but i don't want to hold that solution to linux, I'd like to use it at other OS.. My function's syntax is like this <?php$ssh_status=service_status (192.168.0.2, 22, tcp); if ($ssh_status==TRUE); { echo "Service UP"; } else { echo "Service DOWN"; }?> Does anyone know if there is a similar function in PHP ? I'd be very happy if somebody knows about a function like that.