vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Limit Database Error Mails (https://vborg.vbsupport.ru/showthread.php?t=97213)

Marco van Herwaarden 09-29-2005 10:00 PM

Limit Database Error Mails
 
Hack: Limit Database Error Mails
Version: v1.00
Author: MarcoH64 for vBulletin.org
vB Version: 3.5.0
File edits: 1 + 1 (config.php)

Disclaimer:
This hack may not be modified or distributed without the explicit permission of the author. The author don't take responsibility for
any problems caused by this modification.

Description:
With this hack installed you can limit the number of emails sent to your technical mail address in case of Database Errors.
You can specify an interval in seconds between sending mails. All errors generated after the first error, until interval is passed,
are not mailed.

Optionally you can specify a different interval for different types of errors.

Operating system files will be used to keep track of the last mail sent. These will be zero byte files, so won't take any space.

Donations?
If you like this work and want to make a donation, your gifts are always welcomed at Paypal: marcoh64@gmail.com

PS No screenshots!! :D

SAngove 09-30-2005 10:05 AM

I will have a look at this, as i get quite frustrated to see my inbox full of db error emails ;)

Thanks in Advance.

reteep 09-30-2005 10:39 AM

Oh YEA, this feature should be a default feature for vBulletin.. thanks!

Marco van Herwaarden 09-30-2005 11:10 AM

Then please click install ;)

Edit: Oops you just did :D

jugo 09-30-2005 02:46 PM

Thanks Marco...this rocks.

Does anyone have a plugin / solution for this: I want to not display the ugly database error when the DB is down on non-vb pages where global.php is included.

Marco van Herwaarden 09-30-2005 02:55 PM

Quote:

Originally Posted by jugo
Thanks Marco...this rocks.

Does anyone have a plugin / solution for this: I want to not display the ugly database error when the DB is down on non-vb pages where global.php is included.

In includes/class_core.php, find:
PHP Code:

   eval('$message = "' str_replace('"''\"'file_get_contents(DIR '/includes/database_error_page.html')) . '";');
   die(
$message); 

And replace by:
PHP Code:

   eval('$message = "' str_replace('"''\"'file_get_contents(DIR '/includes/database_error_page.html')) . '";');
   if (
VB_AREA != 'NonVB')
   {
    die(
$message);
   } 

Then in the top of your non vb page script:
PHP Code:

define('VB_AREA''NonVB'); 

PS This is not tested.

jugo 09-30-2005 06:20 PM

Thanks Marco...that gave me a whole bunch of other ideas.

They should put a hook there.

Marco van Herwaarden 09-30-2005 08:06 PM

Yes i agree, and i don't agree.

This is a crucial part of the code and will get executed in case of database errors.

No Database = No plugins to be executed = Hooks are useless.

Guest190829 10-01-2005 01:08 AM

Go Go Marco, this is really something I need. I'm sick of database error emails on my test board.

/me installs

Marco van Herwaarden 10-01-2005 05:08 AM

Well on your testboard, you can simply remove the tech email from the config.php. You won't get any mails at all.

Guest190829 10-01-2005 05:12 AM

Well actually my test board is open to the public, since my real board is closed untill vbspace is completed. So I just want to limit emails, not completely disable them.

Marco van Herwaarden 10-01-2005 05:30 AM

Ok, well then this hack is just what you need. :D

Please give feedback if there is anything you still need in this.

Guest190829 10-01-2005 05:39 AM

Will do Marco when I fully test this thing out. (Haven't had time today) :)

Marco van Herwaarden 10-06-2005 02:45 PM

And did you already have time to test?

Guest190829 10-06-2005 10:01 PM

Sorry Marco, I've been very busy lately. Will test tonight or tomorrow. :)

adalren 10-16-2005 05:28 AM

Nice hack.

Is it possible for you to modify it with a 2nd interval with an emergency email address?

For example, the regular interval is set at 60 seconds. The pager interval is set at 10 minutes. I want it to email the error to the regular email first and every minute after that. 10 minutes later it would email to my pager and every 10 minutes after that. If I'm getting paged I know my site is down and requires attention.

Marco van Herwaarden 10-20-2005 07:56 PM

Maybe, will try to have a look at it next week.

fuldon 02-18-2006 04:40 AM

Any updates?

Marco van Herwaarden 02-20-2006 10:35 AM

Quote:

Originally Posted by fuldon
Any updates?

Nope, i did started on it once, but was more difficult then i thought. I might have another look once of these days.

Langly 05-19-2006 11:46 AM

Will this work for v3.5.3 with the v3.5.4 patch installed? I get an email everytime someone trys connecting to the site if SQL is down during that time. Its wearing my BlackBerry out ;)

Marco van Herwaarden 05-20-2006 09:00 AM

As far as i am aware of, it should work in all 3.5.x versions.

Cagonni 06-03-2006 03:03 PM

http://img444.imageshack.us/img444/6896/12345nz.jpg

is these same?

vbulletin options / error handling & logging

TosaInu 10-21-2006 05:53 PM

Quote:

Originally Posted by Marco van Herwaarden
Well on your testboard, you can simply remove the tech email from the config.php. You won't get any mails at all.

Will this just stop me to receive e-mails, or will it completely stop e-mails being sent? When the database goes down, the host can receive up to 1,000 e-mails a minute. They are not happy at all with that. I want to completely stop it.

jyajay 10-23-2006 10:02 PM

Is this hack compatible with 3.6.2?

djwins 11-23-2006 11:14 PM

Question...

Quote:

// The directory that will be used to store the files needed for this hack.
// This directory must exist and be readable/writable by your webserver
// No need for a trailing slash (/)
// This can be an absolute path or relative to your forumhome directory
$config['mh_ldbem']['filedirectory'] = './mh_ldbem';
so if a i create a subdirectory in my forums directory called erroremails it would look like this?

$config['mh_ldbem']['filedirectory'] = './forums/erroremails';

dfc005 05-22-2008 04:40 AM

Any chance of getting this working on vB 3.7 and without having any file changes?

blackvborg 06-30-2008 10:51 AM

Hello,
does it work with vb 3.6.9?

Thank you!

Mattikana 07-15-2009 11:21 AM

Hello

Is there any chance to get this updated and working with vB 3.8.x ? Would love to see this working without any file edits.


All times are GMT. The time now is 04:46 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.01128 seconds
  • Memory Usage 1,773KB
  • 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
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete