Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) narrated: We were in Masjid al-Khayf on the night of Arafah when we heard the rustling of a snake. The Messenger of Allah (peace and blessings be upon him) said: "Kill it." It went into a crack in a hole. A man brought a palm branch and set fire to it, then we emptied part of the hole, but we did not find it. Then the Messenger of Allah (peace and blessings be upon him) said: "Leave it; Allah has protected it from your harm, and protected you from its harm."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 10121