# Device connected and pinger script does not work

**URL:** <https://forum.inductiveautomation.com/t/device-connected-and-pinger-script-does-not-work/35452>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [June 9, 2020, 12:35pm UTC](https://forum.inductiveautomation.com/t/device-connected-and-pinger-script-does-not-work/35452 "2020-06-09T12:35:43Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [June 9, 2020, 3:39pm UTC](https://forum.inductiveautomation.com/t/device-connected-and-pinger-script-does-not-work/35452/2 "2020-06-09T15:39:19Z")

</div>

Try this native Java script instead of using command line:

> [@Script to ping computer](http://forum.inductiveautomation.com/t/script-to-ping-computer/16612/10):
>
> Shelling out for this makes me feel very icky, especially when Java already has the native ability to do this and that’s an invitation to accidentally send horrible things to the command line. Why not just: def ping(address,timeout=2000): from java.net import InetAddress ip = InetAddress.getByName(address) return ip.isReachable(timeout) This will throw UnknownHostException if the host can’t be looked up, or IOException if the network is broken, so you can handle that case as well, instead o…

---

_[View the full topic](https://forum.inductiveautomation.com/t/device-connected-and-pinger-script-does-not-work/35452)._
