The Prophet ﷺ said, "There is no one who is afflicted with a trial in his body except that Allah commands the angels who guard him, saying, 'Write down for My servant every day and night the good he used to do, as long as he remains in My bond.'"
حدثنا إسحاق بن يوسف الأزرق حدثنا سفيان الثوري عن علقمة بن مرثد عن القاسم يعني ابن مخيمرة
عن النبي ﷺ قال ما أحد من الناس يصاب ببلاء في جسده إلا أمر الله عز وجل الملائكة الذين يحفظونه فقال اكتبوا لعبدي كل يوم وليلة ما كان يعمل من خير ما كان في وثاقي
Its isnad is sahih. Alqama bin Marthad, his reliability was established earlier at 2700, and we add here that Bukhari mentioned him in Tarikh al-Kabir 4/1/41, and Ibn Abu Hatim in Jarh wa Tadil 3/1/106.Qasim bin Mukhaymara, with damma on the mim, fatha on the khaa (with the dotted khaa), kasra on the second mim, and fatha on the raa, the Hamdani, his reliability was established earlier at 748, and we add here that he was deemed reliable by Ibn Main, Abu Hatim, Ibn Saad, and others. Ibn Saad mentioned him in Tabaqat 6:211, Bukhari in Tarikh al-Kabir 4/1/167, and Ibn Abu Hatim in Jarh wa Tadil 3/2/120.Ibn Main said, "We have not heard that he heard from any of the companions." But this requires examination, for Ibn Hibban said that he asked Ayesha about what a muhrim may wear, and Ayesha died before Abdullah bin Amr. Moreover, this Qasim died in the year 100, or as some say, 101, while Ibn Amr died in the year 65. So if he met Ayesha and heard from her, then he was a contemporary of Abdullah bin Amr, and being contemporaries is sufficient to establish connection.The hadith appears in Majma al-Zawaid 2:303, where it is stated, "Ahmad, Bazzar, and Tabarani in Kabir narrated it, and the men of Ahmad's chain are the men of the sahih." Bukhari also narrated something similar to it, in abridged form, in Adab al-Mufrad (p. 73), through the route of Sufyan from Alqama.Al-wathaq, with fatha and kasra on the waw, means that by which one is bound.