I once had a serious mouse problem. Poison and rat traps worked, but I had to put them out and set them every day, and it was a nuisance. When I finally got the infestation under control and stopped finding dead or injured mice in the traps, my wife and I witnessed a very large snake (in this case a non-venomous one) leaving a crack in the wall of our house.
There are sound-repellers--i.e. instruments that make loud noises out of the range of human hearing but enough to be obnoxious to rats and mice--and it's my understanding that they work well for a while but that the rodents become accustomed to them, and after a while the don't work.
“Rats attract snakes. “
That’s the silver lining, to some of us.
:)