Near death. If one foot is in the grave it’s just a short time before both feet and your entire body are in the grave. (Compare to At death’s door, Kiss of death, Not long for this world or Hang by a thread.)
“Our old dog has been with us a long, long time but he has one foot in the grave according to the veterinarian.”