Adrian McGee, 46, of Newcastle Avenue, Worksop, claimed he had forgotten the metal bar was in his jacket when he went out drinking on a Friday night last November.
But CCTV later picked him up with bar clearly visible in his hand at the scene of a fight outside the Corner House pub in the town.
Defending, Mr Andrew Osborne said: “He said he had been using the implement to repair his car and he had put it into his coat and forgotten about it as it had slipped through the ripped lining of his pocket.”
“He had not even intended to go out drinking that night and when the fight started he felt frightened and felt the metal bar in his coat and grabbed it.”
“He only got it in case he had to defend himself from those fighting, he never had any intention of using it.”
Mr Osborne continued: “Mr McGee held down a solid, well-paid job for many years and worked abroad but his marriage suffered and that affected him greatly.”
“He has suffered mental health issues and twice attempted suicide. He turned to drink and drugs and ended up stealing from his mother to fund this.”
Mr McGee told the court that he lived with his mother as her carer and that there was no-one else to look after her.
District Judge Diane Baker said: “What you did was extremely dangerous. You produced an offensive weapon in very dangerous circumstances.”
“People were fighting and it could have been grabbed by someone else and used against you or someone, or you could have used it yourself.”
“I should send you straight into custody but I have to consider the circumstances and effect that would have for your mother.”
McGee was given a 12-week sentence, suspended for 12 months, and ordered to spend 12 months under supervision. He was also ordered to pay £85 costs and an £80 victim surcharge.