A chain is only as strong as its weakest link, and in fencing, that link is often a sagging or leaning post. While proper footings will prevent many post problems, after a post begins to go bad, a quick resolution is the best way to avoid replacing the post and damage to the surrounding posts and fencing. Using eyebolts to install a cable and turnbuckle to straighten the post is a sure way to create a permanent fix that will also strengthen the fence.
Set a level against the face of the post that it is leaning toward. Tilt the top or bottom out from the post until the bubble is centred. Measure between the level end you tilted out and the face of the post. This is how far out of line your post is.
Drill a ¼-inch thick by 1 ½-deep pilot hole at the top of the post that is leaning on the face it is leaning away from. Drill a second hole an inch or two up from ground level on the next post in line on the side the post is leaning away from. Install an eyebolt in each. Tighten by inserting the blade of a heavy screwdriver through the eye and using the handle to twist the bolt in.
Cut your cable, which should be a little longer than the distance diagonally between the top of the leaning post and the bottom of the next post on the side the post is leaning away from, in half. Thread one end of each piece through one of the eyebolts. Fold the cable so the short end you threaded is pointing away from the eyebolt and about four to six inches from the eyebolt. Install a screw-type cable clamp with a screwdriver and locking pliers. Tighten both of the clamp screws firmly.
Thread the remaining end of each piece of cable through one end of the turnbuckle, which should be a little longer than the distance your post is leaning. Pull the cable snug and fasten the eyebolts. Trim any excess from the ends of the cable with bolt cutters.
Tighten the turnbuckle with a wrench until it is snug. Position the level against the face of the post and continue tightening until the bubble is centred. Turn the buckle two full turns past level to ensure the post's won't sag again.
Check the remaining posts and add more cable as needed. A slight lean that does not affect the aesthetics of the fence can be left as is as long as the post is stable. Check your straightened posts in 24 hours and adjust the turnbuckle as needed.