The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Suppress-o-matic - Stop database error spam Details »» | |||||||||||||||||||||||||||||
Suppress-o-matic - Stop database error spam
Developer Last Online: Nov 2023
What is Suppress-o-matic?
Suppress-o-matic is a change to the way vBulletin handles database error emails. It limits sending the same error email repeatedly to your inbox every time a database error is generated. On a busy site if a table is crashed or mysql itself goes down you could recieve several thousand emails. This causes the email server to bog down, and possibly the server itself if there is enough traffic generating emails. Why do I want Suppress-o-matic? It should be pretty clear, you still get the vital information that your vBulletin forum is offline for whichever reason, without the hassle of having to delete and manage your inbox afterwords. Why do I have to edit the files? If the database is down, there is no way to get to the plugins. Plugins are stored in the vBulletin database. Isn't there a vBulletin Option for this? There is an option to disable some emails, assuming that the settings table can be read. If it cannot then it doesn't work. It even states this on the option itself. Can't I just remove my tech email from the config file? This doesn't keep you up to date. What if a serious error like error 28 (no space left) crops up? This means that your server could potentially have serious issues. Not resolving these problems could cause major issues. Are you considering adding more functionality to Suppress-o-matic? We have plans to add a repair feature at some point in time, with an on/off switch. What is SQlite? SQLite is a tiny database engine that is found in PHP. It is very lite, and requires only that php have the extension. There is no other dedicated server for it. You can find more information here: http://en.wikipedia.org/wiki/SQLite Whats required? PHP5 SQLITE2 or newer (found in most php installations) 1 file edit 1 file to upload Future versions: Repair table feature Project Credits: Zachery - Project Planning, design goals, pestering. Link14716 - Hard work. This works for vBulletin 4.0 as well as 3.7+. vB3 thread located here. Download Now
Supporters / CoAuthors Show Your Support
|
Благодарность от: | ||
Teascu Dorin |
Comments |
#53
|
|||
|
|||
Is this working with 4.2.x ?
|
#54
|
||||
|
||||
Still works fine.
|
#55
|
|||
|
|||
We have SQLite3 installed on php 5.4 and this mod doesn't work. How can we modify this to work with SQLite3?
|
#56
|
||||
|
||||
SQLite3 requires recoding the plugin slightly.
I've done it - easy Kym |
#57
|
||||
|
||||
Do you have the errors or notes regarding it? I don't have a test bed for this right now but if you let me know we can look into fixing it.
|
#58
|
|||
|
|||
Quote:
Below is the modified script for SQLite3. Code:
/**********************************************\
|* DB Error Mail Suppressomatic (squall14716) *|
\**********************************************/
if ($sqlitedb = new SQLite3(DIR.'/sqlite3dberrors.sqlite', 0666, $sqliteerror)) {
// Time between errors. 1800 (30 minutes) by default.
// Modify config.php for easy changing of this. For example:
// $config['dbems']['timebetweenerrors'] = 1800;
//($vbulletin->config['dbems']['timebetweenerrors'] ? $timebetweenerrors = $vbulletin->config['dbems']['timebetweenerrors'] : $timebetweenerrors = 60);
$timebetweenerrors = 60; // seconds
// Database opened and ready. Let's check to see if there are recent errors of this type.
$sqlitequery = $sqlitedb->query("SELECT * FROM dberrors WHERE time > ".(TIMENOW - $timebetweenerrors).
" AND errorcode = '".$this->errno."' ORDER BY time DESC");
$suppresserrormail = false;
while ($sqliteresult = $sqlitequery->fetchArray(SQLITE3_ASSOC)) {
if ($sqliteresult['script'] == $scriptpath) {
if ($sqliteresult['errorcode'] == $this->errno) {
// Script is the same and the errorcode is the same. Let's supress this error e-mail.
$suppresserrormail = true;
}
}
if ($sqliteresult['error'] == $this->error) {
// Error message is the same. Supress this error e-mail.
$suppresserrormail = true;
}
}
if ($suppresserrormail == false) {
$sqlitedb->exec("INSERT INTO dberrors (time, error, errorcode, ipaddress, script) VALUES (".TIMENOW.
", '".SQLite3::escapeString($this->error)."', '".$this->errno."', '$ipaddress', '$scriptpath')");
} else {
$technicalemail = "";
}
// Clean the SQLite table of all irrelevant data.
$sqlitedb->exec("DELETE FROM dberrors WHERE time < ".(TIMENOW - $timebetweenerrors));
}
/**************************************************\
|* End DB Error Mail Suppressomatic (squall14716) *|
\**************************************************/
Using the dumpdberror script given in this thread, we can see that there was a single db error written in the database file, only once. It has not updated after that in subsequent tests. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|