-ip=`cat /dev/shm/port.$host.ping | cut -d' ' -f5 | tr -d '()':`
-host=`cat /dev/shm/port.$host.ping | cut -d' ' -f4`
+# did we got resolved IP address?
+if grep '(' /dev/shm/port.$host.ping >/dev/null ; then
+ ip=`cat /dev/shm/port.$host.ping | cut -d' ' -f5 | tr -d '():'`
+ host=`cat /dev/shm/port.$host.ping | cut -d' ' -f4`
+else
+ ip=`cat /dev/shm/port.$host.ping | cut -d' ' -f4 | tr -d ':'`
+fi