cvs: pear /Net_Monitor Monitor.php /Net_Monitor/Monitor Alert.php Service.php /Net_Monitor/Monitor/Alert SMS.php SMTP.php
/Net_Monitor/Monitor/Service DNS.php FTP.php HTTP.php HTTPS.php SMTP.php

From: Date: Tue, 29 Mar 2005 00:31:13 +0000
Subject: cvs: pear /Net_Monitor Monitor.php /Net_Monitor/Monitor Alert.php Service.php /Net_Monitor/Monitor/Alert SMS.php SMTP.php
/Net_Monitor/Monitor/Service DNS.php FTP.php HTTP.php HTTPS.php SMTP.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-30748@lists.php.net to get a copy of this message
cyberscribe Mon Mar 28 19:31:13 2005 EDT Modified files: /pear/Net_Monitor Monitor.php /pear/Net_Monitor/Monitor Alert.php Service.php /pear/Net_Monitor/Monitor/Alert SMS.php SMTP.php /pear/Net_Monitor/Monitor/Service DNS.php FTP.php HTTP.php HTTPS.php SMTP.php Log: Fixes a warning message about pass-by-reference at call-time for the Net_SMTP call in the SMTP alert as well as a few other minor bugs.

http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor.php diff -u pear/Net_Monitor/Monitor.php:1.2 pear/Net_Monitor/Monitor.php:1.3 --- pear/Net_Monitor/Monitor.php:1.2 Mon Mar 28 19:28:33 2005 +++ pear/Net_Monitor/Monitor.php Mon Mar 28 19:31:12 2005 @@ -15,7 +15,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: Monitor.php,v 1.2 2005/03/29 00:28:33 cyberscribe Exp $ +// $Id: Monitor.php,v 1.3 2005/03/29 00:31:12 cyberscribe Exp $ // // Remote service monitor /** @@ -62,6 +62,22 @@ /** * Array of options to be used in the current monitoring session * + * Options are: + * <ul> + * <li> state_directory - the directory where the state file gets saved + * <li> state_file - the name of the state file + * <li> subject_line - the subject line of the alert message + * <li> alert_line - the format string for the alert where: + * <ul> + * <li>%h = host + * <li>%s = service + * <li>%m = message + * <li>%c = code + * </ul> + * <li> notify_change - send alerts only on state change + * <li> notify_ok - send an alert when a service returns to a code 200 state + * <li> smtp_debug - send debugging output to STDOUT for the SMTP alert + * * @access private * @var array $_options */ @@ -70,7 +86,8 @@ 'subject_line' => 'Net_Monitor Alert', 'alert_line' => '%h: %s: %m', 'notify_change' => 1, - 'notify_ok' => 1 + 'notify_ok' => 1, + 'smtp_debug' => FALSE ); /** * Array of client objects to be used when testing a service @@ -257,10 +274,6 @@ { $client =& $this->_clients[$service]; - if (!is_object($client)) { //if an client has not yet been created for this service, create one - $this->client[$service] =& $this->getClient($service); - $client =& $this->_clients[$service]; - } return $client->check($server); } /** @@ -283,7 +296,7 @@ $type = $sub_array[$j]; if (!in_array($type,$types_array)) { $types_array[] = $type; - $this->_clients[$type] = $this->getClient($type); + $this->_clients[$type] =& $this->getClient($type); } } } @@ -307,7 +320,7 @@ foreach($sub_array as $alert_type => $method) { if (!in_array($alert_type,$current_alerters)) { $current_alerters[] = $alert_type; - $this->_alerters[$alert_type] = $this->getAlerter($alert_type); + $this->_alerters[$alert_type] =& $this->getAlerter($alert_type); } } } @@ -363,12 +376,8 @@ { $alerter =& $this->_alerters[$method]; - if (!is_object($alerter)) { //if an alerter for this method has not already been created, create one - $this->_alerters[$method] =& $this->getAlerter($method); - $alerter =& $this->_alerters[$method]; - } return $alerter->alert($server,$this->_results_diff,$this->_options); - } + } /** * function saveState * http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Alert.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Alert.php diff -u pear/Net_Monitor/Monitor/Alert.php:1.2 pear/Net_Monitor/Monitor/Alert.php:1.3 --- pear/Net_Monitor/Monitor/Alert.php:1.2 Mon Mar 28 19:28:33 2005 +++ pear/Net_Monitor/Monitor/Alert.php Mon Mar 28 19:31:12 2005 @@ -15,7 +15,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: Alert.php,v 1.2 2005/03/29 00:28:33 cyberscribe Exp $ +// $Id: Alert.php,v 1.3 2005/03/29 00:31:12 cyberscribe Exp $ // // Remote service monitor /** http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Service.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Service.php diff -u pear/Net_Monitor/Monitor/Service.php:1.2 pear/Net_Monitor/Monitor/Service.php:1.3 --- pear/Net_Monitor/Monitor/Service.php:1.2 Mon Mar 28 19:28:33 2005 +++ pear/Net_Monitor/Monitor/Service.php Mon Mar 28 19:31:12 2005 @@ -16,7 +16,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: Service.php,v 1.2 2005/03/29 00:28:33 cyberscribe Exp $ +// $Id: Service.php,v 1.3 2005/03/29 00:31:12 cyberscribe Exp $ // // Remote service monitor /** http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Alert/SMS.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Alert/SMS.php diff -u pear/Net_Monitor/Monitor/Alert/SMS.php:1.2 pear/Net_Monitor/Monitor/Alert/SMS.php:1.3 --- pear/Net_Monitor/Monitor/Alert/SMS.php:1.2 Mon Mar 28 19:28:33 2005 +++ pear/Net_Monitor/Monitor/Alert/SMS.php Mon Mar 28 19:31:12 2005 @@ -16,7 +16,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: SMS.php,v 1.2 2005/03/29 00:28:33 cyberscribe Exp $ +// $Id: SMS.php,v 1.3 2005/03/29 00:31:12 cyberscribe Exp $ // // Remote service monitor /** http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Alert/SMTP.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Alert/SMTP.php diff -u pear/Net_Monitor/Monitor/Alert/SMTP.php:1.2 pear/Net_Monitor/Monitor/Alert/SMTP.php:1.3 --- pear/Net_Monitor/Monitor/Alert/SMTP.php:1.2 Mon Mar 28 19:28:33 2005 +++ pear/Net_Monitor/Monitor/Alert/SMTP.php Mon Mar 28 19:31:12 2005 @@ -16,7 +16,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: SMTP.php,v 1.2 2005/03/29 00:28:33 cyberscribe Exp $ +// $Id: SMTP.php,v 1.3 2005/03/29 00:31:12 cyberscribe Exp $ // // Remote service monitor /** @@ -87,6 +87,7 @@ function alert($server,$result_array,$options=array()) { + $email_message = ''; if ($options['subject_line']) { $subject = $options['subject_line']; } else { @@ -102,7 +103,7 @@ $smtp_client->setDebug(true); } $sizeof_result_array = sizeof($result_array); - for($i=0;$i<$sizeof_result_array;$i++) { + for ($i=0;$i<$sizeof_result_array;$i++) { $result = $result_array[$i]; $host = $result['host']; $service = $result['service']; @@ -119,7 +120,7 @@ $alert_line = str_replace('%c',$code,$alert_line); $email_message .= $alert_line."\r\n"; } - $smtp_client->quotedata(&$email_message); + $smtp_client->quotedata($email_message); $e = $smtp_client->connect(); if (!PEAR::isError($e)) { $e = $smtp_client->mailFrom($server); http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Service/DNS.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Service/DNS.php diff -u pear/Net_Monitor/Monitor/Service/DNS.php:1.2 pear/Net_Monitor/Monitor/Service/DNS.php:1.3 --- pear/Net_Monitor/Monitor/Service/DNS.php:1.2 Mon Mar 28 19:28:34 2005 +++ pear/Net_Monitor/Monitor/Service/DNS.php Mon Mar 28 19:31:13 2005 @@ -15,7 +15,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: DNS.php,v 1.2 2005/03/29 00:28:34 cyberscribe Exp $ +// $Id: DNS.php,v 1.3 2005/03/29 00:31:13 cyberscribe Exp $ // // Remote service monitor /** http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Service/FTP.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Service/FTP.php diff -u pear/Net_Monitor/Monitor/Service/FTP.php:1.2 pear/Net_Monitor/Monitor/Service/FTP.php:1.3 --- pear/Net_Monitor/Monitor/Service/FTP.php:1.2 Mon Mar 28 19:28:34 2005 +++ pear/Net_Monitor/Monitor/Service/FTP.php Mon Mar 28 19:31:13 2005 @@ -15,7 +15,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: FTP.php,v 1.2 2005/03/29 00:28:34 cyberscribe Exp $ +// $Id: FTP.php,v 1.3 2005/03/29 00:31:13 cyberscribe Exp $ // // Remote service monitor /** http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Service/HTTP.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Service/HTTP.php diff -u pear/Net_Monitor/Monitor/Service/HTTP.php:1.2 pear/Net_Monitor/Monitor/Service/HTTP.php:1.3 --- pear/Net_Monitor/Monitor/Service/HTTP.php:1.2 Mon Mar 28 19:28:34 2005 +++ pear/Net_Monitor/Monitor/Service/HTTP.php Mon Mar 28 19:31:13 2005 @@ -15,7 +15,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: HTTP.php,v 1.2 2005/03/29 00:28:34 cyberscribe Exp $ +// $Id: HTTP.php,v 1.3 2005/03/29 00:31:13 cyberscribe Exp $ // // Remote service monitor /** http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Service/HTTPS.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Service/HTTPS.php diff -u pear/Net_Monitor/Monitor/Service/HTTPS.php:1.2 pear/Net_Monitor/Monitor/Service/HTTPS.php:1.3 --- pear/Net_Monitor/Monitor/Service/HTTPS.php:1.2 Mon Mar 28 19:28:34 2005 +++ pear/Net_Monitor/Monitor/Service/HTTPS.php Mon Mar 28 19:31:13 2005 @@ -15,7 +15,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: HTTPS.php,v 1.2 2005/03/29 00:28:34 cyberscribe Exp $ +// $Id: HTTPS.php,v 1.3 2005/03/29 00:31:13 cyberscribe Exp $ // // Remote service monitor /** http://cvs.php.net/diff.php/pear/Net_Monitor/Monitor/Service/SMTP.php?r1=1.2&r2=1.3&ty=u Index: pear/Net_Monitor/Monitor/Service/SMTP.php diff -u pear/Net_Monitor/Monitor/Service/SMTP.php:1.2 pear/Net_Monitor/Monitor/Service/SMTP.php:1.3 --- pear/Net_Monitor/Monitor/Service/SMTP.php:1.2 Mon Mar 28 19:28:34 2005 +++ pear/Net_Monitor/Monitor/Service/SMTP.php Mon Mar 28 19:31:13 2005 @@ -15,7 +15,7 @@ // | Author: Robert Peake <robert@peakepro.com> | // +----------------------------------------------------------------------+ // -// $Id: SMTP.php,v 1.2 2005/03/29 00:28:34 cyberscribe Exp $ +// $Id: SMTP.php,v 1.3 2005/03/29 00:31:13 cyberscribe Exp $ // // Remote service monitor /**
« previous php.pear.cvs (#30748) next »