Best way to deal with rats nesting in my tractor

Specifically, I want to know how best to keep them from coming back and building another nest.
 
The whole story is that my tractor was on extended loan to a family member, when health problems struck and the tractor sat idle for a long time.  During the idle time a lady rat decided it would be a wonderful place to raise her family.  She/they ate all the wiring, hoses and basically anything under the hood that wasn’t metal and urinated all over the top of the engine.  So I had a mechanic clean it up, re-wire it and get it running again.  I just got it back this week.  Ran it just a few minutes to test it out and as the engine heated up I could smell the urine odor.  I’m guessing this will signal to rats on my property that this is a Momma-Rat approved nursery location.
 
Is there anything I can do (a chemical spray, an herbal spray, etc.) short of keeping a pet rattlesnake under the hood to deter rats and mice from getting back in there?  I will get it out and get it good and hot as soon as I can – probably the weekend – and hopefully that will lessen the aromatic allure from the smell.  And I heard that leaving the hood up will help as rats won’t nest where the sun shines.
 
Thanks in Advance,

-rainy

I have never had problems with rats, but I have had them with mice and our extra car. We found regular use definitely helps. We have also used moth balls under the hood and sprinkled around the carport edges.
For under the hood, we went to the dollar store, bought a cheap plastic pencil box, and drilled holes for air flow. Then we put some mothballs inside and found an out of the way spot to sip tie it under the hood.
The smell can be a little strong, so when we use the car, we usually remove the box until we park it again.

I 2nd the mothball idea. Plus, make sure there is no food in the tractor storage area.

They are probably available in many places, but I have purchased little bags of what appears to be potpourri designed for this exact purpose at Tractor Supply. I used mothballs in the past, and these little bags are much less offensive.

I can’t recall if product links are OK here, so look for “Fresh Cab botanical rodent repellent”

What is working for me is light. I have two cars that rats have damaged, but now I have a trouble light under the hood with a plastic LED bulb. They don’t light the light. I use the plastic LED simply because they won’t break if you drop the light. The caveat is that you will forget about the light and try to drive off with it still plugged in. So route the cord away from fans and belts. Probably not an issue with a tractor. The low power draw of the LED lamp means this won’t be a big electric bill.

Edit: you’ll drive off with the light once, maybe twice before you get used to removing it. Twice for me cause I’m a bit slow.

I haven’t dealt with rats as pests very much, but I have owned pet rats for many years and have observed their behavior for literally thousands of hours. I can confirm that they don’t like light or open spaces. They’re happy in your tractor engine compartment because it’s dark and enclosed and there are little nooks and crannies they can shelter in. That’s the kind of environment they feel safe in. Leaving the hood open seems like a simple way to make the area less attractive to them. Lights would help too.

Some good suggestions here. I may try implementing them all!

When my friend stores his RV for the winter, he places dryer sheets in it. Never a problem with mice.

Don’t know if they work for rats.