This Python project is designed to monitor and report on internet connectivity. Here's what it does:
Tracks Connectivity: The script performs regular ping tests to a specified website or IP address, recording the latency (response time) of each test.
Visualizes Trends: It automatically generates daily plots that illustrate how your internet connection's performance changes throughout the day.
Delivers Reports: The script compiles daily reports containing the connectivity visualization and sends them via email.
Detects Issues: The script can be configured to send a report immediately if it detects a significant spike in ping times, indicating a potential connectivity problem.
Stores Historical Data (Optional): The script has the option to log connectivity data to a .log file for further analysis.
Use Cases
Troubleshooting Connectivity Problems: Identify recurring patterns of connection drops or slowdowns. Documenting Network Performance: Track connectivity over time for personal or business records. Remote Monitoring: Keep an eye on internet connectivity at a remote location. Let me know if you'd like any adjustments or a different level of detail!
Example 1: Email Report
Subject: Daily Internet Connectivity Report - 2024-04-03
Body:
"Please find attached the daily internet connectivity report."
Attachment: A PNG image file named "connectivity_report.png" containing a plot similar to this:
Sample Connectivity Plot: [invalid URL removed]
X-Axis: Time (e.g., 00:00 to 23:59) Y-Axis: Ping (ms) Line or Scatter Plot: Showing variations in ping results throughout the day Example 2: Log File (uptime_2024-04-03.log)
A simple text file containing comma-separated values:
09:15, 22.5 09:20, 20.1 09:25, 23.8 ... 17:45, 21.7 17:50, 25.4 ... Important Notes:
The exact appearance of the plot will depend on your internet connection quality over the day. It's possible that on some days the email report might be triggered due to a high ping spike (ping_result[-1] > 100 condition), indicating a temporary connectivity issue. The log file format allows for easy import into spreadsheet or analysis tools. Customization:
You can adjust the matplotlib plotting parameters to change the appearance of your graph (colors, markers, gridlines, etc.). Let me know if you'd like a more specific example or if you have preferences for how the output should look!