on one's last legs

[on one's last legs] {adj. phr.} Failing; near the end.

Theblacksmith's business is on its last legs.

The dog is old andsick. He is on his last legs.

Compare: ONE FOOT IN THE GRAVE, ONONE'S KNEES(2).