Create app alert if camera or doorbell inactive,

My doorbell sometimes dies but we don’t know till someone says your doorbell doesn’t work. Can you create a alert to app when doorbell or camera goes off line?