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.
Merge pull request #440 from neo14/master

trim ping host