Fixes #4977

Refactored common alarm code into alarm.dm