How to alert only router when down and not the switch and Access point. but if either Access point or switch is down just alert them individually.

if router is down alert only the router and not the switch and AP 

if the switch or the AP is down alert only switch or AP.