Re: Proposal for Network::Monitor
| From: | Justin Patrin | Date: | Tue, 02 Nov 2004 21:42:04 +0000 |
| Subject: | Re: Proposal for Network::Monitor | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-34201@lists.php.net to get a copy of this message | ||
On Tue, 02 Nov 2004 13:34:49 -0800, Robert Peake <robert@peakepro.com> wrote:
> Hi All,
>
> This seems like a potentially useful package to write. Looking forward
> to comments.
>
> Best,
> Robert
>
> @link: http://pear.php.net/pepr/pepr-proposal-show.php?id=171
>
> Purpose
>
> To provide a unified interface for checking the availability services on
> external servers and sending meaningful alerts through a variety of
> media if a service becomes unavailable.
>
> Elements
>
> The service monitoring aspect of this package is essentially a unified
> interface to a number of packages designed to interact with Internet
> services. Initially, this list includes:
>
> * Net_SMTP
> * HTTP_Request
> * Net_DNS
> * Net_FTP
>
> And would also include the Net_Telnet package that is currently being
> proposed.
>
> The alert generation aspect is represented entirely through the use of
> PEAR_Error objects.
>
> The alert sending aspect is currently a unified interface to:
>
> * Net_SMTP
> * Net_SMS
>
> whereby messages can be generated and sent directly from the package.
> This makes this package more robust in the event that the monitored
> servce that goes down is the SMTP relay for the package itself -- the
> package can still generate and send an SMTP message to an external address.
>
> Structure
>
> The package object inputs and stores two arrays -- one representing the
> person(s) to be notified in the event of a failure and the other
> representing the servers to be monitored.
>
> Each person can be assigned a notification type (currently SMTP, SMS, or
> both). Each server can be assigned any number and combination of
> services to be monitored (currently SMTP, HTTP, DNS, and FTP).
>
> Application
>
> The most common application for this package is a simple monitoring
> script that cna be run at a scheduled interval to check remote services
> and send an alert if a service is down.
>
> <?PHP
> require('Net/Monitor.php');
> $monitor = new Net_Monitor();
> $users = array('User1' =>
> array('SMTP'=>'user1@example.com'),
> 'User2' =>
> array('SMTP'=>'user2@example.com');
> $servers = array('foo.example.com'=>array('SMTP','DNS'),
>
> 'bar.example.com'=>array('HTTP','FTP','DNS'));
> $monitor->setUsers($users);
> $monitor->setServers($servers);
> $monitor->checkAll();
> ?>
>
> » Dependencies
>
> * Net_SMTP
> * HTTP_Request
> * Net_DNS
> * Net_FTP
>
> (others to follow)
>
Indeed, this does look very nice. It would also be useful (IMHO) to be
able to monitor non-network services, such as cron. This would, of
course, require running a script or daemon on the machine, but it
would be very useful.
--
paperCrane --Justin Patrin--