-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ping device tracker #5176
Ping device tracker #5176
Conversation
@michaelarnauts, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @robbiet480 to be potential reviewers. |
@scipioni can you also take a look? |
count option is directly managed by ping command (ping -c<number>), so no
loop is needed
2017-01-04 19:42 GMT+01:00 Michaël Arnauts <notifications@github.com>:
… @scipioni <https://github.com/scipioni> can you also take a look?
I used @balloob <https://github.com/balloob> 's suggestion from #4577
(comment)
<#4577 (comment)>
to add the dev_id, since the IP addresses should be fixed anyway. The
count option of the ping is also always 1, since you did it multiple
times in a for loop anyway if count > 1.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5176 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADl4CxC_7nUeRgJ6nLmAG7qnRNgWxmW9ks5rO-f_gaJpZM4La7bv>
.
|
That's right, but alive hosts will also be pinged Also, what should be the state of the host if it replies one time, and fails to reply another time (with count=2)? If it should be considered alive when at least one reply has been received, it's a waste of resources to send another ping. |
Il 04/gen/2017 20:08, "Michaël Arnauts" <notifications@github.com> ha
scritto:
That's right, but alive hosts will also be pinged number times then. Isn't
the purpose of count to give it number retries in case the hosts doesn't
answer?
Also, what should be the state of the host if it replies one time, and
fails to reply another time (with count=2)? If it should be considered
alive when at least one reply has been received, it's a waste of resources
to send another ping.
Yes, It is nicer to consider only first good packet. Thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5176 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADl4C5YWvu2DewKfMo36EmrSdPfnTYN-ks5rO-4ngaJpZM4La7bv>
.
|
Looks good. |
Description:
Device tracker that uses ICMP ping messages to detect host status.
This can be useful when devices are running a firewall and is blocking UDP or TCP packets, but responding to ICMP (like Android phones).
This tracker doesn't need to know the mac address, since the host can be on a different subnet. This makes this the ideal solution to detect hosts on a different subnet when nmap or other solutions don't work since arp doesn't work.
Based on the code of @scipioni of PR #4577 and PR #4420, but dropped arp and added command line options to ping for windows, also, the way the hosts are defined isn't a list but key-value pairs.
Related issue (if applicable): fixes #
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#1723
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass