A device for determining and/or monitoring a temperature of an, in particular electrically conductive, medium in a container, comprising a measuring insert in which at least one temperature sensor is arranged, and a protective tube, which comes into contact with the medium and is used to mount the measuring insert, wherein the device comprises at least one diagnostics unit, said diagnostics unit having at least one first electrode made from one first material, said first electrode being at least partially located in an internal volume of the device, and wherein a galvanic cell is formed by the first electrode and one of the following; • a second electrode, wherein the diagnostics unit comprises at least the first electrode and the second electrode, wherein the first material for the first electrode and a second material for the second electrode differ from each other in terms of their electrochemical properties, • the protective tube, wherein the first material differs from a material of the protective tube in terms of its electrochemical properties, • an extension tube, said extension tube being configured to connect to the protective tube, wherein the first material differs from a material of the extension tube in terms of its electrochemical properties, wherein the device is configured in such a way that, in the event that medium enters the device, there will be voltage at the galvanic cell as a result of damage to the protective tube, wherein the presence of voltage at the galvanic cell is used to perform diagnostics on the device in terms of damage to the protective tube, wherein the device comprises a fixing for attaching the diagnostics unit, in particular in such a way that it can be removed again. a measuring insert in which at least one temperature sensor is arranged, and a protective tube, which comes into contact with the medium and is used to mount the measuring insert, wherein the device comprises at least one diagnostics unit, said diagnostics unit having at least one first electrode made from one first material, said first electrode being at least partially located in an internal volume of the device, and wherein a galvanic cell is formed by the first electrode and one of the following; • a second electrode, wherein the diagnostics unit comprises at least the first electrode and the second electrode, wherein the first material for the first electrode and a second material for the second electrode differ from each other in terms of their electrochemical properties, • the protective tube, wherein the first material differs from a material of the protective tube in terms of its electrochemical properties, • an extension tube, said extension tube being configured to connect to the protective tube, wherein the first material differs from a material of the extension tube in terms of its electrochemical properties, • a second electrode, wherein the diagnostics unit comprises at least the first electrode and the second electrode, wherein the first material for the first electrode and a second material for the second electrode differ from each other in terms of their electrochemical properties, • the protective tube, wherein the first material differs from a material of the protective tube in terms of its electrochemical properties, • an extension tube, said extension tube being configured to connect to the protective tube, wherein the first material differs from a material of the extension tube in terms of its electrochemical properties, wherein the device is configured in such a way that, in the event that medium enters the device, there will be voltage at the galvanic cell as a result of damage to the protective tube, wherein the presence of voltage at the galvanic cell is used to perform diagnostics on the device in terms of damage to the protective tube, wherein the device comprises a fixing for attaching the diagnostics unit, in particular in such a way that it can be removed again.