A self-testing device is provided for a monitoring system for monitoring whether a closure member such as a door or window is closed. The monitoring system includes a switch unit mounted on the frame of the closure member being monitored and including magnetically biased switches connected in one or more electrical monitoring circuits, and a door magnet unit mounted on the closure member being monitored. The door magnet includes one or more permanent magnets that produce a magnetic field which, when the closure member is closed, cause said switches to assume a first state. When the closure member is opened, the switches switch to a second, alarm state. The self-testing device is electrically controllable from a remote location and produces a canceling or diverting magnetic field which simulates the effect of movement of the closure member from the closed position thereof without any actual movement of the member.