Anal glands...take him to the groomer or vet. You can learn to express them yourself. It is done by the groomer each time they bathe them. If your dog is on a cheap food it will make it worse and happen more often. Pedigree is a horrible food for anal gland problems
Sounds like the anal glands to me too. You can learn to express them on your own, but it is kind of nasty! My dogs need their done avery 8-12 weeks. Little dogs tend to need their anal glands expressed more than big dogs. It can be done externally or internally. You want to get this done quickly because if it ruptures and abscesses, nasty, nasty, nasty. The pet groomer will do the anal gland expression also, this usually for 10 dollars cheaper than the vet tech, so check on prices if you don't want to do this by yourself. My dogs will also lick that area more than usual if there is a problem.
I'll bet it's impacted anal glands, which is a common problem in dogs. As the glands fill up with fluid, they can burst all at once, or leak slowly. Sounds like you've got a leaker. Most dogs express these glands on their own when they defecate - other's can't. Your vet can check this out and express the glands manually. You don't want to let it go as sometimes the glands can become infected and abscess if not taken care of early.
Some dogs will let you know there's a problem in that area by doing the "butt-scootin' boogie" - dragging their rear ends across the floor. Others, you really don't know until a gland ruptures and sprays that nasty stuff all over the place. I think you'll have your clean-smelling dog back as soon as those glands are taken care of. :-)