cmdutils: add ping function