Clembot is a robot built by Clemont to run the Gym for him. However, due to a malfunction, his programming was very strict, only allowing Trainers with four badges in the gym. Since Clemont had no badges, he kicked out Clemont and Bonnie.
Season 18: XY: Kalos Quest
Given to by Clemont
Magnemite is one of Clemont's pokemon at the Lumiose City gym. It was sent as security to protect the gym by Clembot, when Magnemite saw Clemont and his friends inside it was happy to see him. But remember it's job as a guard and attacked the gang with Thunder Shock until Froakie used his frubbles to get passed it.