Yahya related to me from Malik from Humayd bin Qays from Mujahid Abu'l Hajjaj from Ibn Abi Layla from Kab ibn Ujra that the Messenger of Allah ﷺ said to him, "Perhaps your pests are troubling you?" He replied that indeed they were, and the Messenger of Allah ﷺ said, "Shave your head and fast three days or feed six poor men or sacrifice a sheep."
أَنَّ رَسُولَ اللَّهِ ﷺ قَالَ لَهُ لَعَلَّكَ آذَاكَ هَوَامُّكَ فَقُلْتُ نَعَمْ يَا رَسُولَ اللَّهِ فَقَالَ رَسُولُ اللَّهِ ﷺ احْلِقْ رَأْسَكَ وَصُمْ ثَلاَثَةَ أَيَّامٍ أَوْ أَطْعِمْ سِتَّةَ مَسَاكِينَ أَوِ انْسُكْ بِشَاةٍ