Comments (5)
By the way, my usage is to only reboot if the ping fails (so your multiple tries on the ping logic is nice.)
The log format I'm thinking of is to always check the connection stats and log when they change. Also, log when ping fails and the modem reboots.
For example:
2021-12-02 11:35:00 4G: B2 5G: n41 Ping: 75ms
2021-12-02 11:36:00 4G: B66 5G: n41 Ping: 80 ms # logged due to 4G band change
2021-12-02 11:40:00 4G: B2 5G: n41 Ping: 100ms # logged due to 4G band change
2021-12-02 11:40:00 4G: B2 5G: n41 Ping: failed ***REBOOTING***
This led me to separate the configuration and reboot logic in the .env
file. Instead of "suppress reboot on X" switches, I have entries to explicitly specify "reboot when X fails."
from tmo-monitor.
@AndrewPardoe thanks for sharing - I am glad you are finding value in the script. I prefer supporting your changes so everyone can benefit and your work can maintained long-term. To adhere to semantic versioning and to anticipate differences in output based on the introduction of logging, I think this calls for a version bump to 2.0.0 once merged and released.
I already wanted to add support for .env
files and for logging, so this is great. Let's aim to ensure that there's feature parity and hopefully the notation in the .env
file can be as close as possible to the command line arguments to be easily understood in isolation without relying too heavily on the placeholder values.
I had a chance to start reviewing your changes before you rewrote the history after my upstream commit, and saw you namespaced the config values to avoid inherited values like USERNAME
causing conflicts.
I think logging the reason for reboots is helpful as demonstrated in your example so it can serve as a proper audit trail. I do want to make sure that people don't need to resort to scraping their logs to analyze changes over time, so in the spirit of #11 hopefully this can eventually evolve to appending stats to a CSV or similar location (in theory the serialization format should be pluggable).
Naturally, we'd still want the sort of logging you've shown.
In terms of "reboot on X", I do think it may be nice to have a more declarative set of configuration (through the .env
and/or flags), so giving this release a major version bump should give some freedom to changing defaults vs what was necessary for backwards compatibility up to this point when I was bolting on additional functionality.
Namely, I think the script should not have opinionated defaults to the point where the user has to specify tons of configuration to undo defaults that don't suit common use cases. I also believe that the user shouldn't be surprised by what it is doing.
Probably the most neutral thing the script can do is check for bands (preferring none) and signal metrics, maybe perform a ping, possibly log the results, and then exit.
Let me know if you plan to add any extra polish, but I think for sure your work is welcome and can be merged in rather than staying separate.
from tmo-monitor.
Sounds good! Let me finish up the testing this week and I'll prepare a PR. I've got a few busy days at work ahead but I should be able to finish this week.
from tmo-monitor.
PR is #23
from tmo-monitor.
Fixed by #23
from tmo-monitor.
Related Issues (20)
- Implement support for multiple hashing iterations in authenticated Nokia web application endpoints
- not seeing .env in 2.0.0beta 4 HOT 7
- No module named 'tailer' HOT 3
- A more detailed installation procedure? HOT 2
- Arcadyan gateway doesn't always provide all signal information HOT 1
- Unit Tests? HOT 2
- Reboot functionality broken after Nokia firmware update to 1.2104.00.0286 HOT 1
- Arcaydyan enBID coming up wrong HOT 6
- Python 3.x compatibility
- Format uptime output to Day:Hours:Minute:seconds, similar to the GUI
- pip3 install . HOT 2
- Could not post reboot request HOT 4
- Crashes Immediately on macOS HOT 5
- Script fails if not connected to 5G band HOT 2
- Provide an option to explicitly force IPv4 ping HOT 1
- Use technique other than ping to assess connection status HOT 7
- Remember Beyond Novice? HOT 4
- Could not query site info on Arcaydian with 1.00.18 HOT 2
- ping6 output on FreeBSD 12 is slightly different that base.py expects
- [Enhancement] Add 4G/5G signal stats (RSRP, SNR, etc) to collection
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tmo-monitor.