It is usually possible to predict a volcanic eruption. The top of the mountain can be seen bulging out before an eruption. One can also do infrared measurements; as magma comes closer to the surface, the top of the mountain begins to get hotter. One can also make seismic measurements because as the magma flows towards the surface, there are small earthquakes which cause the whole mountain to jiggle.