The Buddha was once staying in the upper storey of the Migāramātupāsāda when he heard the new entrants to the Order, in the cells below, making a great uproar, talking about the food they had eaten, and other such worldly topics. The Buddha desired Moggallāna to come and, when he appeared, the Buddha asked him to frighten the monks by a display of iddhi-power.
By his psychic power Moggallāna caused the whole building to rock to and fro like a ship, and when the monks, in terror, sought the Buddha's protection, he explained to them that Moggallāna gave them the fright as a lesson to them to lead active and energetic lives, for death lays hold of the slothful.
The monks having listened to the Buddha's sermon, concentrated their minds on it, and soon after became arahants. Sn.vv.331-4; SnA.i.336f; cf. S.v.269ff.
See also Pāsādakampana Sutta.