Two (or more) North Poles will exert a repulsion on each other. This repulsive force can be converted into useful work. The amount of energy used to bring the two poles together will be MORE than the amount of work extracted from them. That is, you will be converting motion (generated externally) into heat. There is no such thing as a perpetual motion machine.
The diagram you added shows NO moving parts. If I assume that the two disks are spinning on the shaft, then the bearing surface will wear, but the amount of wear per revolution obviously depends on the materials of construction. The two disks will quickly stop, converting most of the energy you used to start them spinning into heat (friction) but some into electromagnetic waves.
To repeat the obvious, what ever energy you use to spin the disks will be only partially converted into movement of the shaft (if the shaft is also rotating). There is no such thing as a perpetual motion machine.