In a complex and dynamic environment a situated agent, like a mobile robot, has limited knowledge resources and limited control. Sooner or later, therefore, some kind of failure will occur when a robot is attempting to accomplish its task. For this reason, such an agent must be equipped with abilities for dealing with failure. First we give a general analysis of failure and discuss some of the abilities needed to deal with failure. Then we show how to implement mechanisms for dealing with failure and monitoring in 3APL. 3APL is an agent programming language to support the design and construction of intelligent agents. We give an outline of 3APL agents which are entities consisting of goals, practical reasoning rules, and a particular type of control based on an intuitive ordering of rules.