Help for this page
if ( !( system("ping -q -w 1 $host > /dev/null 2>&1") ) ) { #do something ... else { #report the failure }