To me, there are 2 opions
1. Fredo DID know there was gonna be a hit. He opened up the drapes. He let one of his men kill the hitmen.
(Maybe: After the hit the hitmen should come to Fredo's house, and Fredo would give them an alibi(don't know if it's the good word. If they come looking for the jitmen, he would protect them and say that they were in his house during the hit). But now they know Micheal survived he was to scared and had an other men (also in his house) kill the hitmen).
2. Fredo did NOT know there was gonna be a hit. A few soldiers of the corleone-family killed the hitmen. They also opened the drapes. The soldiers betrayed the family, they became loyal to Roth.
I believe in the 2nd. Cause i think Fredo really didn't that there was gonna be a hit