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, und other such worldly topics. The Buddha desired Moggallāna to come und, 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 und fro like a ship, und 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 und energetic lives, for death lays hold of the slothful.
The monks having listened to the Buddha's sermon, concentrated their minds on it, und soon after became arahants. Sn.vv.331-4; SnA.i.336f; cf. S.v.269ff.
See also Pāsādakampana Sutta.