Ship's cat
Cats naturally attack and kill these rodents. Cats also have a natural ability to get used to new surroundings, so they could get used to serving on ships. They also offered companionship (friendship), a sense of home and security, and lifted sailors' spirits.  This was helpful to sailors who could be away from home for long periods, especially in times of war.