Al-Walid bin Ubadah bin al-Samit (may Allah have mercy on him) narrates: I went to Sayyiduna Ubadah (may Allah be pleased with him) while he was ill and the signs of death were becoming apparent in him. I said: "Father! Give me counsel, and exert yourself fully for me." He said: "Sit me up." When the people sat him up, he said: "My son! You can never taste the flavour of faith, and you can never reach the reality of knowledge about Allah, until you believe in predestination, its good and its bad." I said: "Father! How am I to know which is the good side of predestination and which is the bad?" He said: "Know that whatever passed you by was never going to come to you, and whatever came to you was never going to miss you. My son! I heard the Messenger of Allah (peace and blessings be upon him) say: 'Indeed, the first thing that Allah created was the Pen. Then He said to it: "Write!" So in that very hour it wrote everything that is to happen until the Day of Resurrection.' My son! If you die while not upon this belief, you will enter Hell."
Imam Ahmad (may Allah have mercy on him) narrated this hadith from Abu al-'Ala al-Hasan bin Sawwar (may Allah have mercy on him).
And Imam al-Tirmidhi (may Allah have mercy on him) narrated it from Yahya bin Musa al-Balkhi (may Allah have mercy on him), from Abu Dawud al-Tayalisi (may Allah have mercy on him), from Abd al-Wahid bin Sulaym (may Allah have mercy on him), and he said: "This hadith is hasan sahih gharib."
Abd al-Wahid bin Sulaym and Uthman bin Abi al-Atikah (may Allah have mercy on them both) have been criticised; however, this hadith is also narrated through other chains besides theirs.
And Abu Zayd al-Himsi, who is also called Abu Ziyad, is Ayyub bin Ziyad (may Allah have mercy on him), and Imam al-Tirmidhi (may Allah have mercy on him) declared this hadith sahih.