Near-infrared spectroscopy and imaging of Herbig-Haro objects