View Full Version : Limit Database Error Mails
Marco van Herwaarden
30 Sep 2005, 11:39
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
30 Sep 2005, 12:05
I will have a look at this, as i get quite frustrated to see my inbox full of db error emails ;)
Thanks in Advance.
Oh YEA, this feature should be a default feature for vBulletin.. thanks!
Marco van Herwaarden
30 Sep 2005, 13:10
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
30 Sep 2005, 16:55
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:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
And replace by:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Then in the top of your non vb page script:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
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
30 Sep 2005, 22:06
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.
Danny.VBT
01 Oct 2005, 03:08
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
01 Oct 2005, 07:08
Well on your testboard, you can simply remove the tech email from the config.php. You won't get any mails at all.
Danny.VBT
01 Oct 2005, 07:12
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
01 Oct 2005, 07:30
Ok, well then this hack is just what you need. :D
Please give feedback if there is anything you still need in this.
Danny.VBT
01 Oct 2005, 07:39
Will do Marco when I fully test this thing out. (Haven't had time today) :)
Marco van Herwaarden
06 Oct 2005, 16:45
And did you already have time to test?
Danny.VBT
07 Oct 2005, 00:01
Sorry Marco, I've been very busy lately. Will test tonight or tomorrow. :)
adalren
16 Oct 2005, 07:28
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
20 Oct 2005, 21:56
Maybe, will try to have a look at it next week.
Marco van Herwaarden
20 Feb 2006, 12:35
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.
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
20 May 2006, 11:00
As far as i am aware of, it should work in all 3.5.x versions.
Cagonni
03 Jun 2006, 17:03
http://img444.imageshack.us/img444/6896/12345nz.jpg
is these same?
vbulletin options / error handling & logging
TosaInu
21 Oct 2006, 19:53
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.
Is this hack compatible with 3.6.2?
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';
Any chance of getting this working on vB 3.7 and without having any file changes?
blackvborg
30 Jun 2008, 12:51
Hello,
does it work with vb 3.6.9?
Thank you!
Mattikana
15 Jul 2009, 13:21
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.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.