Follow-up on previous answer....
The key is persistence and multiple methods. I've tried many [various baits, traps, water dunkers, etc.] and all will catch a few, but they learn quickly, and some just get to be too expensive and a pain to monitor or set up. So in the coop at night, a commercial quality rat trap, baited with a tiny bit of peanut butter mixed with cocoa. When baiting for rats, more is NOT better. A smaller amount, pressed down into the holder, will get better results. I put the trap under a milk crate to keep the chickens away until I take it out of the coop in the morning. The rats aren't deterred by the milk crate. Outside the coop, I keep a couple "gauntlet" tunnel traps, which are nothing more that a wooden box made to contain four commercial rat traps in a row. Made with scrap fence planks, and sized to just allow the traps to lay in there and the trip bail to freely trip and kill the rat. The biggest problem with trapping rats is that they are usually faster than the trap. With the tunnel trap, there is zero place for them to jump to avoid getting killed. Bait is placed only in the center, and they crawl in the reduced openings from either end, and must walk across the non-baited traps to get to the bait. They don't make it. You can buy a case of a dozen of the commercial traps with the very strong springs online for pretty cheap to make multiple tunnels. I've caught 3 at a time in the tunnel traps.
For poison, the various plaster of Paris formulas I found just as effective, and for pennies on the dollar. Wall texture is basically plaster of Paris, and works fine as a very cheap substitute. A little cocoa added to the mix of chicken scratch, plaster of Paris, and sugar also helps to work as an attractant. It's non-toxic, but kills them dead by clogging a rats digestive system. Just fill a small bowl, and put it under something that a rat will find its way into, but stay dry and keep other critters from eating it.
So after wasting a lot of time and lots of money working on the very heavy infestation last year, these three seemed to work the best, with the least amount of effort and money. Of course, the pellet gun is still fun, but won't rid you of the majority of them. But shooting them while they're running in the avocado tree at night with the headlamp on is quite fulfilling.
So no dead chickens, chicks, keets, or ducklings this year from rat attacks. Nothing worse than seeing half your brooder stock eaten or killed by rats that got in a hole you missed, or you favorite chicken laying in the corner of the coop with its head eaten off. I hate rats, and thankfully, now see very few, and the few I do see, are to pull out of a trap to throw over in the field for the turkey vultures.