They were made to work hard by the Welsh side but shrugged off place-kick misses by stand-off Duncan Weir, and a later injury to the player that saw him carried off on a stretcher, to score the bonus point win that ensures a top-four finish.
They ran in first-half tries through prop Ryan Grant (two) and winger Sean Maitland before scrum half Niko Matawalu grabbed the fourth in the second half and DTH van der Merwe made himself the top Glasgow try scorer with a counter to close the game.
Weir succeeded with two conversions and a penalty plus Peter Horne goaled a penalty.
Glasgow made a bright start fired up by scrum half Matawalu but twice stand-off Weir missed with kickable penalty attempts from the same spot to the left of the posts. In between Dan Biggar slipped his penalty attempt over.
Glasgow's disappointment was compounded after 10 minutes. John Barclay, in perhaps his final game for Glasgow, appeared to touch down under the posts after good work by Maitland and Alex Dunbar, but the TV evidence proved the ball was held up
But from the scrum five pressure Grant touched down by a post and Weir converted.
Ospreys had to make a change when hooker Richard Hibbard went off with a knee injury to be replaced by Scott Baldwin.
Glasgow's video luck changed after 17 minutes when Maitland's full speed chase to Matawalu's kick was confirmed as he touched down millimetres within the sideline.
Weir again failed to convert and after a long spell of Ospreys' phase play that came to nothing he suffered his third penalty miss.
Eight minutes from the break Glasgow scored their third try, an exciting one with the high-speed deft offloading begun by Matawalu finished off by Grant.
This time, from wide, Weir converted and his 40th-minute penalty sent Glasgow in with a deserved 22-3 lead.
Almost from the restart Ospreys' Adam Jones and Glasgow's Grant found themselves in the sin bin.
Replacement prop Cai Griffiths was no sooner on the field for Ospreys than he was plunging over by the posts with Biggar's conversion pulling back the score to 22-10.
In typical live-wire fashion Matawalu grabbed Glasgow's bonus point try after 57 minutes, taking a tap penalty to himself and shooting over from 20 metres before Ospreys awoke.
Weir again missed with his kick and soon a nasty injury saw him leave the pitch.
With Glasgow seeming unfocused when play restarted Ospreys replacement Sam Lewis got over with Biggar converting.
However Glasgow got back on track and finished the game in great style with a final minute try from Van Der Merwe added to an earlier penalty by Peter Horne.
To wrap up the regular season Glasgow visit Connacht in a fortnight's time while Ospreys are now struggling for a top-four place and face a difficult trip to Leinster.
- Sports & Recreation