Connect magnetic sensor to Arduino

What's the material of the piece? Do you have to build a metal or a magnet detector?