You should take it to the vet. My hamster got put down because he was shaking and his eyes wouldn't open. The thing is that his intestines were hanging out of his butt. My vet said there was nothing I can do for him. Petsmart said that my hamster (long haired) lived for 6-7 years, but when I looked online it said 2-3 years. So I don't know which one to believe. But if that is happening I recommend you take it to the vet
I definitely think that he is ill and that you should take him to a vet asap!
It means there is something wrong with him and he probably needs to go to a vet immidietly!