[deleted]
Most snakes are like that. They attack only when cornered or when they feel threatened, and if they can, they prefer to hide, or stay hidden. That being said, if you put snakes in a pit (typically an enclosed space with not a lot of room to move around, or to hide) and then throw someone in it, the snakes only option would be to attack.
Now all that aside, it is not certain that Ragnar Lodbrok actually existed. He is mentioned in Old Norse poetry and sagas, the most famous being The Tale or Ragnar Lodbrok, and the Tale of Ragnar's Sons. He was said to be the father of many famous sons, which were historical figures, but, the deeds of Ragnar are actually tied to more than one historical figure.