This is a comprehensive network monitoring tools collection that includes various network connectivity and performance monitoring scripts, suitable for network diagnostics, performance analysis, and troubleshooting.
- Multi-Protocol Support: ICMP Ping, HTTP/HTTPS (cURL), DNS Resolution, UDP Ping, TCP Ping
- Intelligent Analysis: Dynamic threshold calculation, problem period identification, statistical analysis
- Detailed Logging: Structured logging for long-term monitoring
- Cross-platform: Supports macOS, Linux, Windows
- Flexible Configuration: Customizable monitoring parameters, intervals, timeouts, etc.
- Multiple Output Formats: Supports plain text and Markdown format reports
/
├── README.md # Project documentation
├── icmp_ping/ # ICMP Ping monitoring tools
│ ├── monitor_ping.py # ICMP ping monitoring script
│ └── analyze_network_log.py # ICMP ping log analysis script
├── curl_ping/ # HTTP/HTTPS monitoring tools
│ ├── monitor_curl.py # cURL website connectivity monitoring script
│ └── analyze_curl_log.py # cURL log analysis script
├── dns_lookup/ # DNS resolution monitoring tools
│ ├── monitor_dns.py # DNS resolution monitoring script
│ └── analyze_dns_log.py # DNS log analysis script
├── udp_ping/ # UDP Ping monitoring tools
│ ├── ping_udp.py # UDP ping monitoring script
│ ├── analyze_udp_ping_log.py # UDP ping log analysis script
│ └── README.md # UDP ping usage instructions
└── tcp_ping/ # TCP Ping monitoring tools
├── monitor_tcp_ping.py # TCP ping monitoring script
├── analyze_tcp_ping_log.py # TCP ping log analysis script
└── README.md # TCP ping usage instructions
Function: Traditional ICMP ping monitoring to detect network connectivity and latency
Features:
- Automatic public IP address acquisition
- Multi-platform ping command support
- Real-time ping results and statistics display
- Detailed network latency analysis
Usage:
# Basic usage
python3 monitor_ping.py google.com
# Custom parameters
python3 monitor_ping.py google.com --interval 5 --timeout 10
# Analyze logs
python3 analyze_network_log.py ping_google.com.log
python3 analyze_network_log.py ping_google.com.log --markdownFunction: Monitor website HTTP/HTTPS connectivity using cURL
Features:
- DNS resolution results display
- HTTP status code and response time recording
- HTTPS and redirect support
- Detailed error information recording
Usage:
# Monitor websites
python3 monitor_curl.py https://github.com
python3 monitor_curl.py http://example.com --interval 10
# Analyze logs
python3 analyze_curl_log.py curl_monitor_github.com.log
python3 analyze_curl_log.py curl_monitor_example.com.log --markdownFunction: Specialized monitoring of DNS resolution performance and reliability
Features:
- Fixed resolution of google.com domain
- Custom DNS server support
- TCP and UDP query protocol support
- DNS resolution time statistics
- IP address change tracking
- Query protocol logging and analysis
Usage:
# Use system default DNS (UDP)
python3 monitor_dns.py
# Use specified DNS server with UDP (default)
python3 monitor_dns.py 8.8.8.8
python3 monitor_dns.py 1.1.1.1 --interval 5
# Use TCP protocol for DNS queries
python3 monitor_dns.py 8.8.8.8 --tcp
python3 monitor_dns.py 1.1.1.1 --tcp --interval 5
# Analyze logs (supports both TCP and UDP log formats)
python3 analyze_dns_log.py dns_monitor_google.com_8.8.8.8_UDP.log
python3 analyze_dns_log.py dns_monitor_google.com_1.1.1.1_TCP.log --markdownFunction: UDP protocol connectivity testing
Features:
- UDP port connectivity detection
- Custom port support
- Timeout and error handling
- Detailed UDP connection statistics
Usage:
# Basic UDP ping
python3 ping_udp.py target_host 53
# Analyze logs
python3 analyze_udp_ping_log.py udp_ping_log.txtFunction: TCP protocol connectivity testing and port monitoring
Features:
- TCP port connectivity detection
- Concurrent connection testing
- Real-time RTT measurement
- Connection success rate statistics
- Support for any TCP port
- Detailed connection timing analysis
Usage:
# Basic TCP ping
python3 monitor_tcp_ping.py google.com 80
python3 monitor_tcp_ping.py 8.8.8.8 53
# Custom parameters
python3 monitor_tcp_ping.py example.com 443 --interval 5 --timeout 10
# Analyze logs
python3 analyze_tcp_ping_log.py tcp_monitor_google.com_80.log
python3 analyze_tcp_ping_log.py tcp_monitor_8.8.8.8_53.log --markdownAll monitoring scripts are equipped with corresponding log analysis tools that provide the following analysis functions:
- Dynamic Threshold Calculation: Automatically calculate performance thresholds based on historical data
- Problem Period Identification: Automatically identify network anomaly time periods
- Statistical Analysis: Success rate, average latency, maximum/minimum values, etc.
- Trend Analysis: Network performance change trends
- Error Classification: Intelligent classification of different types of network errors
- Plain Text Format: Suitable for terminal viewing and logging
- Markdown Format: Suitable for document generation and sharing
- Python 3.6+
- Network connection
- ping: Built-in system tool (ICMP ping monitoring)
- curl: Built-in or needs installation (HTTP/HTTPS monitoring)
- nslookup: Built-in system tool (DNS monitoring)
- nc (netcat): Built-in or needs installation (UDP ping monitoring)
- macOS
- Linux (Ubuntu, CentOS, Debian, etc.)
- Windows (requires corresponding command-line tools)
-
Clone or Download Project
# If it's a git repository git clone <repository_url> cd ai_written_tools
-
Choose Monitoring Tool
# ICMP Ping monitoring cd icmp_ping python3 monitor_ping.py google.com # HTTP/HTTPS monitoring cd curl_ping python3 monitor_curl.py https://github.com # DNS resolution monitoring cd dns_lookup python3 monitor_dns.py --dns-server 8.8.8.8 # TCP Ping monitoring cd tcp_ping python3 monitor_tcp_ping.py google.com 80
-
Analyze Monitoring Results
# After waiting for some time, analyze the generated logs python3 analyze_*.py <log_file_name> --markdown
- Use ICMP ping to detect basic connectivity
- Use HTTP monitoring to detect web service availability
- Use DNS monitoring to detect domain resolution issues
- Long-term monitoring of network latency changes
- Monitor DNS resolution performance
- Monitor web service response times
- Evaluate network stability
- Analyze network performance trends
- Generate network quality reports
Most scripts support the following common parameters:
--interval: Monitoring interval (seconds)--timeout: Timeout duration (seconds)--output: Custom log file name
Some scripts support configuration through environment variables:
export MONITOR_INTERVAL=30
export MONITOR_TIMEOUT=10-
Permission Issues
- Some systems may require administrator privileges to execute ping commands
- Solution: Run scripts with
sudo
-
Command Not Found
- Ensure the system has necessary network tools installed (ping, curl, nslookup, nc)
- macOS: Usually comes with all tools pre-installed
- Linux: May need to install
iputils-ping,curl,netcat
-
Network Firewall
- Some network environments may block specific protocols
- Solution: Check firewall settings or use alternative monitoring methods
This project is licensed under the MIT License.
Welcome to submit Issues and Pull Requests to improve this project.
Note: These tools are primarily for network diagnostics and monitoring. Please use them responsibly to avoid excessive load on target servers.