Jami` at-Tirmidhi 3564
Ali said:
“I was ill and the Messenger of Allah passed by me while I was saying: ‘O Allah, if my term has come, then give me relief, and if it is coming later, then make my life more bountiful, and if it is a trial then make me patient (Allahumma, In Kana Ajali Qad Hadara Far’arihni, Wa In Kana Mata’akh-khiran Fa’arfighni, Wa In Kana Bala’an Fasabbirni).’ So the Messenger of Allah said: ‘What dod you say?’” He said: “So he repeated to him what he said.” He (one of the narrators) said: So he struck him with his foot and said: “O Allah, grant him health (Allahumma Afihi)” – or – “heal him (Ashfini).” – Shu’ba is the one who doubted. He said: “So I did not suffer from my ailment again.”
حَدَّثَنَا مُحَمَّدُ بْنُ الْمُثَنَّى، حَدَّثَنَا مُحَمَّدُ بْنُ جَعْفَرٍ، حَدَّثَنَا شُعْبَةُ، عَنْ عَمْرِو بْنِ مُرَّةَ، عَنْ عَبْدِ اللَّهِ بْنِ سَلِمَةَ، عَنْ عَلِيٍّ، قَالَ كُنْتُ شَاكِيًا فَمَرَّ بِي رَسُولُ اللَّهِ ﷺ وَأَنَا أَقُولُ اللَّهُمَّ إِنْ كَانَ أَجَلِي قَدْ حَضَرَ فَأَرِحْنِي وَإِنْ كَانَ مُتَأَخِّرًا فَأَرْفِغْنِي وَإِنْ كَانَ بَلاَءً فَصَبِّرْنِي . فَقَالَ رَسُولُ اللَّهِ ﷺ " كَيْفَ قُلْتَ " . قَالَ فَأَعَادَ عَلَيْهِ مَا قَالَ قَالَ فَضَرَبَهُ بِرِجْلِهِ فَقَالَ " اللَّهُمَّ عَافِهِ أَوِ اشْفِهِ " . شُعْبَةُ الشَّاكُّ . فَمَا اشْتَكَيْتُ وَجَعِي بَعْدُ .
قَالَ أَبُو عِيسَى وَهَذَا حَدِيثٌ حَسَنٌ صَحِيحٌ .