Couldn't you modify an existing network monitor to do what you want (nagios, et.al.)? I'm not sure you can even send a ping packet in lua, I don't recall lua sockets allowing raw packets; you'd have to roll-your-own bindings with raw socket support. I'd probably try python, perl, js/nodejs, php...