on its last legs
From Longman Dictionary of Contemporary Englishon its last legson its last legsinformalCONDITION/STATE OF something old or in bad condition, and likely to stop working soon The car’s on its last legs. → lastExamples from the Corpuson its last legs• Your car sounds like it's on its last legs.• The battery, like the torch's owner, was on its last legs.• Without some fresh thinking the G8 is probably on its last legs as an effective body.• It's an old established set-up, but I reckon it's on its last legs now.