Study of the magnetic properties of the permanent magnets by Mössbauer spectroscopy