KernelTrap has a very nice summation of Constantine Murenin’s BSDCan 2008 talk about the OpenBSD sensors framework. This framework is in DragonFly now. It was also in and then out of FreeBSD; the KernelTrap article (in addition to describing how the actual code works) covers some of the conversation between Poul Henning-Kamp and Constantine Murenin at the BSDCan event about why that happened with FreeBSD.
Updated again: description changed, at Constantine’s request.