It is narrated from Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: Some poetry is based on wisdom. It is narrated from Sayyiduna Ka'b bin Malik (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: By Him in Whose hand is my soul, the poetry you recite about the polytheists is as if you are showering them with arrows.
Hadith Referenceمسند احمد / مسند المكيين / 15786
Hadith Gradingحکم دارالسلام:إسناد الحديث الأول: "من الشعر حكمة" صحيح، خ: 6145، والحديث الثاني صحيح لغيره، وإسناده ضعيف، بشير ابن عبدالرحمن، لم يذكر البخاري وابن أبى حاتم الرواة عنه سوى اثنين ، ولم يؤثر توثيقه غير ابن حبان