Skip to content
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

Use technique other than ping to assess connection status #78

Open
hugoh opened this issue Oct 20, 2022 · 7 comments
Open

Use technique other than ping to assess connection status #78

hugoh opened this issue Oct 20, 2022 · 7 comments

Comments

@hugoh
Copy link
Contributor

hugoh commented Oct 20, 2022

It looks like T-Mobile started blocking pings, and so the connection looks down even when it's not. This broke this tool for me – I'm assuming for others too.

We should add a different mechanism, such as DNS lookup or HTTP request.

@tarunVreddy
Copy link

I'm not seeing a block of pings on my connection. Did you make a network change? Or maybe it is happening but geographically. It would be bad network policy to do it though.

@hugoh
Copy link
Contributor Author

hugoh commented Oct 20, 2022

@Thaine1690
Copy link

Thaine1690 commented Nov 5, 2022

If it helps, this is the route-test script that I use now that I cannot get a ICMP reply on TMOHI:

#!/bin/bash
# Checks for WAN connectivity via curl6 (avoid IPv4 emulation)
# Usages: $0 <reboot_if_fail>

# add your website targets here
targets=(
'2606:4700:4700::1111'
'2620:119:35::35'
'2001:4860:4860::8888'
)

reboot_if_fail=$1 

# Print Config 
/tmo-monitor/tmo-monitor.py --skip-bands --ping-count 0

for host in $targets
do
  curl -g -6 -Is -m 1 --head --interface $intf http://[$host]:80/ 2>$1 | grep -w "200\|301"
  if [ $? == 0 ]
  then
    echo "Online"
    exit 0
  fi
done 
 
# fail
 echo "Failed"
  if [ $reboot_if_fail == 1 ]
  then
  echo "Forcing Reboot"
    /tmo-monitor/tmo-monitor.py --reboot
  fi
exit 1

@highvolt-dev
Copy link
Owner

related to #13

highvolt-dev added a commit that referenced this issue Feb 11, 2023
… explicit support for Sagecom gateway
highvolt-dev added a commit that referenced this issue Feb 11, 2023
…ectivity_test

add support for alternative connectivity checks - fixes #13 #78 ; add…
@highvolt-dev
Copy link
Owner

Http based connectivity tests added in https://github.com/highvolt-dev/tmo-monitor/releases/tag/v2.0.0-beta8 - still could use DNS other means of testing.

@scheblein
Copy link

http is working, but it appears to still be performing the ping test?

2023/03/27 14:16:16 [DEBUG] Enabled file logging to /var/log/tmo-monitor.log
2023/03/27 14:16:16 [DEBUG] Starting new HIT connection (1): 192.168.12.1:80
2023/03/27 14:16:16 [DEBUG] http://192.168.12.1:80 "POST /IMI/u1/auth/login HTTP/1.1' 200 403
2023/03/27 14:16:16 [DEBUG] Starting new HTTP connection (1): 192.168.12.1:80
2023/03/27 14:16:16 [DEBUG] http://192.168.12.1:80 "GET /TMI/v1/network/telemetry?get=all HTTP/1.1'
200 2356
eMB ID check passed, on <redacted>.
2023/03/27 14:16:16 [DEBUG] Starting new HITP connection (1): 192.168.12.1:80
2023/03/27 14:16:16 [DEBUG] http://192.168.12.1:80 "GET /IMI/u1/gateway?get=all HTTP/1.1" 200 1089
Camping on <redacted>.
Camping on <redacted>.
PING google.com (142.250.190.14) 56(84) bytes of data.

--- google.com ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time Oms


2023/03/27 14:16:26 [DEBUG] Starting new HTTPS connection (1): google.com:443
2023/03/27 14:16:29 [DEBUG] https://google.com:443 "GET /generate_204 HITP/1.1" 204 0
No reboot necessary.
2023/03/27 14:16:29 [INFO] 4G: <redacted> | 5G: <redacted> | EMB ID: <redacted> | Avg Ping: -1 ms | Uptime: 43248 sec

my .env file

# Rename file to `.env` to use.
# The .env file will be loaded from the current or (recursive) parent directories.
# All settings are prefixed with `tmo_` to allow for common `.env` files at the root.

# Gateway model
tmo_model=ARCKVD21

# Trashcan login settings
tmo_username=admin
tmo_password=<redacted>

# Connectivity check
tmo_connectivity_check=http

# Reboot settings: minimum uptime (seconds) & reboot on failed check {True, False}
tmo_http_reboot=True

# General settings
tmo_logfile=/var/log/tmo-monitor.log
tmo_log_all=True

when setting tmp_connectivity_check to http, can we skip the ping test?

@highvolt-dev
Copy link
Owner

Thanks for reporting, @scheblein - I was originally going to remove the call to ping when the connectivity check is set to http, but I realized the logging behavior expects to call ping for recording the latency - so right now the connectivity check is only used for determining whether or not to reboot, not whether ping is called or not. Ideally, I'd like to call httping to measure latency and perform HTTP-based connectivity checks that way we can still record a latency but with a different provider than an ICMP ping.

hugoh added a commit to hugoh/tmo-monitor that referenced this issue May 26, 2023
* Fixed tmo_monitor.gateway module installation

* Update README.md

add Windows directions

* use meaningful exit status codes, fixes highvolt-dev#52

* clarify that a clean run will exit with status code 0 as expected

* add project logo

* First commit to log to syslog - not working yet

Moved all the logging from print_and_log to logging, but syslog doesn't
work. Need to debug.

* Made Linux syslog logging work

* Moved away from f-Strings to lower Python version requirement

* Added support for Windows (untested)

* Fixed log message format

* Fixed out-of-scope use of syslog_socket

* Fixed missing leading space

* add missing import

* fixes highvolt-dev#56 breaking change to webapp login after Nokia firmware upgrade to 1.2103.00.0338

* version bump

* add IPv6 ping support, fixes highvolt-dev#43

* use ping6 binary if available for ipv6 ping functionality, fixes highvolt-dev#43

* fix setting IPv6 ping via .env

* conditionally check for lsid cookie to avoid runtime error with nokia 2104 firmware update

* calculate arcaydyan eNB ID using decimal base fixes highvolt-dev#68 caused by firmware update

* safely access 5g band info for arcadyan gateway - fixes highvolt-dev#75

* add support for alternative connectivity checks - fixes highvolt-dev#13 highvolt-dev#78 ; add explicit support for Sagecom gateway

* correct README

* explicitly pass -4 flag to ping command to try ipv4 with ping command except for OS X clients, fixes highvolt-dev#77

---------

Co-authored-by: highvolt-dev <highvoltage@gmail.com>
hugoh added a commit to hugoh/tmo-monitor that referenced this issue May 26, 2023
* Fixed tmo_monitor.gateway module installation

* Update README.md

add Windows directions

* use meaningful exit status codes, fixes highvolt-dev#52

* clarify that a clean run will exit with status code 0 as expected

* add project logo

* First commit to log to syslog - not working yet

Moved all the logging from print_and_log to logging, but syslog doesn't
work. Need to debug.

* Made Linux syslog logging work

* Moved away from f-Strings to lower Python version requirement

* Added support for Windows (untested)

* Fixed log message format

* Fixed out-of-scope use of syslog_socket

* Fixed missing leading space

* add missing import

* fixes highvolt-dev#56 breaking change to webapp login after Nokia firmware upgrade to 1.2103.00.0338

* version bump

* add IPv6 ping support, fixes highvolt-dev#43

* use ping6 binary if available for ipv6 ping functionality, fixes highvolt-dev#43

* fix setting IPv6 ping via .env

* conditionally check for lsid cookie to avoid runtime error with nokia 2104 firmware update

* calculate arcaydyan eNB ID using decimal base fixes highvolt-dev#68 caused by firmware update

* safely access 5g band info for arcadyan gateway - fixes highvolt-dev#75

* add support for alternative connectivity checks - fixes highvolt-dev#13 highvolt-dev#78 ; add explicit support for Sagecom gateway

* correct README

* explicitly pass -4 flag to ping command to try ipv4 with ping command except for OS X clients, fixes highvolt-dev#77

* Pushing on docker-image

---------

Co-authored-by: highvolt-dev <highvoltage@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants