I haven't heard the expression before, but from context and the few other examples I can find on the web (two more of which come from Mark Twain, who apparently was fond of this expression) it means to scold vigorously.
The phrase comes from an 18th-century
hymn by Isaac Watts with a grim message indeed:
Hark! from the tombs a mournful sound;
My ears, attend the cry;
"Ye living men, come view the ground
Where you must shortly lie."
[not a teacher]