check the temperatures of your enclosure. If the weather is hot it will heat up your snake's cool end to an undesirable level, offering no relief for your snake. I'm not saying it is definitely the issue, but pinned against the glass like that can often mean its hot in there and he can't get cool. And check his water, to make sure its nice and cool.