For some G4 models you can download Apple Hardware Test, drag to desktop and then the left hand column of Disk Utility,pop in a CD and burn a bootable copy. Here is the link for AHT, G4's are the third download listed:-
Apple Hardware Test Images
That will not solve your hard drive problem. You do need 15-20% free space for the drive to work anywhere near efficiently.