Its all about Ruby On Rails
notifications
Hoptoad: A Rails Exception Handling Service
Aug 12th
Many of you guys(as me) may have used Exception Notifier plugin to get Rails app exceptions right into your mailbox, and may also have faced some problem like this.
Also if you have 2-3 or more apps running in production then managing such exception mails is also a big headache. In such case one have to keep track of many things like which type of error is resolved/unresolved for which project etc… .
So, here is a good news for those who don’t know about Hoptoad. It is an hosted service by thoughtbot which receives your exceptions, notify you once per error type by email and keep track(resolved/unresolved, count etc…) of your errors on project basis.
By now its a free service. I’m gonna use this as my next project goes live. What abt you??? ;-P
Ruby Script for SVN commit notification with log message, list of updated files and readable colored SVN Diff
Jan 14th
Some days ago I wrote a post about “SVN commit notification” which uses a perl script for sending commit notification with svn diff by mail. In this mail you can find svn diff from the last committed revision. I used to love this mail, soon I realized that it is a bit ugly and difficult to read. Also there were some important information missing. Like the name of user committing the code, the log message etc…
And then I started writing my own ruby script for same purpose but with some addition and modification. Commit Notification Script is that script, you can download and configure it with your SVN post commit hook as follows.
Add following line at the bottom of your post-commit file:
/usr/bin/ruby /var/www/repositories/project/hooks/commit-email.rb "$1" "$2"
* Please remember to change the path of you commit-email ruby script.
Now open commit-email ruby file and modify the following section according to your requirement:
# You can edit below
# Subject prefix
sub = "[test_project@vinsol]" # A project 'test_project' is maitained at vinsol
#list of users who will recieve commit notification
recipients = ["bansalakhil30.10@gmail.com", "akhil@vinsol.com"]
# email which will appear in from email field
from_user = "svn-notify@somedomain.com"
# your smtp settings here
ActionMailer::Base.smtp_settings = { :address => 'localhost', :port => 25, :domain => 'domain.com'}
# Do not edit below this line
You are done with that, now onwards whenever someone commits the code, you’ll get the commit notification mail like:
Careful while using Exception Notifier Plugin
Jul 26th
Exception Notifier Plugin can make you crazy as it made me yesterday.
Let me explain, I was using this plugin for one of my project and our server got a DOS attack. We were requested some URLs that doesn’t exists, like http://somedomain.com/game.rar etc… . I had registered my gmail account to get notification mails. And due to this attack I was sent around 7631*61 mails in 10 hrs. This made me crazy, because I was unable to receive any other email as (may be) my queue was busy with receiving notification mails. Then gmail started bouncing back those mails saying “The Gmail user you are trying to contact is receiving mail at a rate that prevents additional messages from being delivered. Please resend your message at a later
time”. And then it became a loop, Gmail-My Server-Gmail.
I found 303552 mails in postfix queue of my server. That were ready to send to gmail. Now my first priority was to clean that postfix queue, so I did it by issuing “sudo postsuper -d ALL”. I hope to receive mails ASAP, It is now more than 48 hrs i received any genuine mail.
So I request you to be careful while using this plugin
Note: Since my gmail account not receiving mails, so please sent it to akhil at vinsol dot com
Get svn commit notification right into your inbox by using svn hook post-commit
Jul 12th
If you wish you can get notification right into your inbox when a team member commits the code. This mail will contain list of files added/deleted along with the svn diff of files that are modified. This needs some extra efforts to setup, but once it is setup it is very helpful.
This can be done by using svn hooks. Yes, svn has inbuilt hook functionality like pre-commit, post-commit, post-lock, post-unlock, pre-lock, pre-unlock, start-commit. We’ll use post-commit hook to get notifications.
First of all get a perl script from here http://svn.collab.net/repos/svn/trunk/tools/hook-scripts/commit-email.pl.in and copy it to hooks directory inside your repository directory, lets say /var/www/repos/repository_name/hooks.
Make sure to rename it as commit-email.pl, ofcourse you need perl installed on your server. Now cd to hooks directory inside you repository directory. Rename post-commit.tmpl to post-commit, and chmod 755 to post-commit and commit-email.pl . Now open post-commit in you favorite editor, and put “/usr/bin/perl /var/www/repos/commit-email.pl –from svn-notify@example.com -s ‘SVN commit notification’ ‘$REPOS’ ‘$REV’ user_whom_to_notify@example.com, another_user_to_notify@example.com” at the bottom of that file. Now open commit-email.pl and make changes in configuration section according to your requirement and server, specially svnlook path.
Congrats!, You are done
.
Now your server will send email notification to user_whom_to_notify@example.com, another_user_to_notify@example.com whenever someone commits.
**For security reasons, the Subversion repository executes hook scripts with an empty environment that is, no environment variables are set at all, not even $PATH or %PATH%. Because of this, a lot of administrators are baffled when their hook script runs fine by hand,but doesn’t work when run by Subversion. Be sure to explicitly set environment variables in your hook and/or use absolute paths to programs.
It worked for me, Please let me know if it works for you too.
Plugin: Exception Notifier; Get detail information of exceptions occurred on the live server right on your inbox.
Dec 28th
I don’t know whether you guys are aware of Exception Notifier plugin written by Jamis Buck or not. If you don’t then I would like to share this with you.
- the sender address of the email
- the recipient addresses
- the text used to prefix the subject line
The email includes information about the current request, session, and environment, and also gives a backtrace of the exception.
I am using this plugin and found it very useful, and suggest you to use it.
You can get this plugin from http://dev.rubyonrails.org/svn/rails/plugins/exception_notification/
