issue #59: Warning threshold ignored for notification trigger
							parent
							
								
									1da008b3b4
								
							
						
					
					
						commit
						6655f990b0
					
				
							
								
								
									
										109
									
								
								CHANGELOG.rst
								
								
								
								
							
							
						
						
									
										109
									
								
								CHANGELOG.rst
								
								
								
								
							|  | @ -4,87 +4,88 @@ Changelog | ||||||
| not yet released | not yet released | ||||||
| ---------------- | ---------------- | ||||||
| 
 | 
 | ||||||
|  * #57: Added Chinese translation. | * #57: Added Chinese translation. | ||||||
|  * Sphinx is now used for documentation <http://sphinx.pocoo.org/>. | * #58: Server order on users page now matches the order on servers page. | ||||||
|  * #58: Server order on users page now matches the order on servers page. | * #59: Warning threshold ignored for notification trigger. | ||||||
|  | * Sphinx is now used for documentation <http://sphinx.pocoo.org/>. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| v3.0.0 (released April 6, 2014) | v3.0.0 (released April 6, 2014) | ||||||
| ------------------------------- | ------------------------------- | ||||||
| 
 | 
 | ||||||
|  * New module structure (not backwards compatible). | * New module structure (not backwards compatible). | ||||||
|  * Added user login system with 2 user levels (administrator and regular user). | * Added user login system with 2 user levels (administrator and regular user). | ||||||
|  * Added warning threshold option (set number of failed checks before server goes offline). | * Added warning threshold option (set number of failed checks before server goes offline). | ||||||
|  * Added SMTP support. | * Added SMTP support. | ||||||
|  * Adding Bulgarian language file. | * Adding Bulgarian language file. | ||||||
|  * Added history tracking of server uptime. | * Added history tracking of server uptime. | ||||||
|  * Added history graphs of server uptime and latency. | * Added history graphs of server uptime and latency. | ||||||
|  * Added user profile page. | * Added user profile page. | ||||||
|  * Status page is now default homepage. | * Status page is now default homepage. | ||||||
|  * Updated translations. | * Updated translations. | ||||||
|  * Date and time formats are taken from language file and localized per language. | * Date and time formats are taken from language file and localized per language. | ||||||
|  * When checking a website, the updater will now follow 302 Location headers. | * When checking a website, the updater will now follow 302 Location headers. | ||||||
|  * String/pattern search on websites did not work for websites with compression turned on. | * String/pattern search on websites did not work for websites with compression turned on. | ||||||
|  * The monitor now uses a custom user agent so it can be identified in access logs (Mozilla/5.0 (compatible; phpservermon/version; +http://www.phpservermonitor.org)). | * The monitor now uses a custom user agent so it can be identified in access logs (Mozilla/5.0 (compatible; phpservermon/version; +http://www.phpservermonitor.org)). | ||||||
|  * Improved mobile compatibility. | * Improved mobile compatibility. | ||||||
|  * Template directory restructured to correspond with module structure. | * Template directory restructured to correspond with module structure. | ||||||
|  * Switched from mysql_* to PDO. | * Switched from mysql_* to PDO. | ||||||
|  * Updated PHPMailer package to v5.2.6. | * Updated PHPMailer package to v5.2.6. | ||||||
|  * Fixed several XSS vulnerabilities. | * Fixed several XSS vulnerabilities. | ||||||
|  * Project website updated to <http://www.phpservermonitor.org> | * Project website updated to <http://www.phpservermonitor.org> | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| v2.1.0 (released February 8, 2014) | v2.1.0 (released February 8, 2014) | ||||||
| ---------------------------------- | ---------------------------------- | ||||||
| 
 | 
 | ||||||
|  * PHP 5.3+ required | * PHP 5.3+ required | ||||||
|  * Merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (<https://github.com/madeinnordeste/PHP-Server-Monitor-Plus>). | * Merged PHP Server Monitor Plus project by Luiz Alberto S. Ribeiro (<https://github.com/madeinnordeste/PHP-Server-Monitor-Plus>). | ||||||
|  * New layout | * New layout | ||||||
|  * New install module. | * New install module. | ||||||
|  * Regex search on website has been added. | * Regex search on website has been added. | ||||||
|  * Support for mosms provider. | * Support for mosms provider. | ||||||
|  * Support for Textmarketer provider. | * Support for Textmarketer provider. | ||||||
|  * Language files are now automatically detected, instead of a hardcoded list. | * Language files are now automatically detected, instead of a hardcoded list. | ||||||
|  * Adding Korean language file. | * Adding Korean language file. | ||||||
|  * Adding Portuguese / Brazilian language file. | * Adding Portuguese / Brazilian language file. | ||||||
|  * Large status page. | * Large status page. | ||||||
|  * New config file (see install instructions in README). | * New config file (see install instructions in README). | ||||||
|  * Cronjob will be prevented from running multiple times at the same time (with a 10 mins timeout). | * Cronjob will be prevented from running multiple times at the same time (with a 10 mins timeout). | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| v2.0.1 (released October 29, 2011) | v2.0.1 (released October 29, 2011) | ||||||
| ---------------------------------- | ---------------------------------- | ||||||
| 
 | 
 | ||||||
|  * Adding German language file. | * Adding German language file. | ||||||
|  * Adding French language file. | * Adding French language file. | ||||||
|  * classes/sm/smUpdaterStatus.class.php: the curl option CURLOPT_CUSTOMREQUEST has been changed to CURLOPT_NOBODY. | * classes/sm/smUpdaterStatus.class.php: the curl option CURLOPT_CUSTOMREQUEST has been changed to CURLOPT_NOBODY. | ||||||
|  * Servers page: auto refresh can be configured at the config page. | * Servers page: auto refresh can be configured at the config page. | ||||||
|  * Servers page: if the server is a website, the "Domain/Ip" field will be a link to the website. | * Servers page: if the server is a website, the "Domain/Ip" field will be a link to the website. | ||||||
|  * New text message gateway: Clickatell.com. | * New text message gateway: Clickatell.com. | ||||||
|  * If cURL is not installed, the install.php script will throw an error. | * If cURL is not installed, the install.php script will throw an error. | ||||||
|  * HTTP status codes 5xx will also be treated as error. | * HTTP status codes 5xx will also be treated as error. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| v2.0.0 (released October 19, 2009) | v2.0.0 (released October 19, 2009) | ||||||
| ---------------------------------- | ---------------------------------- | ||||||
| 
 | 
 | ||||||
|  * Server type ("service" or "website"). | * Server type ("service" or "website"). | ||||||
|  * Different types of notification. | * Different types of notification. | ||||||
|  * New text message gateways. | * New text message gateways. | ||||||
|  * Code rewrite. | * Code rewrite. | ||||||
|  * New layout. | * New layout. | ||||||
|  * Check for updates function. | * Check for updates function. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| v1.0.1 (released September 18, 2008) | v1.0.1 (released September 18, 2008) | ||||||
| ------------------------------------ | ------------------------------------ | ||||||
| 
 | 
 | ||||||
|  * log.php | * log.php | ||||||
|  * tpl/log.tpl.html | * tpl/log.tpl.html | ||||||
|  * Select order by clause used datetime field after DATE_FORMAT had been performed, resulting in a wrong list of log entries shown. | * Select order by clause used datetime field after DATE_FORMAT had been performed, resulting in a wrong list of log entries shown. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| v1.0.0 (released July 16, 2008) | v1.0.0 (released July 16, 2008) | ||||||
| ------------------------------- | ------------------------------- | ||||||
| 
 | 
 | ||||||
|  * Initial release | * Initial release | ||||||
|  |  | ||||||
|  | @ -89,7 +89,7 @@ class Autorun { | ||||||
| 			// notify the nerds if applicable
 | 			// notify the nerds if applicable
 | ||||||
| 			$notifier->notify($server['server_id'], $status_old, $status_new); | 			$notifier->notify($server['server_id'], $status_old, $status_new); | ||||||
| 
 | 
 | ||||||
| 			// clean-up time!! archive all records older than 1 month
 | 			// clean-up time!! archive all records older than 1 week
 | ||||||
| 			$archiver->archive($server['server_id'], $cleanup_date); | 			$archiver->archive($server['server_id'], $cleanup_date); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -67,6 +67,8 @@ class StatusUpdater { | ||||||
| 	 * The function its all about. This one checks whether the given ip and port are up and running! | 	 * The function its all about. This one checks whether the given ip and port are up and running! | ||||||
| 	 * If the server check fails it will try one more time, depending on the $max_runs. | 	 * If the server check fails it will try one more time, depending on the $max_runs. | ||||||
| 	 * | 	 * | ||||||
|  | 	 * Please note: if the server is down but has not met the warning threshold, this will return true | ||||||
|  | 	 * to avoid any "we are down" events. | ||||||
| 	 * @param int $server_id | 	 * @param int $server_id | ||||||
| 	 * @param int $max_runs how many times should the script recheck the server if unavailable. default is 2 | 	 * @param int $max_runs how many times should the script recheck the server if unavailable. default is 2 | ||||||
| 	 * @return boolean TRUE if server is up, FALSE otherwise | 	 * @return boolean TRUE if server is up, FALSE otherwise | ||||||
|  | @ -102,6 +104,10 @@ class StatusUpdater { | ||||||
| 			'rtime' => $this->rtime, | 			'rtime' => $this->rtime, | ||||||
| 		); | 		); | ||||||
| 
 | 
 | ||||||
|  | 		// log the uptime before checking the warning threshold,
 | ||||||
|  | 		// so that the warnings can still be reviewed in the server history.
 | ||||||
|  | 		psm_log_uptime($this->server_id, (int) $this->status_new, $this->rtime); | ||||||
|  | 
 | ||||||
| 		if($this->status_new == true) { | 		if($this->status_new == true) { | ||||||
| 			// if the server is on, add the last_online value and reset the error threshold counter
 | 			// if the server is on, add the last_online value and reset the error threshold counter
 | ||||||
| 			$save['status'] = 'on'; | 			$save['status'] = 'on'; | ||||||
|  | @ -115,13 +121,13 @@ class StatusUpdater { | ||||||
| 				// the server is offline but the error threshold has not been met yet.
 | 				// the server is offline but the error threshold has not been met yet.
 | ||||||
| 				// so we are going to leave the status "on" for now while we are in a sort of warning state..
 | 				// so we are going to leave the status "on" for now while we are in a sort of warning state..
 | ||||||
| 				$save['status'] = 'on'; | 				$save['status'] = 'on'; | ||||||
|  | 				$this->status_new = true; | ||||||
| 			} else { | 			} else { | ||||||
| 				$save['status'] = 'off'; | 				$save['status'] = 'off'; | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		$this->db->save(PSM_DB_PREFIX . 'servers', $save, array('server_id' => $this->server_id)); | 		$this->db->save(PSM_DB_PREFIX . 'servers', $save, array('server_id' => $this->server_id)); | ||||||
| 		psm_log_uptime($this->server_id, (int) $this->status_new, $this->rtime); |  | ||||||
| 
 | 
 | ||||||
| 		return $this->status_new; | 		return $this->status_new; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Pepijn Over
						Pepijn Over