try micpc.com/eventmonitor/ … [its free open source] you do not have to use the whole GUI thing but it does come with a script to run to catch the events and throw them into a mysql database that should get you started.
I tried the events monitor,it is easy to install and use,but it does not serve my purpose because I want to use some logic depending on the result of the vents.
eg.
Display - No answer
if the vent shows that there is no answer.
I looked at the code but I dont understand Python so it is difficult for me.