Needing to bolster their defense for the stretch run, the Sharks swung a deal Sunday for Montreal’s Craig Rivet.

The Sharks traded their first-round draft pick and defenseman Josh Gorges to the Canadiens for Rivet and a fifth-rounder in 2008. The Sharks still own New Jersey’s first-round pick.

Rivet, who has a salary of $2.47 million, will be an unrestricted free agent after this season. He is known for his big heart, character and team-first attitude.

“We were looking for a Mike Grier-type player to play on our back end,” Sharks General Manager Doug Wilson said. “Mike Grier has had a big impact on our team up front. We think Craig will do the same thing. He’s a hard-nosed player that can move pucks and is very well detailed.”

Rivet is not available to play tonight against Anaheim because of immigration paperwork that will require a few days to process.

A bout of pneumonia kept him out of Montreal’s lineup since Feb. 6, but Rivet was planning to play today against Toronto before he was traded.

“It’s been a little bit of a battle the last couple of weeks,” said Rivet, who was third on the Canadiens with an average ice time of 21:03. “I’ve been pushing pretty hard to get back into game shape. I’m at a point where I can’t say I’m at 100 percent, but I think I’m able to play and push through this.”

At 32, Rivet becomes the elder statesman of the Sharks defense. Kyle McLaren (29) and Scott Hannan (28) were the established veterans within a group featuring Christian Ehrhoff (24) and rookies Matt Carle (22) and Marc-Edouard Vlasic (19).

When McLaren missed time in December and January because of illness and injury, his absence highlighted the Sharks’ vulnerability on the back end. The Sharks are 31-16 with McLaren in the lineup and 7-7-1 without him.

“I would not have felt very comfortable if we had gone through the trade deadline and not addressed this area,” Wilson said. “This was a high priority to us.”

The cost of acquiring a rental player before the deadline, which is noon Tuesday, has been relatively steep across the league this season.

With so many teams still in contention, the market has been more favorable to teams in the selling mode. Dallas, for example, traded a first-round pick to Phoenix for forward Ladislav Nagy, who had eight goals at the time of the deal.

“I would much rather get exactly what you want, and pay a price for that, than have to chase your tail and get something that maybe doesn’t fit as well and you overpay,” Wilson said. “We think it’s a fair price for a piece we really need.”

Acquiring New Jersey’s first-round pick in October was part of Wilson’s strategy.

“We did it, knowing that we would use one at this time of year,” he said.

In Gorges, the Canadiens gained a gutsy player who never bailed out on taking a hit to make a play. But opponents began to use this courage against Gorges because he lacked the size — he’s listed at 6-foot-1, 195 pounds — to hold the puck against physical forwards.

Gorges, 22, was scratched in the Sharks’ past four games, with Douglas Murray getting the call.

Murray played some of his best hockey this season in victories over Washington and Chicago. But Murray’s goof on the opening shift of the third period Saturday helped Calgary score the winning goal in a 7-4 victory. He was benched for the rest of the game, underscoring the organizational concern about the defense.

Rivet said one of his first phone calls after the trade will be to his friend Vincent Damphousse, the former Canadiens and Sharks captain, to ask about life in San Jose.

Three women have told the New York Times that music mogul Russell Simmons raped them, the latest in a cascade of serious allegations of sexual misconduct against powerful men in entertainment, media, politics and elsewhere.