when you hear the cocks crowing, ask Allah for some of His grace, for they have seen as angel; but when you hear an ass braying, seek refuge in Allah from the devil, for it has seen the devil. (Using translation from Abū Dāʾūd 5102)
عَنْ رَسُولِ اللهِ ﷺ أَنَّهُ قَالَ إِذَا سَمِعْتُمْ صِيَاحَ الدِّيَكَةِ مِنَ اللَّيْلِ فَإِنَّمَا رَأَتْ مَلَكًا فَسَلُوا اللهَ مِنْ فَضْلِهِ وَإِذَا سَمِعْتُمْ نُهَاقَ الْحِمَارِ مِنَ اللَّيْلِ فَإِنَّهُ رَأَى شَيْطَانًا فَتَعَوَّذُوا بِاللهِ مِنَ الشَّيْطَانِ