Record the CPU temp and if it goes above a certain threshold for longer than a few seconds (to make sure small glitches don't cause random pushes), automatically execute the command. I'm not sure if the way CPU's measure temperature would be able to measure high enough temperature to know it's a fire, but in theory this would work.