4# Network Monitoring System
A comprehensive network monitoring solution that provides real-time monitoring, alerting, and reporting for network devices and services.
-
Device Monitoring
- Automatic device discovery
- Multi-vendor support (Cisco, Juniper, HP/Aruba, etc.)
- Layer 2 and Layer 3 topology mapping
- Hardware health monitoring
-
Network Services Monitoring
- DNS health and response times
- DHCP lease status
- Active Directory replication
- Load balancer status
-
Performance Monitoring
- Bandwidth utilization
- Packet loss rates
- Latency measurements
- QoS metrics
- Interface errors and discards
-
Security Monitoring
- Unusual traffic patterns
- Port security violations
- ACL violations
- Authentication failures
-
Smart Alerting
- Multi-tier alerting (Critical, Warning, Info)
- Alert correlation and deduplication
- Business impact assessment
- Rich context in notifications
- Customizable escalation paths
-
Reporting
- Daily health summaries
- Weekly trend analysis
- Monthly capacity planning
- Custom report generation
- Python 3.8 or higher
- Network access to monitored devices
- SNMP access configured on network devices
- SSH access for configuration verification
- Required Python packages:
networkx>=2.5 requests>=2.25.1 jinja2>=2.11.3 pysnmp>=4.4.12 scapy>=2.4.4 dnspython>=2.1.0 python-ldap>=3.3.1
-
Clone the repository:
git clone https://github.com/your-org/network-monitor.git cd network-monitor
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # Linux/Mac # or .\venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Create configuration file:
cp config/config.example.json config/config.json
-
Update configuration with your environment details:
- Network ranges for device discovery
- Device credentials
- SMTP settings for email alerts
- Slack webhook URL for Slack notifications
- Business service definitions
-
Set up device discovery:
{ "devices": { "enable_discovery": true, "discovery_networks": [ "192.168.1.0/24", "10.0.0.0/24" ] } }
-
Configure credentials:
{ "devices": { "credentials": { "cisco_devices": { "username": "admin", "password": "{{ CISCO_PASSWORD }}", "enable_password": "{{ CISCO_ENABLE }}" } } } }
-
Set up notifications:
{ "alerting": { "notifications": { "slack_enabled": true, "slack_webhook_url": "{{ SLACK_WEBHOOK_URL }}", "email_enabled": true, "smtp": { "server": "smtp.company.com", "port": 587 } } } }
-
Custom monitoring thresholds:
{ "metrics": { "thresholds": { "network_performance": { "bandwidth_utilization": { "warning": 70, "critical": 85 } } } } }
-
Business service definitions:
{ "alerting": { "business_services": [ { "name": "Core Network", "priority": 1, "dependencies": ["192.168.1.1"] } ] } }
-
Basic monitoring:
python network_monitor.py
-
With debug logging:
python network_monitor.py --debug
-
With custom config:
python network_monitor.py --config /path/to/config.json
-
Force topology refresh:
python network_monitor.py --refresh-topology
-
Generate reports:
python network_monitor.py --generate-report daily python network_monitor.py --generate-report weekly
-
Test notifications:
python network_monitor.py --test-notifications
-
Critical Alerts
- Immediate action required
- Service-affecting issues
- Security incidents
- Hardware failures
-
Warning Alerts
- Performance degradation
- Capacity thresholds
- Configuration issues
- Trending towards critical
-
Info Alerts
- System changes
- Performance statistics
- Routine events
- Baseline updates
-
Device Discovery Failures
- Verify network connectivity
- Check SNMP credentials
- Confirm firewall rules
- Validate IP ranges
-
Alert Notification Issues
- Verify SMTP settings
- Check Slack webhook URL
- Confirm recipient addresses
- Review notification logs
-
Performance Issues
- Adjust polling intervals
- Optimize SNMP queries
- Review batch sizes
- Check resource usage
Logs are stored in the logs
directory:
network_monitor.log
: Main application logalert_manager.log
: Alert processing logdevice_discovery.log
: Device discovery logmetrics_collection.log
: Metrics collection log
Enable debug logging for detailed information:
python network_monitor.py --debug
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support:
- Open an issue on GitHub
- Contact: support@company.com
- Documentation: https://docs.company.com/network-monitor