Good to know that you managed to get the problem sorted !
My CDI problem was exactly the same as yours - my Agility's engine started by times, but some times the engine did not start at all. Since the CDI has been replaced about 1200 km ago, the problem has been solved completely.
What year model is your Agility ? My Agility is a 2009 model and unfortunately the aftermarket CDI on your photo can not be used - the plug on my Agility's CDI looks different.
P.S.
On page 1 somebody mentioned "when CDI's go, they go completely".
That statement is clearly incorrect, and can cause a lot of confusion in future. I think for future reference that statement should be removed from the forum completely.