Rare events in networks with internal and external noise