Create a simple Peppermint releasing device and put it in areas where rats or mice go, they won't go near it. Also a lot of insects like ****roaches (lol, it censors this, haha) also avoid peppermint.
Get an old pill bottle, drill a few holes, stuff it with cotton balls that you put peppermint oil on, and it will stay active for months. I recharge mine with fresh oil drops about every 3 months and it's still strong even after all that time. I can probably go 4-5 months between recharges.
Just note that cats also hate the smell and will avoid it as well.