Anal Sacs
They are glands, so they fill up with fluid.
Usually dogs express them themselves when having a BM, but some don't for whatever reason. One reason could be that their stool isn't firm enough. Sometimes vets tell you not to express them if there isn't a problem because there can be undesirable side effects (like not being able to do it themselves anymore). However, if they are full and the dog isn't expressing them, infection and impaction can result meaning major problems, so sometimes it's best to just go ahead and do it. Your vet/vet tech can do it or owners can learn how if they don't get grossed out easily.
This may or may not be related to the odd symptoms lately.
Scooting can also be a sign of worms.