1 Kings 2:5-9

1 Kings 2:5-9King James Version (KJV)
5 Moreover thou knowest also what Joab the son of Zeruiah did to me, and what he did to the two captains of the hosts of Israel, unto Abner the son of Ner, and unto Amasa the son of Jether, whom he slew, and shed the blood of war in peace, and put the blood of war upon his girdle that was about his loins, and in his shoes that were on his feet.
6 Do therefore according to thy wisdom, and let not his hoar head go down to the grave in peace.
7 But shew kindness unto the sons of Barzillai the Gileadite, and let them be of those that eat at thy table: for so they came to me when I fled because of Absalom thy brother.
8 And, behold, thou hast with thee Shimei the son of Gera, a Benjamite of Bahurim, which cursed me with a grievous curse in the day when I went to Mahanaim: but he came down to meet me at Jordan, and I sware to him by the Lord, saying, I will not put thee to death with the sword.
9 Now therefore hold him not guiltless: for thou art a wise man, and knowest what thou oughtest to do unto him; but his hoar head bring thou down to the grave with blood.
An American English Bible
With Old Testament based on the Greek Septuagint

5 'Now, you know all the things that JoAb (the son of ZeruJah) did to me and to the two generals of the army of IsraEl… to AbNer (the son of Ner), and to Amasa (the son of JeTher)… he murdered them and shed their blood as in war, although we were at peace… he wrapped his waist and the sandals on his feet in innocent blood. 6 So, deal with him as your wisdom directs, and don't allow him to take his grey hair to his grave in peace.
7 'But I want you to deal kindly with the sons of BarZelli the Gileadite… they should eat at your table, because they came to my aid when I had to run from your brother, AbSalom.
8 'And {Look!} there is Semei (the son of Gera – a BenJaminite of BaUrim) who is still among us. He brought a great curse on me when he came down to the Jordan to meet me as I was returning to JeruSalem. Then I swore to him by Jehovah that I wouldn't use the sword to put him to death. 9 However, he isn't free of guilt. Now, you're a wise man, and you know what you must do to him… you must take his grey hair to the grave covered in blood.'

These are my thoughts, please share yours.
5 The Lord knows what we all have done. This may be David talking, Abner did try to put Saul’s son on the throne but the issue was taken care of and then Zeruiah killed him and made a time of peace a time where war could have broke out, David allowed Abner to live to show he was a king of mercy but many would have thought he had Abner killed but that was not true.
6 David is actually praying against this man, he did not seek the man’s life be gave it to the Lord for Him to deal with, we are to let the Lord handle those who cause trouble for us. David may also be warning Solomon against certain people.
7 David had both ran from Saul and his own son both because of what David was doing and both wanted control when God was working through David. The Lord will not forget kindness we should reward what we can be showing people we are thankful.
8 David again showed mercy, when he could have put someone to death.
9 David is allowing Solomon to use the people who wronged David to show that He was indeed the king and to make an example that they need to stay in line and listen to him who is there king.