Shubhamjain007 / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

org.openhab.io.net.actions.Ping doesn't work properly without port #134

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
it might have to do with

http://stackoverflow.com/questions/4779367/problem-with-isreachable-in-inetaddre
ss-class

insufficient privileges of the openHAB-user ... maybe we'll find another 
(platform independent) solution here.

Original issue reported on code.google.com by teichsta on 4 Oct 2012 at 12:57

GoogleCodeExporter commented 8 years ago
Issue 233 has been merged into this issue.

Original comment by kai.openhab on 9 Apr 2013 at 7:38

GoogleCodeExporter commented 8 years ago
Didn't know exactly where to comment ... As far as I understand, there is no 
way to create a RAW socket in Java, only TCP and UDP. So there is no way to do 
a proper 100% Java ICMP ping. There are then two options, stay on the current 
solution, or implement a non-pure Java one.

Original comment by tomazh.s...@gmail.com on 9 Apr 2013 at 10:12

GoogleCodeExporter commented 8 years ago
As there is no platform independent, pure Java solution possible, we suggest to 
workaround the problem using the exec binding like this:

Switch PingableThing { exec="<[/bin/sh@@-c@@ping -c 1 192.168.1.10 | grep 
\"packets transmitted\" | sed -e \"s/.*1 received.*/ON/\" -e \"s/.*0 
received.*/OFF/\":30000:REGEX((.*))]" }

Original comment by kai.openhab on 17 Apr 2013 at 9:14

GoogleCodeExporter commented 8 years ago
or
sudo chmod 4755 /bin/ping

Original comment by paul.lal...@gmail.com on 26 Sep 2014 at 10:18