"Last online" stuck on "never" when checking some websites (#770)

Fixes #765

* // PATCH Arkhee : fix/last-online-stuck-on-never-if-webpage-too-large
  // The update un "servers" table does not work
  // Symptom : "Last online" stays stuck on "never"
  // Reason: last_output contains the full webpage, too long for the query
  // _This may depend on mysql configuration on the server_, explaining why some have the problem or not
  // Field is 255 Chars, and request does not work anyway is loaded web page is too large in last_output
  // So force truncate to 250 or less before query

* Spelling

* Update varchar to text

* Update tot 3.4.1

* Update tot 3.4.1

* Update README.rst

* Updated to 5000 characters
This commit is contained in:
Arkhee 2019-09-17 14:53:56 +02:00 committed by TimZ99
parent 34a2303f21
commit dd3bc35009
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
5 changed files with 25 additions and 4 deletions

View File

@ -5,7 +5,7 @@ PHP Server Monitor
:alt: Join the chat at https://gitter.im/erickrf/nlpnet
:target: https://gitter.im/phpservermon/phpservermon
Version 3.4.0 (Updated design!)
Version 3.4.1 (Updated design!)
PHP Server Monitor is a script that checks whether your websites and servers are up and running.

View File

@ -51,7 +51,7 @@ copyright = u'2008-2017, Pepijn Over'
# built documents.
#
# The short X.Y version.
version = '3.4.0'
version = '3.4.1'
# The full version, including alpha/beta/rc tags.
release = version

View File

@ -29,7 +29,7 @@
/**
* Current PSM version
*/
define('PSM_VERSION', '3.4.0');
define('PSM_VERSION', '3.4.1');
/**
* URL to check for updates. Will not be checked if turned off on config page.

View File

@ -573,4 +573,17 @@ class Installer {
$this->execSQL($queries);
$this->log('Combined notifications enabled. Check out the config page for more info.');
}
/**
* Patch for v3.4.1 release
*/
protected function upgrade341() {
$queries = array();
/**
* Redirect_check is first set to default ok.
* If you have a lot of server that are redirecting,
* this will make sure you're servers stay online.
*/
$queries[] = "ALTER TABLE `".PSM_DB_PREFIX."servers` ALTER COLUMN `last_output` text;";
$this->execSQL($queries);
}
}

View File

@ -152,7 +152,15 @@ class StatusUpdater {
}
}
}
// PATCH Arkhee: fix/last-online-stuck-on-never-if-webpage-too-large
// Updating table "servers" does not work
// Symptom: "Last online" stays stuck on "never"
// Reason: last_output contains the full webpage, too long for the query
// This may depend on mysql configuration on the server_, explaining why some have the problem or not
// Field is 255 Chars, and request does not work anyway is loaded web page is too large in last_output
// Solution: updated column to text and truncate to 5000 characters or less before the query
$save["last_output"] = substr($save["last_output"],0,5000);
// End PATCH
$this->db->save(PSM_DB_PREFIX.'servers', $save, array('server_id' => $this->server_id));
return $this->status_new;