This will cause the program to exit gracefully. To exit the program, simply press Ctrl-C inside the console/terminal.
#Github script record internet uptime install#
Installation pip install monitor_internet_connection QuickStart python -m monitor_internet_connection How do I exit the program You must have Python 3.6 or higher installed. The log file may be disabled via a command line parameter. The information written to the log file is also displayed on the console/terminal. The log file is always appended to, never overwritten. The log file is written to the current working folder. The log file is called internet_monitor.log. When Internet connectivity is restored, the first observed time of restoration is logged.įinally, the total time duration of the Internet unavailability is logged. The one-minute logs can be useful as a proxy indicator of whether the computer lost power or just the Internet connection was unavailable. The first observed time of failure is logged.Įvery one-minute interval of subsequent unavailability is logged. What does monitor_internet_connection do?Įvery X seconds (default polling frequency is 1 second), the program monitors whether the Internet connection is alive and an external IP address is reachable. You may simply run this module in a console/terminal and leave it running for days/weeks on end. The Python module monitor_internet_connection is a solution to this problem in that it monitors Internet connectivity in real-time, displaying on the console/terminal and recording to a log file: the start time, the end time and the duration of any Internet connectivity downtime. Thus, will you need to rerun the entire program/process? Or just a part of it? and so on. What is worse - you may not know exactly when Internet connectivity was lost. If you have automated long-running processes/programs/activities on your computer that requires Internet connectivity, there is nothing worse than coming back the next hour/day/week/whenever to review the logs/progress and find out that the program(s) failed or data is missing because of lost Internet connectivity. Why should I use monitor_internet_connection? It is a Python module to monitor the uptime of the Internet connection - that is to say to monitor that an external IP address is always reachable. Monitoring Internet Connection stopped at : 12:42:38 The duration of the downtime was : 0:01:07 Internet Connection restored at : 08:36:27 Internet Connection unavailable at : 08:35:20 The duration of the downtime was : 0:00:09
![github script record internet uptime github script record internet uptime](https://user-images.githubusercontent.com/28774865/58318115-ada9ca00-7e06-11e9-9853-a3284c0f01bc.png)
Internet Connection restored at : 07:35:10 Internet Connection unavailable at : 07:35:01 Monitoring Internet Connection commencing : 10:34:45 polling every 1 second(s)
![github script record internet uptime github script record internet uptime](https://ardalis.com/static/185f9eb25db2533ca42534f8a38fb325/7fee5/github-issue-images.png)
![github script record internet uptime github script record internet uptime](http://learn.r-journalism.com/git/github/images/settings.png)
A Python module to monitor the uptime of the Internet connection in real-time and record the time and duration of any downtime.