Folklorist Tom Munnelly collected songs from Tom Lenehan over many years, publishing them in a lovely tape/book package called "The Mount Callan Garland" a year or so ago. He gives details on this one.
Lenehan learned the song from an American songbook "617 Irish Songs and Ballads" sent to him by his sister in America. He fitted the jig tune "Larry O'Gaff" to it and its this version everyone sings. I have a date somewhere for the book - I'll check it later.
The earliest version Munnelly could find was in "The Emerald Isle Songbook" , published in 1899 in Dublin. The words are credited to one Joseph Lunn (no dates) and a tune called "Ireland so Frisky" is recommended. Lenehan's version, incidentally, omits one verse of the original - Munnelly speculates because it is difficult to scan to his tune.
BTW There's a lione in the first verse usually rendered as ".. the true physic to matters pathetic" or ".... to bother pathetic" (Lenehan's version). The original was "... physic to bother phthisis.."! It's a pulmonary disease.