The present invention discloses an optical fiber grating sensor for long-term real-time monitoring of the corrosion on steel bars. The optical fiber grating sensor comprises a protection shell, a fixation pipe buckle, an optical fiber grating, a conduction cantilever and a monitoring cantilever, wherein a protection shell is a bottomless rectangular box type structure, one side wall of the protection shell is provided with a round hole, the protection shell is fixedly connected to a steel bar through the fixation pipe buckle, the protection shell and the fixation pipe buckle form cementation connection after surface treatment, the protection shell is connected to the monitoring cantilever in a partially embedded manner, the fixation pipe buckle is connected to the conduction cantilever in a partially embedded manner, the monitoring cantilever forms pressing connection at the upper portion of the conduction cantilever, the optical fiber grating is arranged below the monitoring cantilever, and the tail fiber of the optical fiber grating passes through the upper portion of the conduction cantilever, penetrates through the round hole, and then is sleeved with an optical fiber loose sheath. According to the present invention, the optical fiber grating sensor can meet the long-term real-time monitoring of building members, and has advantages of convenient arrangement, simple structure, small size, high measurement precision, good stability, easy manufacture and processing, high sensitivity, anti-electromagnetic interference, adjustable measurement precision, good economic benefits, and good social benefits.