Samyukta Āgama (2) 19
Bhikkhu Saṃyutta The Buddha sees a distracted monk 1
Thus have I heard, once, the Buddha was staying at the Deer Park near Vārāṇasī, the dwelling-place of sages.
At that time the World-honored One put on his robe, took his begging bowl and entered Vārāṇasī to beg for food. There he saw a monk, whose mind was not concentrated, whose senses were distracted. When this monk saw the Buddha coming in the distance, he hung his head in embarrassment. After the Buddha had finished his alms-round and washed his feet he entered the dwelling-places of the monks and entered his silent abode. When he came out of his silent abode again, he sat among the monks and said to them: “This morning I saw a monk, whose senses were not reined in. When he saw me coming in the distance, he became embarrassed, hung his head and reined in his sense-doors. Who was this?” Then the monk rose from his seat, arranged his his outer robe on his left shoulder, and placed his palms together in salutation said to the Buddha: “World-honored One! I was the one who was without concentration, whose senses were distracted.” The Buddha said: “Very good, monk! You were able to rein in your senses and focus your thought when you saw me. Whenever you see a monk, a nun, a lay-man or a lay-woman, you should do likewise. Control your senses and focus your thought, as if you were seeing me. This will bring you happiness and gain in the long night of saṃsāric existence.”
Then the monk spoke this verse:
“A monk went begging, entered the town / his mind distracted, confused and unstable; when he saw the Buddha, with diligent effort he reined in his senses / therefore the Buddha said ‘Well done!’”