PDA

View Full Version : mySQL Error e-mails


chilliboy
Thu 2nd Aug '01, 5:43am
When you are having problems with mySQL it would be useful to just recieve 1 e-mail for each Unique Error. If you've got a busy forums and it goes down its a complete pain getting swamped by hundreds of the same error e-mails. Sending e-mails to an internet account to stop being swamped is not really an option as you don't get to find out about errors unless you regularly check the account.

Maybe you could use flat files for this (as if mySQL is down its pointless to consider mySQL) - the error message is checked for similarities against an error cache file along with file 'modified' time - if the error is similar is the same as one generated in the last hour a message is not sent - else one is sent. You could also write a simple counter which could advise "this error was generated xx times from time 1 to time 2".

I believe this would be possible to script (and probably not to difficult) - and I use flat files in a similar way to this for my own error reporting.

If something like this could be implemented I think it would be thoroughly welcome.

chilliboy
Fri 3rd Aug '01, 10:30am
Does no one have an opinion on this - good idea , bad idea ??

Martz
Fri 3rd Aug '01, 10:42am
It makes sense, such as /var/etc/log or similar - repeated messages are replaced with "This message was repeated 3 times..."


Im not sure how many errors would be genuine though, as they may change very slightly with different referes etc.

chilliboy
Fri 3rd Aug '01, 10:51am
Yep - you could have many different 'referrers' with the same error message - but it would also not be hard to disregard changes in referer and just look for core error message matches.

Castel
Mon 6th Aug '01, 12:53am
It would be a nice change, I guess very few people here have seen 1200 emails come in because SQL was down for about 15 minutes. I've experienced that joy more than once ;)

JamesUS
Mon 6th Aug '01, 12:57am
It would be handy, but I'm not sure about dropping the referrals thing. Perhaps we could have the log say this error has occured 2 times in index.php on line 55, 56 times in showthread.php on like 765 etc.

chilliboy
Tue 7th Aug '01, 11:35am
Sure - you could really do it any how you wanted - it just require a bit of trickery with flat files and expression matching - non of it would be really to complicated.

The Point is - when your mySQL starts throwing errors that last thing you need is hundreds of e-mails jamming you inbox with the same message - and with a fairly simple script there would be no need.