trim whitespace from ping host

Added trim() function to the $host variable. If whitespace is in front
of the host or IP address the ping command will fail.