The story
Certainly connected with, and possibly derived from, the lyrics of a Christmas carol, "Santa Claus Is Comin' to Town": He's makin a list / and checkin it twice / He's gonna find out / who's naughty or nice
Etymology from Wiktionary, CC BY-SA 4.0.