vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Administrative and Maintenance Tools - Suppress-o-matic - Stop database error spam (https://vborg.vbsupport.ru/showthread.php?t=228146)

kerrghann 07-07-2015 02:21 PM

This seems to be exactly what I want. I'll give it a go. Thanks for the mod.

joyboy2001 12-28-2015 07:29 PM

Is this working with 4.2.x ?

Zachery 01-01-2016 03:26 PM

Still works fine.

Islamic Board 07-23-2016 03:15 AM

We have SQLite3 installed on php 5.4 and this mod doesn't work. How can we modify this to work with SQLite3?

AusPhotography 07-26-2016 07:32 AM

SQLite3 requires recoding the plugin slightly.
I've done it - easy

Kym

Zachery 07-26-2016 09:40 AM

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.

Islamic Board 07-27-2016 06:49 PM

Quote:

Originally Posted by Zachery (Post 2573961)
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.

We have modified it slightly to work with SQLite3. There doesn't seem to be any errors thrown by this script at the moment but when we tested it, we still receive multiple db error emails of the same error message, even within 1 second.

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.


All times are GMT. The time now is 01:22 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02142 seconds
  • Memory Usage 1,732KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete