Let $\mathfrak{g}$ be a compact Lie algebra (a Lie algebra that admits a positive invariant bilinear form) and $\mathfrak{h}$ an abelian Lie algebra. Let $\rho\colon\mathfrak{h}\to\mathfrak{g}$ be a homomorphism of Lie algebras that takes some nonzero element $X$ to a nonzero central element $\rho(X)$ in $\mathfrak{g}$. Is it necessary that $\rho(\mathfrak{h})$ is central in $\mathfrak{g}$?
I've been thinking about this for days. I think it is false. However, I couldn't find a counterexample. Any help is appreciated.