Code Monkey home page Code Monkey logo

Comments (3)

highvolt-dev avatar highvolt-dev commented on June 7, 2024

Check that sufficient time has elapsed since last reboot by checking uptime before performing health checks.

A frequent script run interval will cause issues otherwise. The gateway takes approximately a minute to start up and will take a moment to connect to a band after the API is available, and a further slight delay until the 5G band connects under EN-DC.

Endpoint for gateway uptime:

GET /dashboard_device_info_status_web_app.cgi HTTP/1.1
Host: 192.168.12.1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive
Referer: http://192.168.12.1/web_whw/
Cookie: lsid=REDACTED
Pragma: no-cache
Cache-Control: no-cache

HTTP/1.1 200 OK
Cache-Control: no-store,max-age=0;, no-store,max-age=0;
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Security-Policy: default-src 'self' 'unsafe-inline' 'unsafe-eval'
Strict-Transport-Security: max-age=2592000; includeSubdomains
Content-type: text/html;charset=UTF-8
Content-Length: 2119
Date: Wed, 29 Sep 2021 21:02:48 GMT

{"device_app_status":[
{
"ManufacturerOUI":"REDACTED",
"ProductClass":"REDACTED",
"SerialNumber":"REDACTED",
"HardwareVersion":"REDACTED",
"SoftwareVersion":"1.2101.00.1609",
"Description":"FM 5G Gateway 2 T-Mobile",
"UpTime":729,
"lot_number":"REDACTED"
}
],
"device_cfg":["REDACTED"],
"bluetooth_status":[
{"Enable":0,
"Status":"Down"
}]
}

Uptime accessible via response.json()['device_app_status'][0]['UpTime']

from tmo-monitor.

highvolt-dev avatar highvolt-dev commented on June 7, 2024

If a check interval is frequent enough that a check is performed when there is insufficient uptime, it is unlikely necessary to make the script sleep because another check will be performed soon. Avoiding sleeping will allow mechanisms like cron to work with short intervals by avoiding long-running script execution times. This is not an issue with systemd timers, which ensure that a task is not actively running before triggering a run.

from tmo-monitor.

highvolt-dev avatar highvolt-dev commented on June 7, 2024

Allow the boot loop prevention uptime check to be configurable with a sane default threshold.

from tmo-monitor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.