Truvativ 1x front chainguide - what's wrong with this?
Looks like the chainguard is of the type that mounts with a number of bolts that screw into the frame. You can see the slots in the mounting plate the screws go through to allow setting the chainguard angle. Presumably those bolts just need tightening?

I'd pull the crank and guard off and clean everything up as there may be dirt behind the guard plate. Looks like you will be doing this anyway if the BB is toast.

GMBN has a video on fitting this type of chainguard: