It seems to me you are reinventing the wheel:
http://www.tildeslash.com/monit/
http://www.tildeslash.com/monit/
Thomas
It is possible, that if I could find the program (and I actually tried and I failed and I was surprised) I would not go for this project, but I do not think that the mere presence of trains invalidates bicycle existance.