I have two coops that used to be horse stalls in my barn. There is a pop door for each coop out to a chain-linked run. Feed and water are out at all times hanging inside the coop. Then I noticed holes being dug under the walls and finding rat droppings in the food and in the nesting boxes. I think they want the pine shavings for their own homes. Anyway, to make a short story long. I put up a game camera and was amazed at how many rats were coming by. They even got to the point where they would come out during the day while I was feeding and watering.
So I ended up making some trap boxes. I used the big rat snap-traps, screwed them down to a piece of plywood and placed the entire setup into a clear storage box with a latchable lid. Bore a hole in each end large enough for rats, small enough to keep chicken heads out and then baited them with chicken feed. I racked up a total of at least 50 rats that summer. When trapping, I would also take their food out of the coop but that tends to be a PIA since I don't get out to the coop to replace their food until mid-morning. Several times I had three dead rats with only two traps in the same box! I also shot about 10 rats with my pellet gun.
And then I got a couple of barn cats. Started leaving the coop doors (sliding stall door) open just enough for the kitties but not enough for the chickens. Cats took care of one rat and one mouse so far in about 2 years. But also, don't seem to have a rat problem anymore.
Also, also, the rats will drastically increase population in the winter when the black rat snakes are hibernating.
I guess the morale to my story is, if you find some rat droppings in your nesting boxes, it is unlikely you only have a "one rat" problem. These were just some of my solutions....
Bwaaaaak