A very simple kind of magnetic sensor.

Two thin strips of metal are placed in close proximity, but are not touching. One is connected to a voltage source, the other to ground. When all is normal, no current will flow. When a magnetic field is aligned along the switches, they will be drawn in one direction, and touch, and current will flow.