Full Sharh — Mishkat al-Masabih 3970
وَعَنْ عَبْدِ الرَّحْمَنِ بْنِ أَبِي لَيْلَى قَالَ: قَالَ أَبُو لَيْلَى: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: " إِذَا ظَهَرَتِ الْحَيَّةُ فِي الْمَسْكَنِ فَقُولُوا لَهَا: إِنَّا نَسْأَلُكِ بِعَهْدِ نُوحٍ وَبِعَهْدِ سُلَيْمَانَ بْنِ دَاوُدَ أَنْ لَا تُؤْذِينَا فَإِنْ عَادَتْ فَاقْتُلُوهَا ". رَوَاهُ التِّرْمِذِيُّ وَأَبُو دَاوُدَ
English Translation
'Abd ar-Rahman b. Abu Laila. said that Abu Laila reported God’s messenger as saying, "When a snake appears in a dwelling say to it, ‘We ask you by the covenant made with Noah and the covenant made with Solomon son of David not to harm us.’ Then if it comes back, kill it." Tirmidhi and Abu Dawud transmitted it.
Source
Mishkat al-Masabih(مشكاة المصابيح)
Game and Animals Which May Be Slaughtered
Hadith Number
3970