View Full Version : Limit Database Error Mails
Marco van Herwaarden
09-29-2005, 10:00 PM
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
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
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:
eval('$message = "' . str_replace('"', '\"', file_get_contents(DIR . '/includes/database_error_page.html')) . '";');
die($message);
And replace by:
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:
define('VB_AREA', 'NonVB');
PS This is not tested.
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
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
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...
// 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.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.