implemtn the alarm history query funciton